/* ==================== 全局重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
}

a {
  text-decoration: none;
  color: #4a90d9;
}
a:hover { color: #357abd; }

/* ==================== Toast 提示 ==================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -20px);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==================== 登录注册页 ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}
.logo-text {
  font-size: 36px;
  font-weight: 700;
  color: #667eea;
  letter-spacing: 4px;
}
.logo-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: #999;
}

.auth-form .form-group {
  margin-bottom: 16px;
}
.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
}
.auth-form input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #999;
}

.hidden { display: none !important; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}
.btn-secondary {
  background: #f0f0f0;
  color: #333;
}
.btn-danger {
  background: #ff4757;
  color: #fff;
}
.btn-block { width: 100%; }
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

/* ==================== 首页布局 ==================== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #f0f0f0;
}
.header-brand {
  display: flex;
  flex-direction: column;
}
.header-brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}
.header-brand .brand-subtitle {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.header-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.header-user:hover { background: #f5f5f5; }
.header-user .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.header-user .user-name {
  font-size: 13px;
  color: #666;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 地图区域 */
#mapContainer {
  width: 100%;
  height: 65vh;
  min-height: 336px;
  background: #e8eaed;
}

/* 地图DOM标记（参照indexbackup原版） */
.marker-item {
  pointer-events: auto;
}
.marker-item:hover {
  z-index: 20 !important;
}

/* 未打卡点位标记脉冲发光动画 */
@keyframes marker-pulse-anim {
  0% { box-shadow: 0 0 0 0 rgba(255, 103, 0, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(255, 103, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 103, 0, 0); }
}
.marker-pulse {
  animation: marker-pulse-anim 2s infinite;
}

/* 隐藏腾讯地图默认控件（指南针、缩放按钮等） */
#mapContainer .tmap-control,
#mapContainer [class*="control"],
#mapContainer .tmap-zoom-control,
#mapContainer .tmap-rotation,
#mapContainer .compass-container {
  display: none !important;
}


/* 定位按钮（右下角浮层） - 已移除 */

/* 点位列表 */
.points-list {
  padding: 0 16px;
  padding-bottom: 80px;
}
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 6px;
}
.list-title {
  font-size: 12px;
  font-weight: normal;
  color: #666;
}
.add-point-btn {
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #667eea;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.add-point-btn:hover { opacity: 0.85; }
.locate-link {
  font-size: 12px;
  color: #667eea;
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}
.locate-link:hover { text-decoration: underline; }
.point-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.point-card {
  display: flex;
  flex-direction: column;
  width: calc(33.333% - 6px);
  padding: 8px;
  background: #fafafa;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.point-card:hover { background: #f0f0f0; }
.point-card-img {
  width: 100%;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: #e0e0e0;
  margin-bottom: 4px;
}
.point-card-info {
  min-width: 0;
}
.point-card-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 1px;
}
.point-card-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.point-card-address {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 98;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-item.active { color: #667eea; }
.nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

/* ==================== 点位详情页 ==================== */
.detail-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #333;
  font-size: 15px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
}
.detail-cover {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}
.detail-body {
  padding: 16px;
}
.detail-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.detail-desc {
  color: #666;
  line-height: 1.6;
  font-size: 14px;
  margin-bottom: 8px;
}
.detail-address {
  color: #999;
  font-size: 13px;
}

.message-list {
  padding: 0 16px;
  padding-bottom: 100px;
}
.message-item {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}
.message-item:last-child { border-bottom: none; }
.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.msg-meta {
  flex: 1;
}
.msg-nickname {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.msg-time {
  font-size: 11px;
  color: #bbb;
}
.msg-content {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.msg-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.msg-image {
  width: calc((100% - 16px) / 3);
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}
.msg-image:hover { transform: scale(1.03); }
.msg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* 发布按钮固定底部 */
.pub-btn-fixed {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 101;
}

/* ==================== 新用户位置设置弹窗 ==================== */
#locationSetupModal {
  z-index: 3000;
}
.loc-setup-box {
  width: 92%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  animation: slideUp 0.35s ease;
}
.loc-setup-box h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.loc-setup-hint {
  font-size: 13px;
  color: #999;
  text-align: center;
  margin-bottom: 20px;
}
#locSearchResults {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
}
#locSearchResults::-webkit-scrollbar { width: 4px; }
#locSearchResults::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

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

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.show .modal-box {
  transform: translateY(0);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

/* 点位详情弹窗（参照indexbackup） */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  width: 92%;
  max-width: 400px;
  max-height: 85vh;
  background: #fff;
  border-radius: 16px;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s;
}
.modal.active .modal-content {
  transform: scale(1);
}
.detail-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
}
.detail-body {
  padding: 20px;
}
.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}
.detail-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* 打卡表单区域 */
.upload-section { margin-bottom: 16px; }
.upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.upload-add {
  width: 80px;
  height: 80px;
  border: 2px dashed #ccc;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fafafa;
  position: relative;
  transition: border-color 0.2s;
}
.upload-add:hover { border-color: #667eea; }
.upload-add svg {
  width: 24px; height: 24px;
  stroke: #999;
  margin-bottom: 4px;
}
.upload-label { font-size: 11px; color: #999; }
#uploadCount {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 1px 5px;
  border-radius: 8px;
}
.upload-item {
  width: 80px; height: 80px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-btn {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-section { margin-bottom: 16px; }
.note-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  outline: none;
  line-height: 1.5;
  font-family: inherit;
}
.note-input:focus { border-color: #667eea; }
.char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

/* 消息列表（多条动态） */
.msg-item {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.msg-item .msg-actions button:hover { opacity: 0.7; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}
.form-control:focus { border-color: #667eea; }
textarea.form-control {
  height: auto;
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
}

/* 图片上传区域 */
.upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}
.upload-area:hover { border-color: #667eea; }
.upload-area p { color: #999; font-size: 13px; }
.upload-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.upload-preview img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  position: relative;
}
.preview-item {
  position: relative;
}
.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4757;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  line-height: 1;
}

/* ==================== 个人中心页 ==================== */
.profile-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5f5f5;
}
.profile-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 20px 30px;
  color: #fff;
  text-align: center;
}
.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.profile-name {
  font-size: 19px;
  font-weight: 700;
}
.profile-phone {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}
.profile-role {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
}

.section {
  background: #fff;
  margin: 12px 16px;
  border-radius: 12px;
  padding: 16px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid #667eea;
}

/* Lightbox 图片放大 */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.lightbox-overlay.show {
  opacity: 1;
  visibility: visible;
}
.lightbox-overlay img {
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #ccc;
}
.empty-state p {
  font-size: 14px;
}

/* 响应式适配 */
@media (max-width: 480px) {
  .app-container,
  .detail-page,
  .profile-page {
    max-width: 100%;
  }
}

/* ====== 底部备案信息 ====== */
.site-footer {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 12px;
  color: rgba(0,0,0,0.35);
  background: #fff;
}
.site-footer a.footer-link {
  color: rgba(0,0,0,0.4);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a.footer-link:hover {
  color: #667eea;
}
.site-footer .footer-sep {
  margin: 0 8px;
  opacity: 0.3;
}

/* ====== 联系我们弹窗 ====== */
#contactModal.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#contactModal.modal-overlay.active { display: flex; }
.contact-modal {
  max-width: 320px;
  padding: 28px 24px;
  border-radius: 16px;
  text-align: center;
  animation: slideUp 0.3s ease;
  position: relative;
}
.modal-close-btn {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  font-size: 24px; color: #999;
  cursor: pointer; line-height: 1;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
