* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; color:#2b3a2e; }
#app { display: flex; flex-direction: column; height: 100vh; }

/* 调整模式提示条 */
.adjust-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; align-items: center; gap: 14px;
  background: #1f6f43; color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); font-size: 14px; max-width: 92vw;
}
.adjust-banner button {
  background: #fff; color: #1f6f43; border: none; border-radius: 6px;
  padding: 8px 20px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.adjust-banner button:hover { background: #ffe9c2; }

/* 登录区 */
.user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.login-btn {
  background: #1f6f43; color: #fff; border: none; border-radius: 6px;
  padding: 7px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.login-btn:hover { background: #1a5c38; }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2b3a2e; }
.u-name { font-weight: 700; color: #1f6f43; }
.logout-btn {
  background: #fff; color: #c0392b; border: 1px solid #e3b9b5;
  border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.logout-btn:hover { background: #fdeceb; }
.logout-btn.bind { color: #1f6f43; border-color: #b9d6c3; }
.logout-btn.bind:hover { background: #f0f7f1; }

/* 登录弹窗 */
.login-modal {
  position: fixed; inset: 0; background: rgba(20,30,24,.45);
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: 14px; width: 340px; max-width: 92vw;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden;
}
.login-tabs { display: flex; border-bottom: 1px solid #e8efe9; }
.login-tabs .tab {
  flex: 1; padding: 13px 0; border: none; background: #f7faf7; color: #6a7a70;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.login-tabs .tab.active { background: #fff; color: #1f6f43; border-bottom: 3px solid #1f6f43; }
.login-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; }
.login-body label { font-size: 13px; color: #4a5a4e; font-weight: 600; margin-top: 6px; }
.login-body input {
  padding: 10px 12px; border: 1px solid #cfdacf; border-radius: 8px; font-size: 14px; outline: none;
}
.login-body input:focus { border-color: #1f6f43; }
.login-msg { min-height: 18px; font-size: 12px; color: #c0392b; margin: 2px 0; }
.login-submit {
  background: #1f6f43; color: #fff; border: none; border-radius: 8px;
  padding: 11px 0; font-size: 15px; cursor: pointer; font-weight: 700; margin-top: 6px;
}
.login-submit:hover { background: #1a5c38; }
.login-cancel {
  background: #fff; color: #6a7a70; border: 1px solid #d6e0d6; border-radius: 8px;
  padding: 9px 0; font-size: 13px; cursor: pointer; margin-top: 4px;
}
.forgot-link {
  display: inline-block; margin-top: 10px; font-size: 12.5px; color: #1f6f43;
  text-decoration: none; cursor: pointer; text-align: center;
}
.forgot-link:hover { text-decoration: underline; }
.forgot-title { font-size: 15px; font-weight: 700; color: #2b3a2e; text-align: center; margin-bottom: 4px; }
.sms-field { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.send-code-btn {
  flex: 0 0 auto; background: #fff; color: #1f6f43; border: 1px solid #1f6f43;
  border-radius: 8px; padding: 10px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; font-weight: 600;
}
.send-code-btn:hover { background: #f0f7f1; }
.send-code-btn:disabled { color: #9aa8a0; border-color: #cfdacf; background: #f5f7f5; cursor: not-allowed; }

/* 顶部 */
#topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px; background: #ffffff;
  border-bottom: 1px solid #e6ece7;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  z-index: 10; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 30px; }
.brand h1 { font-size: 20px; font-weight: 700; color: #1f6f43; }
.brand .subtitle { font-size: 12px; color: #8a9990; }
.progress-wrap { flex: 1; min-width: 220px; max-width: 420px; }
.progress-text { display: flex; justify-content: space-between; font-size: 13px; color: #4a5c50; margin-bottom: 6px; }
.progress-bar { height: 10px; background: #eef3ef; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#4caf72,#2e8b57); border-radius: 6px; transition: width .4s ease; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4a5c50; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.visited { background: #2e8b57; }
.dot.todo { background: #c8d0ca; }
.ver {
  font-size: 11px; color: #8a9990; background: #f0f3f0; padding: 1px 8px;
  border-radius: 10px; margin-left: 8px; user-select: none;
}

/* 主体 */
#main { position: relative; flex: 1; display: flex; overflow: hidden; }

/* 左侧清单 */
#sidebar {
  width: 260px; background: #fbfcfb; border-right: 1px solid #e6ece7;
  display: flex; flex-direction: column; transition: width .25s ease;
}
#sidebar.collapsed { width: 0; border-right: none; }
#sidebar.collapsed #mountainList { display: none; }
#sidebar.collapsed .sidebar-head { padding: 8px; }
.sidebar-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; font-weight: 600; font-size: 14px; color: #1f6f43;
  border-bottom: 1px solid #e6ece7;
}
#listToggle { border: none; background: transparent; font-size: 16px; color: #1f6f43; cursor: pointer; }
.add-btn {
  border: 1px solid #1f6f43; background: #eef6ef; color: #1f6f43; font-size: 12px;
  border-radius: 14px; padding: 2px 9px; cursor: pointer; margin-left: auto; margin-right: 6px;
}
.add-btn:hover { background: #d9ecdc; }
#mountainList li .mname em.cust {
  font-style: normal; font-size: 10.5px; color: #6d3fa0; background: #f1e9fa;
  border: 1px solid #d8c6ef; border-radius: 8px; padding: 0 6px; margin-left: 5px; vertical-align: 1px;
}
.add-pick-tip { font-size: 13px; color: #1f6f43; background: #f0f7f1; padding: 8px 10px; border-radius: 8px; margin: 4px 0 8px; }
#mountainList { list-style: none; overflow-y: auto; flex: 1; }
#mountainList li {
  padding: 9px 14px; border-bottom: 1px solid #f0f3f0; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; transition: background .15s;
}
#mountainList li:hover { background: #f0f6f1; }
#mountainList li .check {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c8d0ca; flex: none;
}
#mountainList li.checked .check { background: #2e8b57; border-color: #2e8b57; }
#mountainList li .mname { flex: 1; }
#mountainList li .mel { color: #a0aca4; font-size: 12px; }
#mountainList li .district-tag { font-size: 11px; color: #7a8a80; background: #eef3ef; padding: 1px 6px; border-radius: 8px; }

/* 地图 */
#mapContainer { flex: 1; position: relative; }
#mapLoading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.95); border-radius: 10px; padding: 14px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12); font-size: 14px; color: #4a5c50; z-index: 15;
}
#mapLoading.hidden { display: none; }
.spinner {
  width: 18px; height: 18px; border: 3px solid #cfe3d6; border-top-color: #2e8b57;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#akHint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #fff8f0; border: 1px solid #f0c36d; border-radius: 10px;
  padding: 24px 30px; max-width: 420px; text-align: center; z-index: 20; box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
#akHint code { background: #fdf0dc; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
#akHint.hidden, .hidden { display: none !important; }

/* 详情卡片 */
#detailPanel {
  position: absolute; top: 16px; right: 16px; width: 340px; max-height: calc(100% - 32px);
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 30; overflow-y: auto;
}
#detailPanel.hidden { display: none; }
#detailPanel.collapsed #detailBody { display: none; }
#detailPanel.collapsed .detail-fold { border-bottom: none; }
.detail-fold {
  display: none; align-items: center; justify-content: space-between;
  padding: 10px 44px 10px 16px; cursor: pointer; font-weight: 700;
  color: #1f6f43; background: #f4faf6; border-bottom: 1px solid #e6efe8;
  border-radius: 12px 12px 0 0; font-size: 15px; user-select: none;
}
.detail-fold .fold-arrow { font-size: 13px; color: #6a7a70; }
.close-btn { position: absolute; top: 10px; right: 10px; border: none; background: #f0f3f0; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color:#556; z-index: 5; }
.detail-head { padding: 18px 18px 12px; background: linear-gradient(135deg,#2e8b57,#1f6f43); color: #fff; border-radius: 12px 12px 0 0; }
.detail-head h2 { font-size: 20px; }
.detail-head .meta { font-size: 12.5px; opacity: .9; margin-top: 6px; display:flex; gap:10px; flex-wrap:wrap; }
.detail-head .tag { background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 10px; font-size: 11.5px; }
.detail-body { padding: 14px 18px 18px; }
.detail-body .desc { font-size: 13.5px; line-height: 1.6; color: #4a5c50; margin-bottom: 14px; }
.btn { border: none; border-radius: 8px; padding: 10px 14px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn-primary { background: #2e8b57; color: #fff; width: 100%; }
.btn-primary:hover { background: #267a4b; }
.btn-primary.done { background: #f0f3f0; color: #1f6f43; }
.btn-coords {
  background: #fff; color: #d9480f; border: 1.5px solid #f0b429;
  width: 100%; margin-top: 8px;
}
.btn-coords:hover { background: #fff7ed; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #e0c0bb; width: 100%; margin-top: 8px; }
.media-list { margin-top: 14px; }
.media-list h4 { font-size: 13px; color: #6a7a70; margin-bottom: 8px; }
.media-grid { display: block; }
.media-empty { color: #a0aca4; font-size: 12.5px; padding: 4px 0; }
.visit-group { border: 1px solid #e3eae5; border-radius: 10px; padding: 10px; margin-top: 12px; background: #fcfdfc; }
.visit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.visit-label { font-size: 13px; color: #2e8b57; font-weight: 700; }
.visit-count { font-size: 11.5px; color: #8a9a90; }
.visit-del { margin-left: auto; font-size: 11.5px; color: #b0574f; background: none; border: 1px solid #ecd0cb; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.visit-del:hover { background: #fdeceb; color: #b03a30; }
.visit-add { margin-top: 14px; }
.visit-add-row { display: flex; align-items: center; gap: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.btn-add { background: #fff; border: 1.5px dashed #2e8b57; color: #2e8b57; }
.btn-add:hover { background: #eef7f0; }
.btn-share { background: #fff; border: 1.5px solid #1f6f43; color: #1f6f43; }
.btn-share:hover { background: #f0f7f1; }
.btn-danger { background: #fff; border: 1.5px solid #c0392b; color: #c0392b; }
.btn-danger:hover { background: #fdf0ef; }
.visits-empty { color: #a0aca4; font-size: 13px; margin-top: 12px; line-height: 1.6; }
.media-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.media-row video, .media-row img { width: 100%; border-radius: 8px; display: block; max-height: 160px; object-fit: cover; }
.media-row audio { width: 100%; }
.media-cell { position: relative; margin: 0; }
.media-thumb { position: relative; }
.media-cell video, .media-cell img { width: 100%; border-radius: 8px; display: block; max-height: 160px; object-fit: cover; }
.media-cell audio { width: 100%; }
.media-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; z-index: 3; }
.media-del:hover { background: #c0392b; }
.share-card { max-width: 430px; }
.share-body { padding: 14px 18px 18px; }
.share-tip { font-size: 13px; color: #5b6b60; line-height: 1.6; margin-bottom: 12px; }
.share-link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.share-url { flex: 1; padding: 9px 10px; border: 1px solid #cfe0d5; border-radius: 8px; font-size: 12.5px; color: #3b4a40; background: #f4f9f5; }
.share-url:focus { outline: none; border-color: #2e8b57; }
.share-cardbox { margin-top: 12px; }
.share-preview { background: #eef3ef; border-radius: 10px; padding: 8px; margin-bottom: 10px; }
.share-actions { display: flex; flex-direction: column; gap: 8px; }
.share-actions .login-submit, .share-actions .login-cancel { width: 100%; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 10000; display: flex; align-items: center; justify-content: center; }
.lightbox .lb-body { display: flex; align-items: center; justify-content: center; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.lb-close { position: absolute; top: 14px; right: 22px; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; z-index: 2; }
.lb-close:hover { color: #ff6b6b; }
.upload-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.upload-date-label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #5b6b60; padding: 6px 9px; border: 1.5px solid #d5dfd8; border-radius: 8px; background: #fafcfa; }
.upload-date-label input[type="date"] { border: none; background: transparent; font-size: 13px; color: #3b4a40; outline: none; }
.upload-btn { flex: 1; min-width: 110px; text-align: center; padding: 9px; border: 1.5px dashed #b9c6bd; border-radius: 8px; font-size: 13px; color: #5b6b60; cursor: pointer; background: #fafcfa; }
.upload-btn:hover { border-color: #2e8b57; color: #2e8b57; }
.upload-btn input { display: none; }
.checkin-note { width: 100%; margin-top: 10px; padding: 8px 10px; border: 1px solid #d5ded7; border-radius: 8px; font-size: 13px; resize: vertical; }
.checkin-note:focus { outline: none; border-color: #2e8b57; }
.status-line { display:flex; align-items:center; gap:6px; font-size:12.5px; color:#7a8a80; margin-top:6px; }
.status-line .done-mark { color:#2e8b57; font-weight:700; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2b3a2e; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }

/* 地图标记 */
.m-marker { position: relative; cursor: pointer; width: 8px; height: 8px; }
.m-pin {
  position: absolute; left: 0; top: 0; width: 16px; height: 16px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #c8d0ca; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.m-marker.checked .m-pin { background: #2e8b57; }
.m-marker.custom .m-pin { background: #7d4bb0; }
.m-marker.custom .m-label { color: #5a2f8a; border-color: #d0b8ec; }
.m-marker.selected .m-pin {
  background: #e8590c; border-color: #fff; width: 20px; height: 20px;
  box-shadow: 0 0 0 4px rgba(232,89,12,.25), 0 2px 6px rgba(0,0,0,.35);
  animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(232,89,12,.5); }
  70% { box-shadow: 0 0 0 16px rgba(232,89,12,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,89,12,0); }
}
.m-label {
  position: absolute; left: 20px; top: 0; white-space: nowrap;
  font-size: 12px; color: #2b3a2e; background: rgba(255,255,255,.92);
  padding: 2px 7px; border-radius: 6px; border: 1px solid #e0e6e1;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); line-height: 1.4;
}
.m-marker.checked .m-label { color: #1f6f43; font-weight: 600; border-color: #9dcdb2; }
.m-marker.selected .m-label { color: #d9480f; font-weight: 700; border-color: #f0b429; background: #fff7ed; }

/* 侧边栏选中项 */
#mountainList li.selected { background: #e7f4ea; }
#mountainList li.selected .check { border-color: #e8590c; }
#mountainList li.selected .mname { color: #d9480f; font-weight: 700; }

/* ===== 移动端适配：侧栏抽屉化 + 浮动开关 ===== */
#mobileMenuBtn {
  display: none; position: fixed; left: 10px; top: 10px; z-index: 999;
  background: #fff; border: 1px solid #d3ded5; border-radius: 24px;
  padding: 8px 14px; font-size: 13px; color: #1f6f43; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); font-weight: 600;
}
#mobileMenuBtn.show { display: block; }
@media (max-width: 768px) {
  #topbar { gap: 12px; padding: 10px 12px; }
  .brand .logo { font-size: 24px; }
  .brand h1 { font-size: 17px; }
  .brand .subtitle { display: none; }
  .progress-wrap { min-width: 0; flex: 1 1 auto; max-width: none; }
  .progress-text { font-size: 12px; }

  /* 侧栏变成左侧抽屉，折叠时滑出屏幕 */
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 95;
    width: 82vw; max-width: 320px; background: #fbfcfb;
    box-shadow: 2px 0 22px rgba(0,0,0,.25);
    transform: translateX(0); transition: transform .25s ease;
  }
  #sidebar.collapsed {
    width: 82vw; max-width: 320px; border-right: none;
    transform: translateX(-100%); box-shadow: none;
  }
  #sidebar.collapsed #mountainList { display: block; }
  #sidebar.collapsed .sidebar-head { padding: 12px 14px; }

  /* 抽屉打开时地图轻微变暗 */
  #mapContainer.dim::after {
    content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.15); z-index: 85; pointer-events: none;
  }

  /* 地图上的浮动“山峰”按钮：抽屉收起时显示，用于重新打开（基础样式在 media 外，.show 控制显隐） */

  /* 详情卡片变底部抽屉，方便看完地图再选下一座山 */
  #detailPanel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 74vh; }
  .detail-head h2 { font-size: 18px; }
  .detail-fold { display: flex; }
}
