:root {
  --ink: #f3f0e9;
  --muted: #918f89;
  --panel: rgba(12, 12, 11, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --mars: #e86638;
  --mars-soft: #ffb07b;
  --accent: var(--mars);
  --accent-soft: var(--mars-soft);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #080807; color: var(--ink); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.atlas-shell { width: 100%; height: 100%; display: grid; grid-template: 72px 1fr / 390px 1fr; background: #080807; }
.topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 390px 1fr auto auto; align-items: center; border-bottom: 1px solid var(--line); background: rgba(9, 9, 8, .96); z-index: 1000; }
.brand { height: 72px; display: flex; align-items: center; gap: 9px; padding: 0 24px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; letter-spacing: .06em; }
.brand strong { font-size: 17px; }
.brand em { color: var(--accent); font-size: 11px; font-style: normal; letter-spacing: .2em; }
.brand-orbit { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-22deg); }
.brand-orbit::after { content: ""; width: 34px; height: 12px; border: 1px solid var(--accent); border-radius: 50%; position: absolute; }
.brand-orbit i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.body-switch { justify-self: center; display: flex; height: 100%; }
.body-switch button { min-width: 112px; padding: 0 20px; border: 0; border-left: 1px solid transparent; border-right: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; position: relative; }
.body-switch button::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px; background: transparent; }
.body-switch b, .body-switch small { display: block; }
.body-switch b { font-size: 14px; margin-bottom: 2px; }
.body-switch small { font-size: 9px; letter-spacing: .22em; }
.body-switch button.active { color: var(--ink); }
.body-switch button.active::after { background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.dataset-summary { display: flex; align-items: center; gap: 10px; padding: 0 26px; border-left: 1px solid var(--line); height: 100%; }
.dataset-summary .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.dataset-summary p { margin: 0; }
.dataset-summary b, .dataset-summary small { display: block; }
.dataset-summary b { font-size: 10px; letter-spacing: .14em; }
.dataset-summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.panel-toggle { display: none; margin-right: 14px; width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 50%; }
.sidebar { grid-row: 2; display: flex; min-height: 0; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); z-index: 800; backdrop-filter: blur(20px); }
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 28px 24px 18px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .22em; }
.sidebar h1 { margin: 6px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 500; }
.sidebar-head button, .feature-card > button { border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.sidebar-head button { display: none; }
.search-box { margin: 0 24px; height: 48px; border: 1px solid var(--line); display: flex; align-items: center; padding: 0 13px; gap: 9px; background: rgba(255,255,255,.035); }
.search-box > span { color: var(--accent); font-size: 22px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #77746e; }
.search-box kbd { color: #77746e; border: 1px solid var(--line); border-radius: 3px; padding: 2px 5px; font-size: 9px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 24px; }
.filters label { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.filters select { width: 100%; margin-top: 6px; border: 0; border-bottom: 1px solid var(--line); padding: 7px 0; outline: none; color: var(--ink); background: #0d0d0c; font-size: 11px; }
.catalog-status { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 24px 12px; border: 1px solid var(--line); }
.catalog-status p { margin: 0; padding: 10px; border-right: 1px solid var(--line); }
.catalog-status p:last-child { border: 0; }
.catalog-status strong, .catalog-status span { display: block; }
.catalog-status strong { color: var(--accent-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.catalog-status span { margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.result-list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.result-item { width: 100%; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 12px 24px; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.result-item:hover, .result-item.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.result-item i { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 50%; color: var(--accent-soft); font-style: normal; font-size: 8px; }
.result-item b, .result-item small { display: block; }
.result-item b { font-size: 12px; font-weight: 600; }
.result-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.result-item > span:last-child { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.result-empty { padding: 38px 24px; color: var(--muted); font-size: 12px; line-height: 1.8; text-align: center; }
.feature-card { position: absolute; left: 410px; bottom: 30px; z-index: 900; width: min(360px, calc(100vw - 440px)); padding: 23px; border: 1px solid var(--line); background: rgba(10,10,9,.94); box-shadow: 0 24px 80px rgba(0,0,0,.42); backdrop-filter: blur(20px); }
.feature-card.hidden { display: none; }
.feature-card > button { position: absolute; top: 12px; right: 14px; }
.feature-type { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.feature-card h2 { margin: 6px 30px 10px 0; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 500; }
.feature-origin { max-height: 76px; margin: 0 0 15px; overflow: auto; color: #b7b3ab; font-size: 11px; line-height: 1.6; }
.feature-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature-card dl div { padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-card dt { color: var(--muted); font-size: 8px; }
.feature-card dd { margin: 3px 0 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.feature-card a { color: var(--accent-soft); font-size: 10px; text-decoration: none; }
.sidebar footer { padding: 11px 24px; border-top: 1px solid var(--line); color: #65635f; font-size: 8px; line-height: 1.6; }
.sidebar footer p { margin: 0; }
.map-stage { grid-column: 2; grid-row: 2; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #111; }
#map { position: absolute; inset: 0; background: #111; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom { margin: 22px !important; border: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 37px !important; border-color: var(--line) !important; border-radius: 0 !important; background: rgba(8,8,7,.84) !important; color: var(--ink) !important; }
.leaflet-control-attribution { padding: 4px 8px !important; background: rgba(8,8,7,.72) !important; color: #8b8882 !important; font-size: 8px !important; }
.leaflet-control-attribution a { color: var(--accent-soft) !important; }
.leaflet-tile-pane { filter: saturate(.82) contrast(1.04); }
.coordinate-bar { position: absolute; right: 20px; bottom: 20px; z-index: 700; display: flex; gap: 11px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); background: rgba(8,8,7,.72); color: #b5b2ac; font-size: 9px; letter-spacing: .08em; backdrop-filter: blur(12px); font-variant-numeric: tabular-nums; }
.coordinate-bar i { width: 1px; height: 12px; background: var(--line); }
.loading { position: absolute; inset: 0; z-index: 850; display: grid; place-content: center; justify-items: center; gap: 15px; background: #0a0a09; transition: opacity .4s ease, visibility .4s ease; }
.loading.done { opacity: 0; visibility: hidden; }
.loading i { width: 46px; height: 46px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.loading p { color: var(--ink); font-size: 12px; letter-spacing: .08em; text-align: center; }
.loading p span { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.map-error { position: absolute; top: 16px; left: 50%; z-index: 700; transform: translateX(-50%); padding: 9px 14px; border: 1px solid #6f402f; background: rgba(35,16,10,.9); color: #f5b397; font-size: 10px; }
.map-error.hidden { display: none; }
.planet-marker { border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.75), 0 0 10px color-mix(in srgb, var(--accent) 48%, transparent); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .atlas-shell { grid-template: 64px 1fr / 1fr; }
  .topbar { grid-template-columns: 1fr auto auto; height: 64px; }
  .brand { height: 64px; padding: 0 14px; border-right: 0; }
  .brand em, .dataset-summary { display: none; }
  .body-switch button { min-width: 72px; padding: 0 10px; }
  .body-switch button::after { left: 10px; right: 10px; }
  .panel-toggle { display: block; }
  .sidebar { position: fixed; inset: 64px 0 0 0; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-head button { display: block; }
  .map-stage { grid-column: 1; grid-row: 2; }
  .feature-card { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; }
  .coordinate-bar { right: 10px; bottom: 10px; }
  .search-box kbd { display: none; }
}
