* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
  color: #333;
}

.hidden {
  display: none !important;
}

/* 加载状态 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #1989fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  margin-top: 16px;
  color: #666;
}

/* 页面容器 */
.page {
  min-height: 100vh;
}

/* 错误/成功页面 */
#error-page, #success-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ff4d4f;
  color: #fff;
  font-size: 48px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #52c41a;
  color: #fff;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

#error-page h2, #success-page h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

#error-page p, #success-page p {
  color: #666;
  font-size: 14px;
}

.address-text {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f0f9eb;
  border-radius: 8px;
  color: #67c23a;
}

/* 主页面头部 */
.header {
  background: linear-gradient(135deg, #1989fa, #0066cc);
  color: #fff;
  padding: 20px;
  text-align: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 500;
}

.subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

/* 地图容器 */
#map-container {
  position: relative;
  height: 280px;
  background: #e0e0e0;
}

#map {
  width: 100%;
  height: 100%;
}

.relocate-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1989fa;
}

.relocate-btn:active {
  background: #f5f5f5;
}

/* 位置信息 */
.location-info {
  background: #fff;
  padding: 16px;
  margin: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.info-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.info-value {
  font-size: 16px;
  color: #333;
  line-height: 1.5;
}

.coordinates {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 照片上传 */
.photo-section {
  background: #fff;
  padding: 16px;
  margin: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.section-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-add {
  width: 80px;
  height: 80px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fafafa;
}

.photo-add:active {
  background: #f0f0f0;
}

.photo-add .plus {
  font-size: 28px;
  color: #999;
  line-height: 1;
}

.photo-add .text {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.photo-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

/* 提交按钮 */
.submit-section {
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1989fa, #0066cc);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.submit-btn:not(:disabled):active {
  opacity: 0.9;
}
