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

:root {
  --primary: #4a9eff;
  --primary-light: #e8f4ff;
  --primary-dark: #2b7cd6;
  --bg: #f0f7ff;
  --text: #333;
  --text-light: #888;
  --white: #fff;
  --shadow: 0 4px 20px rgba(74, 158, 255, 0.15);
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ========== 欢迎页 ========== */
#welcome-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 15%;
}

.welcome-bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 5s ease;
  z-index: 0;
}

.welcome-bg-layer.active {
  opacity: 1;
}

#welcome-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 60, 0.45);
  z-index: 1;
}

.welcome-content {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: fadeInUp 1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.welcome-title {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  letter-spacing: 4px;
  margin: 0;
}

.welcome-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 2px;
  margin: 0;
}

.btn-entry {
  padding: 12px 36px;
  background: rgba(255,255,255,0.95);
  color: #2b7cd6;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s;
  letter-spacing: 2px;
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.btn-entry:hover {
  background: #fff;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

.welcome-fadeout {
  animation: fadeOut 0.6s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* ========== 主页面 ========== */
.main-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 顶部导航 */
.toolbar {
  position: fixed;
  top: 6px;
  left: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.tab-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.4);
}

/* 地图 */
#map {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* 信息面板 */
.panel {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: calc(100% - 40px);
  max-width: 480px;
  max-height: 55vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
}

.panel.show {
  display: block;
  animation: slideUp 0.3s ease;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--primary);
}

.panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
}

.panel-content {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(55vh - 60px);
}

.marker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marker-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.marker-card:hover {
  background: #dceeff;
  transform: translateX(4px);
}

.marker-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.marker-info {
  flex: 1;
  min-width: 0;
}

.marker-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.marker-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.marker-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.marker-author {
  font-size: 11px;
  color: var(--primary);
  background: white;
  padding: 2px 8px;
  border-radius: 20px;
}

.marker-fav {
  font-size: 11px;
  color: var(--text-light);
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-content h3 {
  margin-bottom: 20px;
  font-size: 20px;
  color: var(--primary);
  text-align: center;
}

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="number"],
.modal-content textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8f0fe;
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 12px;
  transition: border-color 0.3s;
  background: var(--primary-light);
}

.modal-content input:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-content label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-btns .btn {
  flex: 1;
}

.btn-cancel {
  background: #f0f0f0;
  color: var(--text);
}

.btn-cancel:hover {
  background: #e0e0e0;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed #c0d8f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area.dragover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.upload-placeholder {
  color: var(--text-light);
  font-size: 14px;
}

.upload-placeholder small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.upload-preview {
  margin-bottom: 12px;
}

.upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(74, 158, 255, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  z-index: 5000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* VR弹窗 */
.vr-modal {
  max-width: 800px;
}

#pannellum-div {
  width: 100%;
  height: 450px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.vr-info {
  margin-top: 16px;
  padding: 16px;
  background: var(--primary-light);
  border-radius: 12px;
}

.vr-info h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--text);
}

.vr-info p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 8px;
}

.vr-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.vr-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.vr-actions .btn {
  flex: 1;
}

.fav-btn {
  background: #fff0f7;
  color: #c0398a;
  border: 2px solid #c0398a;
  font-weight: 600;
}

.fav-btn.active {
  background: #c0398a;
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* 坐标输入 */
.coord-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.coord-inputs input {
  flex: 1;
}

.tip {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* 我的页面列表 */
.mine-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-btn {
  background: #fff0f0;
  color: #e74c3c;
  border: 1px solid #ffd0d0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s;
  color: #888;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* ========== 论坛 ========== */
.forum-container {
  max-width: 600px;
  margin: 0 auto;
}

.forum-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.forum-textarea {
  width: 100%;
  border: 2px solid #e8f0fe;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  transition: border-color 0.3s;
}

.forum-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.forum-upload-area {
  border: 2px dashed #c0d8f0;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.forum-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.forum-upload-preview {
  margin-bottom: 10px;
}

.forum-upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.forum-img-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 24px;
}

.forum-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forum-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(74,158,255,0.08);
}

.forum-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.forum-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.forum-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.forum-time {
  font-size: 11px;
  color: var(--text-light);
}

.forum-img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin: 8px 0;
  cursor: pointer;
}

.forum-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin: 8px 0;
}

.forum-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.forum-action-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.forum-action-btn:hover {
  background: var(--primary-light);
}

/* ========== 个人中心 ========== */
.profile-container {
  max-width: 600px;
  margin: 0 auto;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--primary);
  border-radius: 50px;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-tab.active {
  background: var(--primary);
  color: white;
}

.profile-markers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-marker-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.profile-marker-card:hover {
  background: var(--primary-light);
  transform: translateX(4px);
}

.profile-marker-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-marker-info {
  flex: 1;
}

.profile-marker-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-marker-meta {
  font-size: 12px;
  color: var(--text-light);
}
/* ========== 自定义地图标记 ========== */
.custom-marker-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 4px 8px 4px 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s;
}
.custom-marker-wrap:hover {
  transform: scale(1.05);
}
.custom-marker-thumb {
  flex-shrink: 0;
}
.custom-marker-thumb img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.custom-marker-info {
  max-width: 120px;
}
.custom-marker-title {
  font-weight: 600;
  color: #333;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fix: map-search-bar should be below toolbar */
#map-search-bar {
  top: 60px !important;
}

/* ========== 上传进度条 ========== */
.upload-progress-wrap {
  width: 100%;
  padding: 20px;
  text-align: center;
}
.upload-progress-bar {
  width: 0%;
  height: 8px;
  background: #4a9eff;
  border-radius: 4px;
  transition: width 0.3s;
}
.upload-progress-text {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
}
