/* ============ 星际游览 · UI 样式 ============ */
:root {
  --bg: #05070f;
  --glass: rgba(10, 16, 32, 0.72);
  --glass-border: rgba(122, 162, 255, 0.18);
  --text: #dfe7ff;
  --text-dim: #8b97b8;
  --accent: #7ab8ff;
  --accent-2: #ffd27a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}

/* 触控设备：禁止双击缩放（iOS 忽略 user-scalable，需 touch-action 配合） */
button { touch-action: manipulation; }

/* UI 界面禁止长按选中/呼出菜单；科普文字保持可选中 */
body, #markers { user-select: none; -webkit-user-select: none; }
#info-desc, #info-dist, .panel-note { user-select: text; -webkit-user-select: text; }

#app { position: fixed; inset: 0; }

#scene-container { position: absolute; inset: 0; touch-action: none; }
#scene-container canvas { display: block; }

/* ---------- 标记层 ---------- */
#markers {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  touch-action: none;
  z-index: 5;
}

.marker {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 14px; /* ≥44px 触控热区 */
  background: none; border: none; cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  will-change: transform;
  z-index: 1;
  transition: opacity .45s ease;
}
.marker .dot-wrap {
  position: relative; width: 12px; height: 12px; flex: none;
}
.marker .dot {
  position: absolute; inset: 2px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff 0%, var(--mc, #7ab8ff) 62%);
  box-shadow: 0 0 6px 1px var(--mc, #7ab8ff), 0 0 16px 3px color-mix(in srgb, var(--mc, #7ab8ff) 45%, transparent);
  transition: transform .18s ease;
}
/* 常驻脉冲环太吵——只在悬停/聚焦时出现，作为"可点"反馈 */
.marker .ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--mc, #7ab8ff);
  opacity: 0;
  transition: opacity .2s;
}
.marker:hover .ring, .marker:focus-visible .ring {
  opacity: 0.9;
  animation: marker-pulse 1.6s ease-out infinite;
}
@keyframes marker-pulse {
  0%   { transform: scale(0.55); opacity: 0.9; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
.marker:hover .dot { transform: scale(1.35); }
.marker:active .dot { transform: scale(1.1); }
.marker .label {
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 0 8px rgba(0,0,0,0.95), 0 1px 2px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9);
  white-space: nowrap;
  opacity: 0.92;
  transition: opacity .3s, color .2s, transform .2s;
}
.marker:hover .label, .marker:focus-visible .label { color: #fff; opacity: 1; transform: translateX(1px); }
.marker:focus-visible { outline: none; }
.marker:focus-visible .dot-wrap::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1.5px solid #fff; opacity: .8;
}
.marker.dim .label { opacity: 0.4; }
/* 标签避让：与更近标记的文字重叠时收起本标签，只留光点 */
.marker.no-label .label { display: none; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  pointer-events: none;
  z-index: 10;
}
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.brand-star {
  font-size: 22px; color: var(--accent-2); flex: none;
  text-shadow: 0 0 12px rgba(255, 210, 122, 0.8);
  animation: brand-glow 4s ease-in-out infinite;
}
@keyframes brand-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 210, 122, 0.55); }
  50% { text-shadow: 0 0 18px rgba(255, 210, 122, 0.95), 0 0 30px rgba(255, 180, 90, 0.35); }
}
.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 17px; font-weight: 600; letter-spacing: 0.14em;
  white-space: nowrap;
  background: linear-gradient(120deg, #eaf1ff, #9db8ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* 层级面包屑：位置 + 固定提示两段（手机端隐藏提示段，见文末移动端区域） */
.crumb-line {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0; max-width: 46vw;
}
#breadcrumb {
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb-hint {
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em;
  white-space: nowrap; flex: none;
}
.top-actions { display: flex; gap: 8px; }

.pill-btn {
  padding: 8px 14px;
  font-size: 13px; color: var(--text); letter-spacing: 0.05em;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, background .2s, transform .15s ease, box-shadow .2s;
}
.pill-btn:hover {
  border-color: rgba(122, 184, 255, 0.5);
  background: rgba(30, 45, 80, 0.8);
  box-shadow: 0 0 18px rgba(90, 140, 255, 0.18);
  transform: translateY(-1px);
}
.pill-btn:active { transform: translateY(0) scale(0.97); }
.pill-btn:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
/* 窄屏时"星图总览 / 自动导览"切换为短文案（媒体查询在文末移动端区域） */
#btn-overview .short { display: none; }
#btn-tour .short { display: none; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1; color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  transition: color .2s, background .2s, transform .15s ease, border-color .2s;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(122,184,255,0.4); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* ---------- 飞行状态 ---------- */
#status {
  position: absolute;
  top: calc(64px + var(--safe-top)); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: 13px; letter-spacing: 0.04em;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 9;
  white-space: nowrap;
  transition: opacity .3s, transform .3s;
}
#status.hidden { opacity: 0; transform: translateX(-50%) translateY(-8px); pointer-events: none; }
#status-text {
  min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: status-blink 1s ease-in-out infinite alternate;
}
@keyframes status-blink { from { opacity: .35; } to { opacity: 1; } }

/* ---------- 顶栏：时间流速 ---------- */
.time-box {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.time-label { font-size: 12px; opacity: .8; }
.time-select {
  background: transparent; color: var(--text);
  border: none; outline: none; cursor: pointer;
  font-size: 12px; font-family: inherit; letter-spacing: 0.03em;
  -webkit-appearance: none; appearance: none;
  padding-right: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5'><path d='M0 0l4 5 4-5z' fill='%238b97b8'/></svg>");
  background-repeat: no-repeat; background-position: right center;
}
.time-select:hover { color: #fff; }
.time-select:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.time-select option { background: #0b1020; color: #e8ecf6; }

/* ---------- 日期跳转（时间箱内，历算随日期重算） ---------- */
.date-jump {
  background: transparent; border: none; outline: none; cursor: pointer;
  color: var(--text); font-size: 11.5px; font-family: inherit;
  letter-spacing: 0.02em; color-scheme: dark; width: 150px;
}
.date-jump:hover { color: #fff; }
.date-jump:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.date-now {
  background: transparent; border: none; cursor: pointer;
  color: var(--accent); font-size: 11px; font-family: inherit;
  padding: 2px 5px; border-radius: 4px; letter-spacing: 0.05em;
}
.date-now:hover { background: rgba(122, 184, 255, 0.14); }
#btn-freefly.active {
  background: rgba(138, 216, 255, 0.16);
  border-color: rgba(138, 216, 255, 0.55);
  color: #bfe6ff;
}

/* ---------- 自动导览进度条（位于状态条下方，避免重叠） ---------- */
.tour-bar {
  position: absolute; top: calc(102px + var(--safe-top));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 16px;
  background: var(--glass);
  border: 1px solid rgba(122, 184, 255, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(80, 130, 255, 0.12);
  z-index: 11; white-space: nowrap;
  transition: opacity .3s, visibility .3s, transform .3s;
}
.tour-bar.hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-50%) translateY(-6px); }
.tour-text { font-size: 12.5px; letter-spacing: 0.04em; }
.pill-btn.small { padding: 5px 10px; font-size: 11px; }

/* ---------- 星图面板 ---------- */
#panel {
  position: absolute;
  top: calc(64px + var(--safe-top)); left: calc(14px + var(--safe-left));
  width: 292px; max-width: calc(100vw - 28px);
  max-height: calc(100% - 96px - var(--safe-top) - var(--safe-bottom));
  display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 16px;
  overflow-y: auto;
  z-index: 20;
  transition: opacity .3s, transform .3s;
}
#panel.hidden { opacity: 0; transform: translateX(-16px); pointer-events: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-head h2 { font-size: 15px; letter-spacing: 0.12em; }
.panel-note { font-size: 11px; line-height: 1.7; color: var(--text-dim); margin-bottom: 12px; }
.note-more {
  display: inline-block; margin-top: 4px; padding: 0;
  font: inherit; font-size: 10.5px; color: var(--accent);
  background: none; border: none; cursor: pointer;
  letter-spacing: 0.03em; opacity: 0.9;
  transition: opacity .2s;
}
.note-more:hover { opacity: 1; text-decoration: underline; }
.note-extra { display: none; margin-top: 4px; }
.panel-note.expanded .note-extra { display: block; animation: note-in .35s ease; }
@keyframes note-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.panel-section h3 {
  font-size: 11px; font-weight: 500; color: var(--text-dim);
  letter-spacing: 0.18em; margin: 12px 0 8px;
}
.level-list { display: grid; gap: 6px; }
.level-btn {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text); cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s ease;
}
.level-btn:hover {
  border-color: rgba(122, 184, 255, 0.45); background: rgba(60, 90, 150, 0.25);
  transform: translateX(2px);
}
.level-btn:active { transform: translateX(2px) scale(0.985); }
.level-btn:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 1px; }
.level-btn .lv-name { font-size: 13px; letter-spacing: 0.06em; }
.level-btn .lv-desc { font-size: 10.5px; color: var(--text-dim); }

.target-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 1px; }
.target-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  font-size: 12px; color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s ease;
}
.target-chip:hover {
  border-color: var(--tc, var(--accent));
  background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent);
  transform: translateY(-1px);
}
.target-chip:active { transform: translateY(0) scale(0.96); }
.target-chip:focus-visible { outline: 1.5px solid var(--tc, var(--accent)); outline-offset: 1px; }
.target-chip .chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tc, var(--accent));
  box-shadow: 0 0 6px var(--tc, var(--accent));
}
.target-chip.filtered-out { display: none; }
.target-chip.visited { opacity: .62; }
.target-chip.visited .chip-dot { box-shadow: none; background: transparent; border: 1.5px solid var(--tc, var(--accent)); }
.target-chip.visited::after { content: '✓'; font-size: 9px; color: var(--tc, var(--accent)); }

.visited-count { float: right; font-size: 10px; letter-spacing: .04em; opacity: .8; }
.target-search {
  width: 100%; box-sizing: border-box;
  margin: 2px 0 8px; padding: 9px 12px;
  font-size: 12.5px; font-family: inherit; color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border); border-radius: 10px;
  outline: none; -webkit-appearance: none; appearance: none;
}
.target-search:focus { border-color: var(--accent); }
.target-search::placeholder { color: var(--text-dim); }
.type-filter {
  display: flex; gap: 5px; margin-bottom: 6px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 4px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
}
.type-filter::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 5px 10px; font-size: 11px; color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--glass-border); border-radius: 999px;
  cursor: pointer; transition: all .2s;
  flex: none;
}
.filter-chip.active {
  color: #060a14; background: var(--tc, var(--accent));
  border-color: var(--tc, var(--accent)); font-weight: 600;
}

/* ---------- 天体直达：空间域分组 ---------- */
.tgroup { margin-bottom: 4px; }
.tgroup-head {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 7px 4px 7px 2px; margin-bottom: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-family: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color .2s;
}
.tgroup-head:hover { color: var(--accent); }
.tgroup-head:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.tg-arrow {
  width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  opacity: 0.55;
  transition: transform .25s ease;
}
.tgroup.collapsed .tg-arrow { transform: rotate(0deg); }
.tgroup:not(.collapsed) .tg-arrow { transform: rotate(90deg); }
.tg-name {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
}
.tg-count {
  margin-left: auto; font-size: 10px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.05);
  padding: 1px 7px; border-radius: 999px;
}
.tgroup-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s ease, opacity .25s ease;
  opacity: 1;
}
.tgroup.collapsed .tgroup-wrap { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.tgroup-wrap > .target-list { overflow: hidden; min-height: 0; }
.tgroup.group-empty { display: none; }

#panel-mask {
  position: absolute; inset: 0; z-index: 15;
  background: rgba(3, 5, 12, 0.35);
}
#panel-mask.hidden { display: none; }

/* ---------- 信息卡 ---------- */
#info-card {
  position: absolute;
  right: calc(14px + var(--safe-right)); bottom: calc(14px + var(--safe-bottom));
  width: 320px; max-width: calc(100vw - 28px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  padding: 18px;
  z-index: 20;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: opacity .35s ease, transform .35s cubic-bezier(.22, .9, .3, 1.1);
}
#info-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--tc, var(--accent-2)), transparent 70%);
  opacity: 0.9;
}
#info-card.hidden { opacity: 0; transform: translateY(16px) scale(0.98); pointer-events: none; }
#info-card .icon-btn { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; font-size: 16px; }
.info-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.info-head h2 { font-size: 20px; letter-spacing: 0.08em; }
.info-en { font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em; }
.type-badge {
  font-size: 10px; letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 999px;
  color: #060a14; background: var(--tc, var(--accent-2));
  font-weight: 600;
  box-shadow: 0 0 12px color-mix(in srgb, var(--tc, var(--accent-2)) 45%, transparent);
}
.info-row {
  display: flex; gap: 10px; font-size: 12.5px;
  padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.07);
}
.info-key { color: var(--text-dim); flex: none; }
.info-desc {
  font-size: 12.5px; line-height: 1.8; color: var(--text);
  padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.07);
}

/* ---------- 手势提示 ---------- */
#hint {
  position: absolute;
  bottom: calc(16px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px; letter-spacing: 0.06em; color: var(--text-dim);
  background: rgba(8, 12, 24, 0.55);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(122, 162, 255, 0.12);
  z-index: 8; white-space: nowrap;
  transition: opacity 1s;
}
#hint.faded { opacity: 0; pointer-events: none; }

/* ---------- 实时地球时钟（真实晨昏线同步指示） ---------- */
#earth-clock {
  position: absolute;
  right: calc(14px + var(--safe-right));
  bottom: calc(52px + var(--safe-bottom));   /* 抬高于手势提示条，避免重叠 */
  font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-dim);
  background: rgba(8, 12, 24, 0.55);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(122, 162, 255, 0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
  z-index: 8; white-space: nowrap;
}
#earth-clock .clock-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #7dffc8; box-shadow: 0 0 6px #7dffc8; margin-right: 6px;
  animation: status-blink 2s ease-in-out infinite alternate;
}
#earth-clock.hidden { display: none; }
/* 信息卡展开时隐藏时钟，避免在右下角相互遮挡（尤其移动端全宽卡片） */
#info-card:not(.hidden) ~ #earth-clock { display: none; }
@media (max-width: 768px) {
  #earth-clock { font-size: 9.5px; padding: 5px 10px; }
}

/* ---------- 加载页 ---------- */
#loader {
  position: absolute; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(40, 60, 130, 0.35), transparent),
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(80, 50, 130, 0.25), transparent),
    var(--bg);
  transition: opacity .8s;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; padding: 24px; }
.loader-logo {
  width: 66px; height: 66px; margin: 0 auto; position: relative;
}
.loader-logo::before {
  content: "✦"; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 34px; color: var(--accent-2);
  text-shadow: 0 0 22px rgba(255, 210, 122, 0.9);
  animation: logo-breathe 2.4s ease-in-out infinite;
}
.loader-logo::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--accent); border-right-color: rgba(122,184,255,0.35);
  animation: loader-spin 1.4s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes logo-breathe { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.15); opacity: 1; } }
.loader-inner h1 {
  font-size: 26px; letter-spacing: 0.3em; margin: 20px 0 6px; text-indent: 0.3em;
  background: linear-gradient(120deg, #eaf1ff, #9db8ff, #eaf1ff);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: title-shimmer 3.5s linear infinite;
}
@keyframes title-shimmer { to { background-position: 200% center; } }
.loader-sub { font-size: 12px; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 26px; }
.loader-bar {
  width: 240px; height: 3px; margin: 0 auto;
  background: rgba(255,255,255,0.08);
  border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.4);
}
#loader-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(122, 184, 255, 0.6);
  transition: width .3s;
}
#loader-label { margin-top: 12px; font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
  .brand-text h1 { font-size: 15px; }
  .brand-star { font-size: 19px; }
  #panel {
    top: auto; bottom: calc(14px + var(--safe-bottom));
    left: calc(10px + var(--safe-left)); right: calc(10px + var(--safe-right));
    width: auto; max-height: 56%;
    padding: 14px 16px calc(14px + var(--safe-bottom));
  }
  #panel.hidden { transform: translateY(16px); }
  /* 移动端面板滚动条同样细化 */
  #panel { scrollbar-width: thin; scrollbar-color: rgba(122,162,255,0.25) transparent; }
  #panel::-webkit-scrollbar { width: 4px; }
  #panel::-webkit-scrollbar-thumb { background: rgba(122,162,255,0.25); border-radius: 999px; }
  #info-card {
    left: calc(10px + var(--safe-left)); right: calc(10px + var(--safe-right));
    bottom: calc(10px + var(--safe-bottom)); width: auto;
    max-height: 62%; overflow-y: auto;
    padding: 14px 16px;
  }
  .info-head h2 { font-size: 17px; }
  .info-desc { font-size: 12px; }
  #status { top: calc(58px + var(--safe-top)); font-size: 12px; max-width: calc(100vw - 32px); }
  .marker .label { font-size: 11px; }
  #hint {
    max-width: calc(100vw - 24px);
    white-space: normal; text-align: center; line-height: 1.55;
    bottom: calc(12px + var(--safe-bottom));
  }
  #earth-clock {
    max-width: calc(100vw - 20px);
    overflow: hidden; text-overflow: ellipsis;
    bottom: calc(56px + var(--safe-bottom));
  }
}

/* 触控设备：放大触控目标至 ≥40px（markers 已有 ≥44px 热区）
   置于手机竖屏规则之前：≤600px 的紧凑尺寸在后覆盖本条 */
@media (pointer: coarse) {
  .pill-btn { padding: 10px 15px; font-size: 12.5px; }
  #btn-freefly { display: none; }   /* 键盘飞行仅桌面端 */
  .icon-btn { width: 40px; height: 40px; font-size: 21px; }
  .target-chip { padding: 10px 14px; font-size: 12.5px; }
  .level-btn { padding: 12px 14px; }
  #info-card .icon-btn { width: 34px; height: 34px; font-size: 17px; }
}

/* 手机竖屏（≤600px）：顶栏两行紧凑布局，压缩纵向占用
   第一行：✦ 标题 + 当前层级（同行显示，超长省略）
   第二行：时间流速 / 导览 / 总览 / 星图 均分整行 */
@media (max-width: 600px) {
  #topbar {
    flex-direction: column; align-items: stretch;
    gap: 7px;
    padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));
  }
  .brand { align-items: center; }
  .brand-star { font-size: 16px; }
  .brand-text { flex: 1; display: flex; align-items: baseline; gap: 7px; }
  .brand-text h1 { font-size: 14px; letter-spacing: 0.1em; flex: none; }
  .crumb-line { flex: 1; max-width: none; }
  #breadcrumb { flex: 1; font-size: 10.5px; }
  #breadcrumb::before { content: '·'; margin-right: 6px; opacity: .65; }
  .crumb-hint { display: none; }   /* 提示语与底部手势条重复，手机端省略 */

  .top-actions { width: 100%; justify-content: space-between; gap: 6px; }
  .pill-btn { padding: 8px 12px; font-size: 12px; letter-spacing: 0.02em; }
  .time-box { padding: 6px 9px; }
  .time-select { font-size: 11px; padding-right: 12px; }
  /* 日期跳转与自由飞行：桌面端专属（触屏无键盘），窄屏隐藏 */
  .date-jump, .date-now { display: none; }
  #btn-freefly { display: none; }
  #btn-overview .long { display: none; }
  #btn-overview .short { display: inline; }
  #btn-tour .long { display: none; }
  #btn-tour .short { display: inline; }

  /* 顶栏总高约 80px：飞行状态条 / 导览条紧随其下 */
  #status { top: calc(84px + var(--safe-top)); }
  .tour-bar { top: calc(126px + var(--safe-top)); }
}

/* 横屏手机：压缩顶栏与卡片 */
@media (max-width: 920px) and (orientation: landscape) {
  #topbar { padding-top: calc(6px + var(--safe-top)); }
  /* 高度有限的横屏同样换短文案，保证顶栏单行放得下 */
  #btn-overview .long { display: none; }
  #btn-overview .short { display: inline; }
  #btn-tour .long { display: none; }
  #btn-tour .short { display: inline; }
  #status { top: calc(46px + var(--safe-top)); }
  .tour-bar { top: calc(78px + var(--safe-top)); }
  #info-card { max-height: 60%; width: 300px; left: auto; }
  #panel { max-height: 66%; }
  #hint { bottom: calc(8px + var(--safe-bottom)); }
  #earth-clock { bottom: calc(44px + var(--safe-bottom)); }
}

/* ---------- 无障碍：减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marker { transition: none; }
}
