* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #0A2540;
  color: #E6EDF3;
  overflow: hidden;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #081A2C;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar .back {
  color: #2FD4DA;
  text-decoration: none;
  font-size: 14px;
}
.topbar .brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.topbar .sub { color: #A8B8C8; font-size: 13px; }
.topbar-upload {
  margin-left: auto;
  background: #2FD4DA;
  color: #042E2B;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.topbar-upload:hover { background: #3FE0E6; }

/* 头像按钮 */
.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #123A5F;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.ocean-layout {
  position: relative;
  height: calc(100vh - 56px);
}
#map { position: absolute; inset: 0; min-width: 0; min-height: 0; }

/* Leaflet 深色适配 */
.leaflet-container { background: #0A2540; }
.leaflet-control-zoom { border: 1px solid rgba(255,255,255,0.15) !important; box-shadow: none !important; }
.leaflet-control-zoom a { width: 26px !important; height: 26px !important; line-height: 26px !important; background: #0E2540 !important; color: #A8C8E8 !important; border-color: rgba(255,255,255,0.1) !important; }

.ocean-detail {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 360px;
  max-height: calc(100% - 32px);
  background: rgba(14, 37, 64, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.ocean-detail.hidden { display: none; }

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 24px;
  line-height: 1;
  color: #A8B8C8;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1;
}
.detail-close:hover { color: #2FD4DA; }

.detail-empty {
  text-align: center;
  color: #A8B8C8;
  margin-top: 40%;
}
.detail-empty .empty-icon { font-size: 40px; margin-bottom: 12px; }
.detail-empty .empty-sub { font-size: 12px; margin-top: 8px; color: #6B7A8C; }

/* 海域详情卡片 */
.ocean-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.ocean-card .ocean-type {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.ocean-type.jinshai { background: #2FD4DA; color: #042E2B; }
.ocean-type.yuanhai { background: #5AA0E8; color: #04233B; }
.ocean-type.shenhai { background: #123A5F; color: #A8C8E8; border: 1px solid #2A4A6C; }
.ocean-type.jidi { background: #7FA8D0; color: #04233B; }
.ocean-type.jinshi { background: #2FD4DA; color: #042E2B; }

.ocean-card .ocean-desc { color: #C8D4E0; font-size: 14px; line-height: 1.7; margin: 8px 0 20px; }

.ocean-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  background-size: cover;
  background-position: center;
}

/* 多图：切换式（叠放 + 圆点切换） */
.ocean-photos { position: relative; margin-bottom: 20px; }
.ocean-slide {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}
.ocean-slide.active { display: block; }
.photo-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.photo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background .2s;
}
.photo-dot.active { background: #2FD4DA; }
.ocean-photo.ph-jinshai { background: linear-gradient(135deg, #2FD4DA, #155C94); }
.ocean-photo.ph-yuanhai { background: linear-gradient(135deg, #5AA0E8, #123A5F); }
.ocean-photo.ph-shenhai { background: linear-gradient(135deg, #123A5F, #061224); }
.ocean-photo.ph-jidi { background: linear-gradient(135deg, #7FA8D0, #123A5F); }

.photo-credit {
  font-size: 11px;
  color: #6B7A8C;
  margin: -14px 0 14px;
  text-align: right;
  word-break: break-all;
}

.ocean-card h3 {
  font-size: 13px;
  color: #A8B8C8;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feed-item { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.feed-item:last-child { border-bottom: none; }
.feed-item a { color: #E6EDF3; text-decoration: none; font-size: 14px; line-height: 1.5; display: block; }
.feed-item a:hover { color: #2FD4DA; }
.feed-item .feed-meta { font-size: 12px; color: #6B7A8C; margin-top: 3px; }
.feed-none { color: #6B7A8C; font-size: 13px; padding: 8px 0; }

/* 地图锚点 */
.pin-wrap { display: block; width: 16px; height: 16px; position: relative; }

/* 海域名标签（自绘，配合干净底图） */
.sea-label {
  display: inline-block;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: #2A6FA0;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  pointer-events: none;
}
.pin-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform .15s;
}
.pin-wrap:hover .pin-dot { transform: scale(1.4); }

/* 照片可点击看大图 */
.ocean-photo { cursor: zoom-in; position: relative; }
.ocean-photo::after {
  content: "🔍 点击看大图";
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 9px;
  border-radius: 10px;
  pointer-events: none;
}

/* Lightbox 大图 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 20, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 40px;
  color: #E6EDF3;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { color: #2FD4DA; }
.lightbox-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #A8B8C8;
}

/* 网友照片墙 */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: #123A5F;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-cell-nick {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 12px 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 上传表单 */
.upload-box {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-input {
  background: #081A2C;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 9px 12px;
  color: #E6EDF3;
  font-size: 13px;
  outline: none;
}
.upload-input::placeholder { color: #6B7A8C; }
.upload-input:focus { border-color: #2FD4DA; }
.upload-btn {
  background: #2FD4DA;
  color: #042E2B;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.upload-btn:hover { background: #3FE0E6; }
.upload-btn:disabled { opacity: 0.6; cursor: default; }

/* 作品 pin（亮金色+发光，区分种子点青蓝和城市红点） */
.post-dot {
  background: #FFC53D;
  box-shadow: 0 0 12px rgba(255, 197, 61, 0.95), 0 0 3px rgba(0, 0, 0, 0.6);
}

/* 上传弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 20, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}
.modal.open { display: flex; }
.modal-box {
  width: 460px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #0E2540;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-box h2 { font-size: 20px; font-weight: 700; }
.modal-tip { font-size: 12px; color: #A8B8C8; line-height: 1.6; }
.submit-notice {
  font-size: 12px;
  color: #C9D6E3;
  line-height: 1.7;
  background: rgba(255, 200, 90, 0.08);
  border-left: 3px solid #FFC85A;
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 4px;
}
.modal-file { color: #A8B8C8; font-size: 13px; }
.modal-input {
  background: #081A2C;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px 12px;
  color: #E6EDF3;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.modal-input::placeholder { color: #6B7A8C; }
.modal-input:focus { border-color: #2FD4DA; }
.post-map { height: 200px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); }

/* 省市区三级联动 */
.region-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.region-select {
  width: 100%;
  appearance: none;
  cursor: pointer;
}
.modal-actions { display: flex; gap: 10px; }
.modal-submit {
  flex: 1;
  background: #2FD4DA;
  color: #042E2B;
  border: none;
  border-radius: 6px;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.modal-submit:disabled { opacity: 0.6; }
.modal-cancel {
  padding: 11px 18px;
  background: transparent;
  color: #A8B8C8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* 作品详情 */
.post-addr { color: #2FD4DA; font-size: 13px; margin: -6px 0 8px; }

/* 评论 */
.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.comment-item:last-child { border-bottom: none; }
.comment-nick { font-size: 13px; font-weight: 600; color: #2FD4DA; margin-bottom: 3px; }
.comment-text { font-size: 14px; line-height: 1.6; color: #E6EDF3; }
.comment-img {
  margin-top: 8px;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}
.comment-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.comment-actions { display: flex; gap: 8px; align-items: center; }
.c-img-btn {
  background: transparent;
  color: #2FD4DA;
  border: 1px solid rgba(47, 212, 218, 0.4);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.comment-actions .upload-btn { flex: 1; }

/* ============ 手机端适配（<720px） ============ */
@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .brand { font-size: 15px; }
  .topbar .sub { display: none; }
  .topbar-upload { padding: 7px 12px; font-size: 13px; }
  .brand-logo { gap: 8px; }
  .brand-logo .logo-mark { width: 32px; height: 26px; }
  .brand-logo .logo-text { font-size: 18px; }

  /* 悬浮卡片 → 底部抽屉（bottom sheet），从下往上滑出 */
  .ocean-layout { overflow: hidden; }
  .ocean-detail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 55vh;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(100%);
  }
  .ocean-detail.hidden { display: block; transform: translateY(100%); }
  .ocean-detail:not(.hidden) { transform: translateY(0); }

  /* 上传弹窗适配小屏 */
  .modal-box { padding: 18px; }
  .post-map { height: 150px; }
}
