/* ===== CSS Variables ===== */
:root {
  /* 背景 — 深邃温暖的近黑，配素雅纸感地球 */
  --bg-deep: #0c0d13;
  --bg-card: rgba(248, 244, 236, 0.05);
  --bg-card-solid: #15161e;
  --bg-elevated: #1c1d27;
  --glass: rgba(248, 244, 236, 0.06);
  --glass-border: rgba(248, 244, 236, 0.12);
  --glass-border-strong: rgba(248, 244, 236, 0.2);
  /* 单一克制的沙铜色点缀，少量使用 */
  --accent: #c9a86a;
  --accent-light: #e4d2a6;
  --accent-glow: rgba(201, 168, 106, 0.18);
  --accent-soft: rgba(201, 168, 106, 0.14);
  /* 暖象牙文字 */
  --text: #f2eee5;
  --text-dim: rgba(242, 238, 229, 0.6);
  --text-faint: rgba(242, 238, 229, 0.38);
  --danger: #d2756e;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ===== Auth Screen ===== */
#auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #16171f 0%, var(--bg-deep) 60%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#auth-screen.fade-out { opacity: 0; visibility: hidden; }

.stars { position: absolute; inset: 0; overflow: hidden; }
.star {
  position: absolute; border-radius: 50%; background: rgba(248, 244, 236, 0.55);
  animation: twinkle var(--dur) ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.15; transform: scale(0.8); }
  to { opacity: 0.9; transform: scale(1.15); }
}

.entry-card {
  position: relative; z-index: 1;
  width: min(89vw, 360px); padding: 44px 34px 36px;
  background: rgba(20, 21, 28, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  text-align: center;
  animation: cardIn 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.entry-logo {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 1px; white-space: nowrap;
}
.entry-title {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 400;
  color: var(--text); margin-top: 6px; letter-spacing: 8px;
}
.entry-subtitle {
  font-size: 10px; color: var(--text-faint);
  letter-spacing: 4px; margin-top: 8px; text-transform: uppercase;
}
.entry-divider {
  width: 40px; height: 1px; margin: 26px auto 24px;
  background: var(--glass-border-strong);
}

.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 22px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 4px;
}
.auth-tab {
  flex: 1; padding: 9px 0; font-size: 14px;
  color: var(--text-dim); border-radius: var(--radius-xs);
  transition: color 0.2s, background 0.2s;
}
.auth-tab.active { color: var(--text); background: var(--glass); }

#auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input {
  width: 100%; padding: 13px 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 15px; text-align: center;
  outline: none; transition: border-color 0.25s, background 0.25s;
}
.auth-input:focus { border-color: var(--accent); background: rgba(0, 0, 0, 0.3); }
.auth-input::placeholder { color: var(--text-faint); }

#auth-submit {
  margin-top: 6px; padding: 13px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: #1b150a; font-weight: 500; font-size: 15px; letter-spacing: 1px;
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}
#auth-submit:hover { filter: brightness(1.06); }
#auth-submit:active { transform: scale(0.98); }
#auth-submit:disabled { opacity: 0.6; cursor: default; }

.entry-error {
  font-size: 13px; color: var(--danger); min-height: 20px; margin-top: 14px;
}

/* ===== Loading Screen ===== */
#loading-screen {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  transition: opacity 0.6s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

.loading-spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid rgba(212,165,116,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content { text-align: center; }
.loading-content p { color: var(--text-dim); font-size: 14px; }

/* ===== Header ===== */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top, 14px));
  background: linear-gradient(to bottom, rgba(12,13,19,0.9), rgba(12,13,19,0));
  pointer-events: none;
}
#header > * { pointer-events: auto; }
.header-title {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 400; letter-spacing: 3px;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.icon-btn {
  width: 36px; height: 36px; padding: 6px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s;
}
.icon-btn:active { background: rgba(255,255,255,0.12); }
.icon-btn svg { width: 100%; height: 100%; }

/* ===== Menu Panel ===== */
#menu-panel {
  position: fixed; top: 60px; right: 16px; z-index: 60;
  min-width: 140px; padding: 6px 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: menuIn 0.2s ease-out;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } }
.menu-item {
  display: block; width: 100%; padding: 10px 18px;
  font-size: 14px; text-align: left;
  transition: background 0.15s;
}
.menu-item:hover { background: var(--glass); }
.menu-item:active { background: rgba(255,255,255,0.06); }
.menu-user {
  padding: 10px 18px 8px; font-size: 12px; color: var(--text-faint);
  letter-spacing: 0.5px; word-break: break-all;
}
.menu-divider { height: 1px; margin: 4px 0; background: var(--glass-border); }
.menu-item-muted { color: var(--text-dim); }

/* ===== Globe (MapLibre) ===== */
#globe-container {
  position: fixed; inset: 0;
  z-index: 0;
  background: var(--bg-deep);
}
#globe-container canvas { display: block; touch-action: none; outline: none; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }

/* 打点：墨色脉冲点 + 悬停标签 */
.globe-pin {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #2c2c2a;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  position: relative;
}
.globe-pin::after {
  content: "";
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(44, 44, 42, 0.7);
  animation: pin-pulse 2.2s ease-out infinite;
}
@keyframes pin-pulse {
  0% { transform: scale(0.5); opacity: 0.85; }
  100% { transform: scale(2.6); opacity: 0; }
}
.globe-pin-label {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-family: var(--font-sans);
  color: #2c2c2a;
  background: rgba(251, 249, 243, 0.92);
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.globe-pin:hover .globe-pin-label { opacity: 1; }

/* ===== FAB Group ===== */
.fab-group {
  position: fixed;
  bottom: calc(48px + var(--safe-bottom));
  right: 20px; z-index: 40;
  display: flex; flex-direction: column; gap: 12px;
}
.fab {
  width: 50px; height: 50px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.2s, filter 0.2s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 21px; height: 21px; }
.fab-primary {
  background: var(--accent);
  color: #1b150a;
}
.fab-primary:hover { filter: brightness(1.06); }
.fab-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--accent-light);
}

/* ===== Panel (Timeline) ===== */
.panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 80;
  max-height: 65vh;
  background: var(--bg-card-solid);
  border-top: 1px solid var(--glass-border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: var(--safe-bottom);
}
.panel.show {
  transform: translateY(0);
  display: flex !important;
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.panel-header h2 {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 600;
}
.panel-close {
  width: 32px; height: 32px; font-size: 22px; line-height: 1;
  border-radius: 50%; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.panel-close:active { background: rgba(255,255,255,0.08); }

.panel-body {
  overflow-y: auto; flex: 1;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.panel-empty {
  padding: 40px 20px; text-align: center;
}
.panel-empty p { color: var(--text-dim); font-size: 14px; }
.panel-empty .sub { font-size: 12px; margin-top: 6px; }

/* Timeline Items */
.tl-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  transition: background 0.15s;
  cursor: pointer;
}
.tl-item:active { background: rgba(255,255,255,0.04); }

.tl-thumb {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--glass); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--accent);
}
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-thumb svg { width: 22px; height: 22px; }

.tl-info { flex: 1; min-width: 0; }
.tl-name {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-meta {
  font-size: 12px; color: var(--text-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Modals ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal.show { opacity: 1; visibility: visible; display: flex !important; }

.modal-content {
  width: 100%; max-width: 480px;
  max-height: 92vh;
  background: var(--bg-card-solid);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: var(--safe-bottom);
}
.modal.show .modal-content { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 600;
}
.modal-close {
  width: 32px; height: 32px; font-size: 24px; line-height: 1;
  border-radius: 50%; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
}

.modal-body {
  overflow-y: auto; flex: 1;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

/* ===== Form ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--accent-light); margin-bottom: 8px;
}
.label-hint { color: var(--text-dim); font-weight: 400; }

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

.date-picker {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.date-picker select {
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: inherit; outline: none;
}
.date-picker select:focus { border-color: var(--accent); }
.date-sep {
  font-size: 13px; color: var(--text-dim);
}
#add-date-year, #edit-date-year { min-width: 72px; }
#add-date-month, #edit-date-month,
#add-date-day, #edit-date-day { min-width: 56px; }

.edit-photo-section {
  display: flex; flex-direction: column; gap: 10px;
}
.btn-add-photo {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  font-size: 14px; color: var(--accent);
  background: rgba(212,165,116,0.12);
  border: 1px dashed var(--accent-glow);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.btn-add-photo:hover { background: rgba(212,165,116,0.18); border-color: var(--accent); }
.btn-add-photo:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.btn-add-photo-icon { font-size: 18px; line-height: 1; font-weight: 300; }

.search-box { position: relative; }
.search-box input { padding-right: 42px; }
.search-icon {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 7px;
  color: var(--accent); border-radius: var(--radius-sm);
}
.search-icon:active { background: rgba(255,255,255,0.06); }

.search-results {
  margin-top: 6px;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  max-height: 180px; overflow-y: auto;
}
.search-result-item {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer; transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:active { background: rgba(255,255,255,0.06); }

.selected-location {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 8px 12px;
  background: rgba(212,165,116,0.1);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--accent-light);
}
.selected-location span { flex: 1; }
.clear-btn {
  width: 22px; height: 22px; font-size: 16px; line-height: 1;
  border-radius: 50%; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.coord-toggle { margin-top: 8px; }
.link-btn {
  font-size: 12px; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px;
}

.manual-coords {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
}
.manual-coords input { flex: 1; padding: 8px 10px; font-size: 13px; }

.photo-exif-choice {
  margin-top: 12px; padding: 12px;
  background: rgba(212,165,116,0.08);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-sm);
}
.photo-exif-hint { display: block; font-size: 13px; color: var(--accent-light); margin-bottom: 10px; }
.photo-exif-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-exif { padding: 8px 16px; background: var(--accent); border-radius: var(--radius-sm); color: #1b150a; font-weight: 500; font-size: 13px; }
.btn-exif-outline { padding: 8px 16px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); }

/* Photo Upload */
.photo-upload {
  border: 1.5px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer;
  transition: border-color 0.2s;
}
.photo-upload:hover { border-color: var(--accent); }

.photo-placeholder {
  padding: 24px; text-align: center; color: var(--text-dim);
}
.photo-placeholder p { font-size: 13px; margin-top: 8px; }

.video-upload {
  border: 1.5px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px; cursor: pointer;
  transition: border-color 0.2s;
}
.video-upload:hover { border-color: var(--accent); }
.video-placeholder {
  text-align: center; color: var(--text-dim);
}
.video-placeholder p { font-size: 13px; margin-top: 8px; }
.video-placeholder svg { color: var(--accent); }
.video-preview {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: rgba(212,165,116,0.08);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--accent-light);
}
.video-preview .clear-btn { flex-shrink: 0; }

.photo-preview {
  position: relative;
}
.photo-preview img {
  width: 100%; max-height: 200px; object-fit: cover; display: block;
}
.photo-preview .clear-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.5); color: #fff;
  width: 28px; height: 28px; font-size: 18px;
}

/* Buttons */
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: #1b150a; font-weight: 500; font-size: 15px; letter-spacing: 0.5px;
  transition: filter 0.2s, opacity 0.2s, transform 0.15s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary:not(:disabled):active { transform: scale(0.98); }

.btn-outline {
  padding: 10px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  transition: background 0.15s;
}
.btn-outline:active { background: rgba(255,255,255,0.06); }

.btn-danger {
  padding: 10px 20px;
  border: 1px solid rgba(192, 84, 79, 0.3);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--danger);
  transition: background 0.15s;
}
.btn-danger:active { background: rgba(192,84,79,0.1); }

/* ===== Detail Modal ===== */
.modal-header { position: relative; }
.detail-photos-wrap {
  margin: -20px -20px 16px; overflow: hidden;
}
.detail-photos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; padding: 16px;
}
.detail-photos-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: transform 0.2s;
}
.detail-photos-grid img:active { transform: scale(0.98); }
.detail-photo {
  margin: -20px -20px 16px;
  overflow: hidden;
}
.detail-photo img {
  width: 100%; max-height: 300px; object-fit: cover; display: block;
}
.photo-preview-multi #photo-preview-imgs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; padding: 12px;
}
.photo-preview-multi #photo-preview-imgs img,
.photo-preview-multi #edit-photo-preview-imgs img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px;
}
.photo-preview-multi #edit-photo-preview-imgs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; padding: 12px;
}
.detail-date {
  font-size: 13px; color: var(--accent); margin-bottom: 12px;
}
.detail-text {
  font-family: var(--font-serif);
  font-size: 16px; line-height: 1.8;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
}
.detail-video {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.detail-video iframe,
.detail-video video {
  width: 100%; height: 100%; border: none; display: block;
}
.detail-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ===== Photo Lightbox ===== */
.photo-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.photo-lightbox.hidden { display: none; }
.lightbox-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 44px; height: 44px;
  font-size: 28px; line-height: 1; color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
  cursor: pointer; transition: background 0.2s;
}
.lightbox-close:hover, .lightbox-close:active { background: rgba(255,255,255,0.2); }
.lightbox-content {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; user-select: none;
}
.lightbox-content img {
  max-width: 95vw; max-height: 95vh; object-fit: contain;
  transition: transform 0.15s ease-out;
  cursor: grab;
}
.lightbox-content img:active { cursor: grabbing; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  font-size: 36px; font-weight: 300; line-height: 1; color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav.hidden { display: none; }
.lightbox-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 14px; color: rgba(255,255,255,0.6);
}
.lightbox-counter.hidden { display: none; }
.lightbox-hint {
  position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: rgba(255,255,255,0.5);
  pointer-events: none;
}

/* ===== Footer ===== */
#footer {
  position: fixed; bottom: 6px; left: 0; right: 0;
  z-index: 30;
  text-align: center;
  font-size: 10px; color: rgba(212,165,116,0.3);
  letter-spacing: 1px;
  pointer-events: none;
  padding-bottom: var(--safe-bottom);
}

/* ===== Marker Tooltip ===== */
.marker-label {
  position: absolute; pointer-events: none;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px; white-space: nowrap;
  color: var(--accent-light);
  transform: translate(-50%, -120%);
  opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.marker-label.show { opacity: 1; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ===== Desktop ===== */
@media (min-width: 768px) {
  .panel {
    left: auto; width: 360px; right: 0;
    max-height: 70vh; bottom: 80px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
  }
  .modal { align-items: center; }
  .modal-content {
    border-radius: var(--radius);
    max-height: 85vh;
  }
  .fab-group { bottom: 32px; right: 32px; }
  #footer { bottom: 10px; }
}
