* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0d0f12;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #f1f5f9;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; }

.hidden { display: none !important; }

/* ---------- 视图与底图 ---------- */
.view { position: absolute; inset: 0; z-index: 1; display: none; flex-direction: column; }
.view.active { display: flex; }

#view-map { display: none; }
#view-map.active { display: block; }
#map-container { position: absolute; inset: 0; z-index: 1; background: #121418; }
#fog-canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.glass-panel {
  background: rgba(22, 27, 34, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ---------- 顶部状态栏 ---------- */
.status-bar {
  position: absolute; top: calc(env(safe-area-inset-top, 12px) + 8px); left: 12px; right: 12px;
  z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; max-width: 520px; margin: 0 auto;
}
.status-item { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.status-item .label { color: #94a3b8; font-size: 12px; }
.status-item strong { font-weight: 600; color: #38bdf8; }
.status-item.stats strong { font-size: 13px; }
.status-item .sep { color: #475569; }

.indicator { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 8px #f59e0b; transition: background 0.3s, box-shadow 0.3s; flex: none; }
.indicator.active { background: #10b981; box-shadow: 0 0 10px #10b981; }

.icon-btn {
  background: transparent; border: none; color: #cbd5e1; padding: 4px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:active { color: #38bdf8; }

/* ---------- FAB ---------- */
.fab-group { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 12px) + 84px); z-index: 30; display: flex; flex-direction: column; gap: 12px; }
.fab { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.12); color: #f8fafc; cursor: pointer; transition: transform 0.15s ease; }
.fab:active { transform: scale(0.92); background: rgba(30,41,59,0.95); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; border-radius: 0; border-left: none; border-right: none; border-bottom: none;
  padding: 6px 0 calc(env(safe-area-inset-bottom, 0px) + 6px);
}
.tab { flex: 1; background: none; border: none; color: #64748b; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 4px 0; cursor: pointer; }
.tab.active { color: #38bdf8; }
.tab:active { opacity: 0.7; }

/* ---------- 列表视图通用 ---------- */
.view-header { margin: calc(env(safe-area-inset-top, 12px) + 10px) 12px 8px; padding: 14px 16px; flex: none; }
.view-header h2 { font-size: 18px; font-weight: 600; }
.view-sub { font-size: 12px; color: #94a3b8; margin-top: 3px; }

.card-list, .timeline-scroll { flex: 1; overflow-y: auto; padding: 4px 12px calc(env(safe-area-inset-bottom, 0px) + 84px); -webkit-overflow-scrolling: touch; }

.card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px;
}
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-name { font-size: 15px; font-weight: 500; color: #38bdf8; word-break: break-all; }
.card-addr { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.4; word-break: break-all; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.chip { font-size: 11px; color: #cbd5e1; background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 999px; }
.card-actions { display: flex; gap: 8px; margin-top: 8px; }
.mini-btn { font-size: 12px; color: #94a3b8; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.mini-btn.danger { color: #f87171; }
.mini-btn:active { opacity: 0.75; }

.empty-hint { text-align: center; color: #64748b; font-size: 13px; padding: 48px 20px; line-height: 1.7; }

/* ---------- 时间线 ---------- */
.day-block { margin-bottom: 14px; }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px; }
.day-date { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.day-stats { font-size: 11px; color: #64748b; }
.day-line { border-left: 2px solid rgba(56,189,248,0.35); margin-left: 12px; padding-left: 14px; }
.pearl { position: relative; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.pearl::before { content: ""; position: absolute; left: -21px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 8px rgba(56,189,248,0.8); }
.pearl-head { display: flex; justify-content: space-between; gap: 8px; }
.pearl-time { font-size: 11px; color: #64748b; }
.pearl-title { font-size: 14px; font-weight: 500; color: #e2e8f0; margin-top: 2px; }
.pearl-addr { font-size: 12px; color: #64748b; margin-top: 3px; }

/* ---------- 账号菜单 ---------- */
.account-menu { position: absolute; top: calc(env(safe-area-inset-top, 12px) + 58px); right: 12px; z-index: 60; width: 180px; padding: 8px; }
.account-name { font-size: 13px; color: #e2e8f0; padding: 8px 10px; word-break: break-all; }
.menu-btn { width: 100%; text-align: left; background: none; border: none; color: #f87171; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu-btn.subtle { color: #94a3b8; }
.menu-btn:active { background: rgba(255,255,255,0.06); }

/* ---------- 登录覆盖层 ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 8, 12, 0.82); backdrop-filter: blur(10px); }
.auth-card { width: 100%; max-width: 380px; padding: 26px 24px 22px; }
.auth-brand { text-align: center; margin-bottom: 18px; }
.brand-mark { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px; background: radial-gradient(circle at 30% 30%, #38bdf8, #1d4ed8); box-shadow: 0 0 24px rgba(56,189,248,0.5); }
.auth-brand h1 { font-size: 24px; letter-spacing: 2px; }
.auth-brand p { font-size: 12px; color: #94a3b8; margin-top: 6px; line-height: 1.6; }
.auth-tabs { display: flex; background: rgba(255,255,255,0.05); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.auth-tab { flex: 1; background: none; border: none; color: #94a3b8; font-size: 14px; padding: 7px 0; border-radius: 8px; cursor: pointer; }
.auth-tab.active { background: rgba(56,189,248,0.18); color: #38bdf8; font-weight: 600; }
#auth-form input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; color: #f1f5f9; font-size: 14px; padding: 11px 12px; margin-bottom: 10px; outline: none; }
#auth-form input:focus { border-color: rgba(56,189,248,0.6); }
.auth-error { min-height: 18px; font-size: 12px; color: #f87171; margin: 0 0 6px; }
.auth-submit { width: 100%; background: linear-gradient(135deg, #0ea5e9, #2563eb); border: none; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 600; padding: 11px 0; cursor: pointer; }
.auth-submit:active { opacity: 0.85; }
.auth-guest { width: 100%; background: none; border: none; color: #64748b; font-size: 13px; padding: 10px 0 0; cursor: pointer; }
.auth-note { font-size: 11px; color: #475569; text-align: center; margin-top: 12px; line-height: 1.6; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 12px) + 96px); transform: translateX(-50%); z-index: 200; background: rgba(30,41,59,0.95); color: #e2e8f0; font-size: 13px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); max-width: 86vw; text-align: center; }