/* ========================================
   Share Map 特有 CSS 变量
   基础变量来自 ../styles.css（共用）
   ======================================== */
:root {
  --accent: #7B9EF5;
  --accent-bg: rgba(123, 158, 245, 0.18);
  --accent-bg-light: rgba(123, 158, 245, 0.10);
  --accent-border: rgba(123, 158, 245, 0.25);
  --pink: #E8839E;
  --pink-bg: rgba(232, 131, 158, 0.18);
  --pink-bg-light: rgba(232, 131, 158, 0.10);
  --cat-tech: #7B9EF5;
  --cat-tech-bg: rgba(123, 158, 245, 0.10);
  --cat-art: #E8839E;
  --cat-art-bg: rgba(232, 131, 158, 0.10);
  --cat-life: #6BC4A0;
  --cat-life-bg: rgba(107, 196, 160, 0.10);
  --cat-academic: #C8B840;
  --cat-academic-bg: rgba(200, 184, 64, 0.10);
  --cat-business: #9A80CC;
  --cat-business-bg: rgba(154, 128, 204, 0.10);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 22px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-lang-wrap {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-hover-weak);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.settings-lang-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.settings-lang-switch {
  display: inline-flex;
  gap: 0;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.settings-lang-btn {
  flex: 1;
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-weak);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.settings-lang-btn:hover {
  color: var(--text-secondary);
}

.settings-lang-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Floating Header (左上角漂浮品牌) ===== */
.floating-header {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
}

.product-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.2px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.product-selector:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

.product-selector:active {
  background: var(--bg-glass-active);
  transform: scale(0.96);
}

.product-selector svg {
  display: block;
  flex-shrink: 0;
}

.product-selector .product-name {
  flex: 1;
  white-space: nowrap;
}

.product-selector .product-chevron {
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.2s ease;
}

.product-selector:hover .product-chevron {
  opacity: 0.7;
}

.product-selector.active .product-chevron {
  transform: rotate(180deg);
}

.product-dropdown {
  position: fixed;
  min-width: 180px;
  max-width: 240px;
  background: var(--bg-panel);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: none;
  border-radius: 10px;
  padding: 6px;
  z-index: 99999;
  display: none;
  box-shadow: var(--shadow-xl);
}

.product-dropdown.show {
  display: block;
  animation: menuFadeIn 0.12s ease;
}

.product-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-weak);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.12s ease;
  text-decoration: none;
}

.product-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.product-dropdown-item.active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-bg-light);
}

.product-dropdown-item .product-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  opacity: 0.5;
}

.product-dropdown-item:hover .product-item-icon {
  opacity: 0.9;
}

.product-dropdown-item.active .product-item-icon {
  opacity: 1;
}

.product-dropdown-item .product-item-check {
  margin-left: auto;
  opacity: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--accent);
}

.product-dropdown-item.active .product-item-check {
  opacity: 1;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Search ===== */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  min-width: 312px;
   max-width: 480px;
  height: 44px;
  padding: 0 12px;
  gap: 6px;
  transition: all var(--transition-base);
  flex: 1;
  cursor: text;
}

.search-wrap:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.02);
}

.search-wrap:active {
  transform: scale(0.98);
}

.search-wrap:focus-within {
  background: var(--bg-glass-hover);
  box-shadow: var(--shadow-hover);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-clear {
  display: none;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all var(--transition-fast);
}

.search-clear:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.search-wrap.has-text .search-clear {
  display: flex;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: none;
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-xl);
  z-index: 99999;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}

.search-results.show {
  display: block;
  animation: menuFadeIn 0.12s ease;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item .sr-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-item .sr-info {
  flex: 1;
  min-width: 0;
}

.search-result-item .sr-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item .sr-detail {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item .sr-category {
  display: inline-block;
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 500;
  flex-shrink: 0;
}

.search-result-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ===== Search Location Result ===== */
.search-loc-result {
  padding: 10px 12px !important;
  margin-bottom: 6px;
  background: var(--accent-bg-light);
  border: 1px solid var(--accent-border);
  border-radius: 10px !important;
}

.search-loc-result:hover {
  background: var(--accent-bg) !important;
}

.search-loc-result .loc-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-bg);
  border-radius: 50%;
  color: var(--accent);
}

.search-loc-result .loc-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent);
  letter-spacing: -0.2px;
}

.search-loc-result .loc-desc {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.2;
  margin-top: 2px;
}

.search-loc-result .loc-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.search-loc-result:hover .loc-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ===== Float Buttons Right (右上角) ===== */
.float-buttons-right {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
}

.float-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  padding: 0;
  margin: 0;
}

.float-btn:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

.float-btn:active {
  transform: scale(0.96);
}

/* ===== Map Container ===== */
.map-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
}

.map-container .leaflet-container {
  width: 100%;
  height: 100%;
  background: #0a0a0a;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 500;
  color: var(--text-secondary);
  font-size: 13px;
  transition: opacity var(--transition-smooth);
}

.map-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border-primary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Bottom Controls (右下角控制区) ===== */
.bottom-controls {
  position: fixed;
  bottom: 24px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 800;
}

.zoom-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  line-height: 1;
}

.zoom-btn:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

.zoom-btn:active {
  transform: scale(0.96);
}

.locate-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  padding: 0;
  margin: 0;
  outline: none;
}

.locate-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.locate-btn:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

.locate-btn:active {
  transform: scale(0.96);
}

.locate-btn.locating {
  color: var(--text-secondary);
}

.locate-btn.located {
  color: var(--accent);
}



/* ===== Marker Bubble Card ===== */
.marker-icon-wrapper {
  overflow: visible !important;
}

.marker-bubble {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  min-width: 200px;
  max-width: 320px;
  width: auto;
}

.marker-bubble:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  background: var(--bg-glass-hover);
  z-index: 1000 !important;
}

.marker-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(30, 30, 30, 0.9);
}

.marker-bubble .bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.marker-bubble .bubble-row .bubble-topic {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.2px;
}

.marker-bubble .bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.08);
  margin-top: 1px;
}

.marker-bubble .bubble-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.marker-bubble .bubble-footer .bubble-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.marker-bubble .bubble-footer .bubble-subtitle {
  font-size: 9px;
  color: var(--text-tertiary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  margin-right: auto;
}

.marker-bubble .bubble-footer .bubble-category {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 500;
  flex-shrink: 0;
}

/* ===== User Location Marker ===== */
.user-location-marker {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 3px solid rgba(96, 165, 250, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
  animation: pulse 2s ease-out infinite;
}

.user-location-marker::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(96, 165, 250, 0.2);
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  width: 90vw;
  max-width: 560px;
  max-height: 85vh;
  background: var(--bg-panel-alt);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: none;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-panel {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--transition-base);
}

.modal-close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-body.chat-active {
  overflow: hidden;
}

.modal-body::-webkit-scrollbar {
  display: none;
}

/* ===== Chat View ===== */
.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 400px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
}

.chat-back {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-back:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
  align-items: flex-start;
}

.chat-msg-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-msg-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--bg-hover);
  word-break: break-word;
}

.chat-msg-me .chat-msg-bubble {
  background: var(--accent);
  color: #fff;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-tertiary);
  padding: 0 4px;
}

.chat-msg-me .chat-msg-time {
  text-align: right;
}

.chat-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px 20px;
  font-size: 13px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-secondary);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border-primary);
  border-radius: 10px;
  background: var(--bg-hover-weak);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
  font-family: inherit;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.chat-send-btn {
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ===== Signup Banner ===== */
.signup-banner {
  position: fixed;
  bottom: 24px;
  left: 16px;
  z-index: 9990;
  pointer-events: none;
}

.btn-signup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: var(--bg-glass) !important;
  color: var(--text-secondary) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--transition-base) !important;
}

.btn-signup:hover {
  background: var(--bg-glass-hover) !important;
  color: var(--text-primary) !important;
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3) !important;
}

.btn-signup:active {
  transform: scale(0.96) !important;
}

.btn-signup svg {
  color: var(--accent);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.btn-signup .signup-btn-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-signup .signup-btn-sub {
  font-size: 11px;
  font-weight: 600;
  color: #ffc832;
  background: rgba(255,200,50,0.12);
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1.3;
  white-space: nowrap;
}

/* ===== Signup Modal ===== */
.signup-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signup-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.signup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.signup-panel {
  position: relative;
  width: 90vw;
  max-width: 560px;
  max-height: 85vh;
  background: var(--bg-panel-alt);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: none;
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signup-overlay.active .signup-panel {
  transform: scale(1) translateY(0);
}

.signup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--transition-base);
}

.signup-close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.signup-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.signup-body::-webkit-scrollbar {
  display: none;
}

.signup-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 16px;
  background: linear-gradient(135deg, rgba(96,165,250,0.1) 0%, transparent 100%);
}

.signup-hero-text h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.signup-hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #ffc832;
  background: rgba(255, 200, 50, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1.4;
}

.signup-hero-text p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.signup-form {
  padding: 16px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.signup-input {
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--bg-hover-weak);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.signup-input:focus {
  background: var(--bg-hover);
  box-shadow: none;
}

.signup-input::placeholder {
  color: var(--text-tertiary);
}

.signup-textarea {
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--bg-hover-weak);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  min-height: 100px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

.signup-textarea:focus {
  background: var(--bg-hover);
  box-shadow: none;
}

.signup-textarea::placeholder {
  color: var(--text-tertiary);
}

/* ===== Category Dropdown Selector ===== */
.signup-category-select-wrap {
  flex-shrink: 0;
  width: 140px;
}

.signup-category-dropdown {
  position: relative;
  width: 100%;
}

.signup-category-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  user-select: none;
  height: 44px;
  box-sizing: border-box;
}

.signup-category-selected:hover {
  background: var(--bg-input-focus);
}

.signup-category-dropdown.open .signup-category-selected {
  background: var(--bg-input-focus);
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.category-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.dropdown-arrow {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.25s ease;
}

.signup-category-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.signup-category-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  width: max-content;
  max-width: 220px;
  background: var(--bg-panel-solid);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 100;
  overflow: hidden;
  padding: 6px;
}

.signup-category-dropdown.open .signup-category-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.category-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-size: 13px;
}

.category-option:hover {
  background: var(--bg-hover-weak);
}

.category-option.selected {
  font-weight: 600;
}

.option-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.option-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.category-option.selected .option-label {
  font-weight: 700;
  color: var(--opt-color);
}

/* ===== Signup Location Bar ===== */
.signup-titles-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.signup-titles-area {
  flex: 1;
  min-width: 0;
}

.signup-location-area {
  width: 172px;
  flex-shrink: 0;
  position: relative;
}

.signup-location-wrap {
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-input);
  border: none;
  overflow: hidden;
}

.signup-location-pin {
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.signup-location-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent !important;
  border: none;
  outline: none;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
}

.signup-location-input::placeholder {
  color: var(--text-tertiary);
}

.signup-location-input::selection {
  background: var(--accent);
  color: #fff;
}

.signup-locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-right: 4px;
  outline: none;
}

.signup-locate-btn:hover {
  background: transparent;
}

.signup-locate-btn.locating {
  animation: pulse 1.2s ease-in-out infinite;
  color: var(--accent);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.signup-location-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-panel-solid);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 100;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.signup-location-suggestions::-webkit-scrollbar {
  width: 4px;
}

.signup-location-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.signup-location-suggestions::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

.signup-location-suggestions.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.signup-location-suggestion {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.signup-location-suggestion:hover {
  background: var(--bg-hover-weak);
}

.signup-location-suggestion.selected {
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--accent);
}

.signup-location-suggestion svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

/* ===== Rich Text Editor ===== */
.signup-editor-wrap {
  position: relative;
  border-radius: 10px;
  background: var(--bg-hover-weak);
  transition: background 0.2s;
}

.signup-editor-wrap:focus-within {
  background: var(--bg-hover);
}

.signup-richtext {
  padding: 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  min-height: 130px;
  line-height: 1.7;
  cursor: text;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

.signup-richtext:empty:before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ===== Floating Toolbar ===== */
.signup-float-bar {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  background: rgba(30,35,45,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.signup-float-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.signup-float-bar .rt-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.1s;
}

.signup-float-bar .rt-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.signup-float-bar .rt-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
  flex-shrink: 0;
}

.signup-richtext h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: var(--text-primary);
}

.signup-richtext h4:first-child {
  margin-top: 0;
}

.signup-richtext ul,
.signup-richtext ol {
  padding-left: 20px;
  margin: 4px 0;
}

.signup-richtext li {
  margin: 2px 0;
}

.signup-richtext b, .signup-richtext strong { font-weight: 700; }
.signup-richtext i, .signup-richtext em { font-style: italic; }
.signup-richtext u { text-decoration: underline; }

.signup-avatar-upload {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.signup-avatar-upload:hover .signup-avatar-overlay {
  opacity: 1;
}

.signup-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(96,165,250,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
  overflow: hidden;
}

.signup-avatar-empty {
  border: 2px dashed rgba(96,165,250,0.35);
  background: rgba(96,165,250,0.06);
}

.signup-avatar-loading {
  border: 2px dashed rgba(255,214,10,0.5);
  background: rgba(255,214,10,0.06);
}

.signup-avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.signup-titles-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.signup-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.signup-title-input {
  flex: 1;
}

.signup-add-title,
.signup-remove-title {
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(96,165,250,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.signup-add-title:hover {
  background: rgba(96,165,250,0.25);
  color: #60A5FA;
  transform: scale(1.12);
}

.signup-remove-title {
  background: rgba(255,69,58,0.1);
  color: #ff453a;
}

.signup-remove-title:hover {
  background: rgba(255,69,58,0.2);
  color: #ff453a;
  transform: scale(1.12);
}

.signup-name-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.signup-name-field {
  flex: 1;
}

.signup-topic-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.signup-topic-field {
  flex: 1;
}

.signup-price-field {
  flex-shrink: 0;
}

.signup-price-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-hover-weak);
  border-radius: 10px;
  padding: 0 10px;
  height: 44px;
  box-sizing: border-box;
  transition: all 0.2s;
}

.signup-price-wrap:focus-within {
  background: var(--bg-hover);
}

.signup-price-prefix {
  font-size: 13px;
  font-weight: 700;
  color: #ffc832;
  background: rgba(255,200,50,0.2);
  padding: 1px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1.4;
}

.signup-price-wrap .signup-price-input {
  width: 40px;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  text-align: center;
  height: 100%;
}

.signup-price-wrap .signup-price-input:focus {
  box-shadow: none;
}

/* Hide number input spinners */
.signup-price-input::-webkit-inner-spin-button,
.signup-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.signup-price-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.signup-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
  padding: 0 0 2px;
}

.signup-fee-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 214, 10, 0.15);
  color: #FFD60A;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  margin-left: 6px;
}

.signup-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  background: var(--accent-bg);
  color: var(--accent);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.signup-submit:hover {
  background: var(--accent-bg);
  transform: scale(1.01);
}

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

/* ===== Success Modal ===== */
.signup-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.signup-success-overlay.active {
  opacity: 1;
  visibility: visible;
}

.signup-success-modal {
  background: var(--bg-panel-solid);
  border-radius: 20px;
  padding: 40px 36px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signup-success-overlay.active .signup-success-modal {
  transform: scale(1) translateY(0);
}

.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #42D9A0 0%, #34C759 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(66, 217, 160, 0.3);
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(66, 217, 160, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 12px 32px rgba(66, 217, 160, 0.4); }
}

.signup-success-modal h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.signup-success-modal p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.success-notice {
  background: rgba(255, 214, 10, 0.08);
  border: 1px solid rgba(255, 214, 10, 0.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 28px;
  text-align: left;
}

.success-notice strong {
  color: #FFD60A;
  font-size: 13px;
  display: block;
  margin-bottom: 6px;
}

.success-notice {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.success-btn {
  width: 100%;
  padding: 14px 32px;
  background: linear-gradient(135deg, #42D9A0 0%, #34C759 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(66, 217, 160, 0.25);
}

.success-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 217, 160, 0.35);
}

.success-btn:active {
  transform: translateY(0);
}

/* ===== Modal Content ===== */
.modal-hero {
  position: relative;
  padding: 32px 24px 20px;
  background: linear-gradient(160deg, var(--bg-hover-weak) 0%, transparent 100%);
}

.modal-hero .hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.modal-hero .hero-name {
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: -0.3px;
}

.modal-hero .hero-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.modal-hero .hero-category {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
}

.modal-section {
  padding: 14px 24px 10px;
}

.modal-section:last-of-type {
  padding-bottom: 18px;
}

.modal-section + .modal-section {
  padding-top: 6px;
}

.modal-section:last-child {
  border-bottom: none;
}

.modal-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.modal-section .knowledge-content {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-strong);
}

.modal-section .knowledge-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: #fff;
}

.modal-section .knowledge-content b {
  color: #fff;
  font-weight: 600;
}

.modal-section .knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.knowledge-tag {
  font-size: 12px;
  padding: 4px 11px;
  background: var(--bg-hover);
  border-radius: 12px;
  color: var(--text-secondary);
}

.modal-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-scroll::-webkit-scrollbar {
  display: none;
}

.modal-actions-bottom {
  display: flex;
  gap: 10px;
  padding: 14px 24px 16px;
  background: var(--bg-panel-alt);
  flex-shrink: 0;
}

.modal-actions-bottom .btn {
  flex: 1;
  justify-content: center;
  padding: 11px 16px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.1px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--accent-bg);
  color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-bg);
  transform: scale(1.04);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-interested {
  background: var(--pink-bg-light);
  color: var(--pink);
  border: none;
  transition: all var(--transition-base);
}

.btn-interested:hover {
  background: var(--pink-bg);
  transform: scale(1.04);
}

.btn-interested.active {
  background: var(--pink-bg);
  color: var(--pink);
}

/* ===== Message Section ===== */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message-item {
  display: flex;
  gap: 10px;
  animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-author {
  font-size: 13px;
  font-weight: 600;
}

.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 6px;
}

.message-text {
  font-size: 14px;
  color: var(--text-strong);
  line-height: 1.55;
  margin-top: 3px;
  word-break: break-word;
}

.message-reply {
  margin-top: 8px;
  margin-left: 16px;
  padding: 10px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  border-left: 2.5px solid var(--accent);
}

.message-reply .message-author {
  font-size: 12px;
}

.message-reply .message-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.message-input-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.message-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: background var(--transition-base);
  resize: none;
}

.message-input::placeholder {
  color: var(--text-tertiary);
}

.message-input:focus {
  background: var(--bg-input-focus);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}

.toast {
  padding: 11px 22px;
  background: var(--bg-toast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastIn 0.3s ease-out;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { color: #42D9A0; }
.toast.error { color: var(--pink); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== About Modal ===== */
.about-content {
  padding: 32px 24px;
  text-align: center;
}

.about-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.about-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.about-content .about-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), #64D2FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ===== Leaflet Overrides ===== */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: none !important;
  display: none !important;
}

.leaflet-control-attribution {
  font-size: 10px !important;
  opacity: 0.3;
  background: transparent !important;
  color: var(--text-tertiary) !important;
}

.leaflet-control-attribution a {
  color: var(--text-tertiary) !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .modal-panel {
    width: 100vw;
    max-width: 100vw;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
  }

  .modal-overlay.active .modal-panel {
    transform: translateY(0);
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .bottom-controls {
    bottom: 16px;
    right: 10px;
    gap: 6px;
  }

  .zoom-btn, .locate-btn {
    width: 40px;
    height: 40px;
  }

  .signup-banner {
    bottom: 12px;
    left: 10px;
  }

  .signup-btn-text {
    font-size: 12px;
  }

  .signup-btn-sub {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* ===== Messages Panel ===== */
.msg-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.msg-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.msg-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.msg-panel {
  position: relative;
  width: 90vw;
  max-width: 800px;
  height: 75vh;
  max-height: 600px;
  background: var(--bg-panel-alt);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: none;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  display: flex;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.msg-overlay.active .msg-panel {
  transform: scale(1) translateY(0);
}

.msg-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.15);
}

.msg-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}

.msg-sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
}

.msg-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--transition-base);
  z-index: 10;
}

.msg-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

.msg-list-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 0;
}

.msg-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition-base);
  margin-bottom: 2px;
}

.msg-list-item:hover {
  background: var(--bg-hover);
}

.msg-list-item.active {
  background: var(--accent-bg);
}

.msg-list-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.msg-list-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.msg-list-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-list-preview {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.msg-list-time {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.msg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-tertiary);
}

.msg-welcome svg {
  opacity: 0.3;
}

.msg-welcome p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

.msg-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  flex-shrink: 0;
}

.msg-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.msg-chat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.msg-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

.msg-chat-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 0;
}

.msg-bubble-row {
  display: flex;
  justify-content: flex-start;
}

.msg-bubble-me {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 6px;
  background: var(--bg-hover);
}

.msg-bubble-mine {
  background: var(--accent-bg);
  border-radius: 14px 14px 6px 14px;
}

.msg-bubble-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.msg-bubble-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  text-align: right;
}

.msg-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  flex-shrink: 0;
}

.msg-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.msg-chat-input::placeholder {
  color: var(--text-muted);
}

.msg-chat-send {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  white-space: nowrap;
}

.msg-chat-send:hover {
  background: rgba(123,158,245,0.25);
}

@media (max-width: 640px) {
  .msg-panel {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
  }

  .msg-overlay.active .msg-panel {
    transform: translateY(0);
  }

  .msg-overlay {
    align-items: flex-end;
  }

  .msg-sidebar {
    width: 100%;
    border-right: none;
  }

  .msg-panel {
    flex-direction: column;
  }

  .msg-main {
    display: none;
  }

  .msg-main.chat-open {
    display: flex;
  }

  .msg-sidebar.chat-hidden {
    display: none;
  }
}