/* style.css */
:root {
  --primary-color: #007aff;
  --panel-background: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #f0f0f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.map-placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.map-placeholder h3 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 18px;
}

.map-placeholder p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.location-tip {
  color: var(--primary-color) !important;
  font-size: 12px !important;
  font-style: italic;
  margin-top: 10px !important;
}

/* 悬浮图钉 */
.floating-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.pin-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  animation: pin-bounce 0.3s ease-out;
}

@keyframes pin-bounce {
  0% {
    transform: translateY(-10px) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: translateY(5px) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.location-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.2s;
}

.location-btn:hover {
  background-color: #0056cc;
}

.location-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.map-info {
  text-align: center;
  background: var(--panel-background);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin: 20px;
  max-width: 400px;
}

.map-info h3 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 20px;
}

.map-info p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.search-container {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  z-index: 2000;
  display: flex;
  background: var(--panel-background);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 5px;
}

#search-input {
  flex-grow: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 10px;
  background: transparent;
  cursor: text;
}

#search-btn {
  border: none;
  background-color: var(--primary-color);
  color: white;
  padding: 0 15px;
  border-radius: 5px;
  font-size: 15px;
  cursor: pointer;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel-background);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  z-index: 2001;
}

.result-item {
  padding: 12px 15px;
  border-top: 1px solid var(--border-color);
  cursor: pointer;
}

.result-item:hover {
  background-color: #f9f9f9;
}

.result-item .place-name {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
}

.result-item .place-address {
  font-size: 14px;
  color: var(--text-secondary);
}

.info-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel-background);
  padding: 15px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.info-panel.show {
  transform: translateY(0);
}

.location-info .place-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.location-info .place-address {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.confirm-btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.confirm-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* AI Panel */
.ai-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel-background);
  z-index: 2000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.ai-panel.show {
  transform: translateY(0);
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.ai-header h3 {
  font-size: 18px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-header button {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--primary-color);
  cursor: pointer;
}

.ai-content {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
  line-height: 0;
  font-size: 16px;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Markdown 样式 */
.ai-content h1,
.ai-content h2,
.ai-content h3,
.ai-content h4,
.ai-content h5,
.ai-content h6 {
  color: var(--text-primary);
  margin: 20px 0 10px 0;
  font-weight: 600;
  line-height: 1.4;
}

.ai-content h1 {
  font-size: 24px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.ai-content h2 {
  font-size: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.ai-content h3 {
  font-size: 18px;
}

.ai-content h4 {
  font-size: 16px;
}

.ai-content p {
  margin: 12px 0;
  line-height: 1.5;
}

.ai-content ul,
.ai-content ol {
  margin: 12px 0;
  padding-left: 20px;
}

.ai-content li {
  margin: 6px 0;
  line-height: 1.5;
}

.ai-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--primary-color);
  background-color: #f8f9fa;
  border-radius: 4px;
  font-style: italic;
}

.ai-content code {
  background-color: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
}

.ai-content pre {
  background-color: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 16px 0;
}

.ai-content pre code {
  background: none;
  padding: 0;
}

.ai-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.ai-content em {
  font-style: italic;
}

.ai-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.ai-content a:hover {
  text-decoration: underline;
}

.ai-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 20px 0;
}

.error-message {
  color: #dc3545;
  text-align: center;
  font-style: italic;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 50px auto;
}

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

.locate-btn {
  position: absolute;
  right: 20px;
  bottom: 100px;
  z-index: 1200;
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--primary-color);
  cursor: pointer;
  border: 1px solid #eee;
  transition: box-shadow 0.2s;
}
.locate-btn:active {
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  background: #f0f8ff;
} 