/* ============================================================
   山海图 · atlas.css
   全幅舞台：页面本身不滚动，滚轮只用于缩放，指针锚定。
   只作用于 .atlas-root 内的元素，不污染全站样式。
   ============================================================ */

:root {
  --f-brush: "MaShanZheng", "Songti SC", "STKaiti", serif;
  --f-kai: "WenKai", "LXGW WenKai", "Kaiti SC", "Songti SC", serif;
  --f-serif: "Songti SC", "Noto Serif SC", Georgia, serif;
  --f-sans: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

/* 七区色（昼·绢本） */
html[data-theme="ink"] {
  --atlas-paper: #F1E9DA;
  --atlas-surface: #FAF5EA;
  --atlas-ink: #1E1914;
  --atlas-ink-2: #4A3F34;
  --atlas-ink-3: #6E604F;
  --atlas-line: rgba(74, 63, 52, .18);
  --atlas-scrim: rgba(250, 245, 234, .88);
  --atlas-seal: #A8321F;
  --r-company: #8E4F2A;
  --r-lab: #3A4656;
  --r-model: #2D6B57;
  --r-benchmark: #2C5A78;
  --r-job: #7E5E12;
  --r-resource: #7D3550;
  --r-news: #A8321F;
}
/* 夜·烛照 */
html[data-theme="night"] {
  --atlas-paper: #121110;
  --atlas-surface: #1C1A17;
  --atlas-ink: #F0E7D7;
  --atlas-ink-2: #D3C6B1;
  --atlas-ink-3: #A99B86;
  --atlas-line: rgba(240, 231, 215, .14);
  --atlas-scrim: rgba(18, 17, 16, .88);
  --atlas-seal: #E2705A;
  --r-company: #DE9C70;
  --r-lab: #AEBBD0;
  --r-model: #7CC2A6;
  --r-benchmark: #86B6D6;
  --r-job: #DDB75E;
  --r-resource: #D898B6;
  --r-news: #E2705A;
}

[data-region="company"] { --rc: var(--r-company); }
[data-region="lab"] { --rc: var(--r-lab); }
[data-region="model"] { --rc: var(--r-model); }
[data-region="benchmark"] { --rc: var(--r-benchmark); }
[data-region="job"] { --rc: var(--r-job); }
[data-region="resource"] { --rc: var(--r-resource); }
[data-region="news"] { --rc: var(--r-news); }

body.is-atlas { overflow: hidden; overscroll-behavior: none; }
body.is-atlas .site-header { background: color-mix(in srgb, var(--atlas-paper) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.atlas-root {
  position: relative;
  height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h));
  min-height: 380px;
  background: var(--atlas-paper);
  color: var(--atlas-ink);
  overflow: hidden;
  isolation: isolate;
  font-family: var(--f-kai);
}
.atlas-root * { box-sizing: border-box; }

.atlas2d-stage { position: absolute; inset: 0; }
.atlas2d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atlas2d-stage canvas.grabbing { cursor: grabbing; }
.atlas-fallback .atlas2d-stage canvas { touch-action: pan-y; }

/* ---------- 标签层 ---------- */
.atlas-label-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.atlas-label {
  position: absolute; left: 0; top: 0;
  padding: 0 2px;
  font: 500 12.5px/1.25 var(--f-kai);
  letter-spacing: .05em;
  color: var(--atlas-ink);
  white-space: nowrap;
  will-change: transform, opacity;
  transition: opacity .15s cubic-bezier(.16, 1, .3, 1), color .15s;
  /* 地图式字晕：不垫底框，靠一圈纸色光晕从画面里托出来 */
  text-shadow: 0 0 2px var(--atlas-paper), 0 0 5px var(--atlas-paper), 0 0 10px color-mix(in srgb, var(--atlas-paper) 70%, transparent);
}
.atlas-label[data-region] { color: color-mix(in srgb, var(--rc) 70%, var(--atlas-ink)); }
.atlas-label.on {
  font-size: 14px; font-weight: 700;
  color: var(--atlas-ink);
  z-index: 2;
}
/* 七岛题名：马善政大字 + 小字副题，浮在各岛峰顶之上 */
.atlas-isle {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  display: grid; justify-items: center; gap: 2px;
  transform-origin: 50% 100%;
  transition: opacity .6s cubic-bezier(.16, 1, .3, 1);
  will-change: transform, opacity;
}
.atlas-isle b {
  font: 400 30px/1 var(--f-brush, 'MaShanZheng', serif); letter-spacing: .12em;
  color: var(--atlas-ink);
  text-shadow: 0 0 3px var(--atlas-paper), 0 0 10px var(--atlas-paper), 0 0 22px color-mix(in srgb, var(--atlas-paper) 70%, transparent);
}
.atlas-isle i {
  font: 400 12px/1 var(--f-kai); font-style: normal; letter-spacing: .32em;
  color: color-mix(in srgb, var(--rc, #7a5b3a) 75%, var(--atlas-ink));
  text-shadow: 0 0 3px var(--atlas-paper), 0 0 8px var(--atlas-paper);
}

/* ---------- HUD：分区 ---------- */
.atlas-hud { position: absolute; left: 16px; right: 16px; top: 12px; z-index: 6; display: flex; gap: 8px; pointer-events: none; }
.atlas-chips { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.atlas-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 8px; white-space: nowrap; flex: 0 0 auto;
  border: 1px solid var(--atlas-line);
  border-radius: 999px;
  background: var(--atlas-scrim);
  color: var(--atlas-ink-3);
  font: 13px/1 var(--f-brush);
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s, transform .1s;
  animation: atlas-rise .7s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(.9s + var(--i, 0) * 50ms);
}
.atlas-chip:hover { color: var(--atlas-ink); border-color: color-mix(in srgb, var(--rc, var(--atlas-ink)) 46%, var(--atlas-line)); transform: translateY(-1px); }
.atlas-chip:active { transform: scale(.97); }
.atlas-chip[data-region="all"] { color: var(--atlas-ink); font-weight: 400; }
.atlas-chip[data-region]:not([data-region="all"]) { --rc: var(--atlas-ink-3); }
.atlas-chip[data-region="company"] { --rc: var(--r-company); }
.atlas-chip[data-region="lab"] { --rc: var(--r-lab); }
.atlas-chip[data-region="model"] { --rc: var(--r-model); }
.atlas-chip[data-region="benchmark"] { --rc: var(--r-benchmark); }
.atlas-chip[data-region="job"] { --rc: var(--r-job); }
.atlas-chip[data-region="resource"] { --rc: var(--r-resource); }
.atlas-chip[data-region="news"] { --rc: var(--r-news); }
.atlas-chip.active { color: var(--rc, var(--atlas-ink)); border-color: color-mix(in srgb, var(--rc, var(--atlas-ink)) 52%, transparent); background: color-mix(in srgb, var(--atlas-paper) 92%, var(--rc, var(--atlas-ink)) 8%); }
.atlas-chip span:last-child { font: 10.5px/1 var(--f-sans); opacity: .62; }
.atlas-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 22%, transparent); }
.atlas-chip:not(.active) .atlas-chip-dot { opacity: .35; }

/* ---------- 工具 ---------- */
.atlas-tools { position: absolute; right: 16px; bottom: 18px; z-index: 7; display: flex; flex-direction: column; gap: 6px; }
.atlas-tool {
  width: 34px; height: 34px; border-radius: 3px;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-scrim);
  color: var(--atlas-ink-2);
  font: 14px/1 var(--f-kai);
  cursor: pointer;
  display: grid; place-items: center;
  transition: color .12s, border-color .12s, transform .1s;
}
.atlas-tool:hover { color: var(--atlas-ink); border-color: color-mix(in srgb, var(--atlas-ink) 36%, var(--atlas-line)); }
.atlas-tool:active { transform: scale(.94); }
.atlas-tool[aria-pressed="true"], .atlas-tool.on { color: var(--atlas-seal); border-color: color-mix(in srgb, var(--atlas-seal) 50%, transparent); }

/* ---------- 罗盘 / 小地图 ---------- */
.atlas-compass { position: absolute; right: 22px; top: 58px; z-index: 5; width: 44px; height: 44px; cursor: pointer; color: var(--atlas-ink-3); opacity: .9; transition: opacity .15s; }
.atlas-compass:hover { opacity: 1; }
.atlas-compass svg { width: 100%; height: 100%; transition: transform .18s linear; overflow: visible; }
.atlas-compass circle { fill: none; stroke: currentColor; stroke-width: .8; opacity: .5; }
.atlas-compass .needle { fill: none; stroke: currentColor; stroke-width: .8; }
.atlas-compass .seal { fill: var(--atlas-seal); stroke: none; opacity: .85; }
.atlas-compass text { fill: currentColor; font: 9px var(--f-kai); text-anchor: middle; opacity: .7; }
.atlas-minimap {
  position: absolute; right: 16px; bottom: 286px; z-index: 5;
  width: 148px; height: 148px;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-scrim);
  border-radius: 3px; overflow: hidden;
  cursor: crosshair;
  opacity: .82; transition: opacity .15s;
}
.atlas-minimap:hover { opacity: 1; }
.atlas-minimap canvas { width: 100%; height: 100%; display: block; image-rendering: auto; }
.atlas-root.no-mini .atlas-minimap { display: none !important; }

/* ---------- 悬停卡 ---------- */
.atlas-hover {
  position: absolute; left: 0; top: 0; z-index: 8;
  width: 286px; padding: 10px 12px 8px;
  background: var(--atlas-scrim);
  border: 1px solid var(--atlas-line);
  border-radius: 3px;
  box-shadow: 0 10px 28px rgba(20, 14, 8, .14), 0 1px 0 rgba(255,255,255,.04) inset;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s cubic-bezier(.16,1,.3,1), transform .12s cubic-bezier(.16,1,.3,1);
}
.atlas-hover.on { opacity: 1; }
.atlas-hover .ah-top { display: flex; align-items: center; gap: 9px; }
.atlas-hover .ah-thumb, .atlas-hover .ah-seal { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: contain; background: var(--atlas-paper); border: 1px solid color-mix(in srgb, var(--rc, var(--atlas-seal)) 50%, transparent); }
.atlas-hover .ah-seal { display: grid; place-items: center; font: 15px var(--f-brush); color: var(--atlas-seal); }
.atlas-hover .ah-title { min-width: 0; display: flex; flex-direction: column; }
.atlas-hover .ah-title b { font: 15px/1.25 var(--f-serif); font-weight: 600; color: var(--atlas-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-hover .ah-title i { font: 11px/1.3 var(--f-serif); font-style: normal; color: var(--atlas-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-hover .ah-type { margin-left: auto; flex: none; font: 11px var(--f-kai); color: var(--rc); padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); border-radius: 2px; }
.atlas-hover .ah-one { margin: 8px 0 6px; font: 12.5px/1.6 var(--f-kai); color: var(--atlas-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.atlas-hover .ah-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.atlas-hover .ah-facts span { font: 11px/1.4 var(--f-kai); color: var(--atlas-ink-2); background: color-mix(in srgb, var(--atlas-ink) 6%, transparent); padding: 1px 6px; border-radius: 2px; }
.atlas-hover .ah-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px dotted var(--atlas-line); font: 10.5px var(--f-sans); color: var(--atlas-ink-3); letter-spacing: .02em; }

/* ---------- 钉选 ---------- */
.atlas-pins { position: absolute; left: 16px; bottom: 18px; z-index: 7; display: flex; flex-direction: column; gap: 6px; }
.atlas-pin {
  display: flex; align-items: center; gap: 8px;
  max-width: 260px; padding: 4px 8px 4px 4px;
  border: 1px solid var(--atlas-line); border-radius: 3px;
  background: var(--atlas-scrim); color: var(--atlas-ink);
  cursor: pointer; text-align: left;
  animation: atlas-rise .45s cubic-bezier(.16,1,.3,1) both;
}
.atlas-pin > span { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--rc, var(--atlas-seal)) 55%, transparent); color: var(--atlas-seal); font: 11px var(--f-brush); }
.atlas-pin i { font: 12px/1.2 var(--f-kai); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-pin em { font-style: normal; color: var(--atlas-ink-3); margin-left: 2px; font-size: 13px; }
.atlas-pin:hover em { color: var(--atlas-seal); }

/* ---------- 详情侧栏 ---------- */
.atlas-dossier {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 9;
  width: 372px; max-width: 92vw;
  background: var(--atlas-scrim);
  border-left: 1px solid var(--atlas-line);
  box-shadow: -14px 0 36px rgba(20, 14, 8, .10);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 20px 24px;
  animation: atlas-slide-in .42s cubic-bezier(.16,1,.3,1) both;
}
.atlas-dossier[hidden] { display: none; }
.atlas-dossier .ds-head { display: flex; gap: 12px; align-items: center; position: relative; }
.atlas-dossier .ds-thumb, .atlas-dossier .ds-seal { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: contain; background: var(--atlas-paper); border: 1px solid color-mix(in srgb, var(--rc, var(--atlas-seal)) 48%, transparent); }
.atlas-dossier .ds-seal { display: grid; place-items: center; font: 20px var(--f-brush); color: var(--atlas-seal); }
.atlas-dossier h3 { margin: 0; font: 21px/1.2 var(--f-serif); font-weight: 600; color: var(--atlas-ink); }
.atlas-dossier .ds-head i { display: block; font: 11.5px/1.4 var(--f-serif); font-style: normal; color: var(--atlas-ink-3); }
.atlas-dossier .ds-type { display: inline-block; margin-top: 3px; font: 11px var(--f-kai); color: var(--rc); letter-spacing: .06em; }
.atlas-dossier .ds-close { position: absolute; right: -4px; top: -4px; border: none; background: none; color: var(--atlas-ink-3); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.atlas-dossier .ds-verdict { margin: 14px 0 12px; font: 14.5px/1.95 var(--f-kai); color: var(--atlas-ink); text-align: justify; }
.atlas-dossier .ds-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 14px; }
.atlas-dossier .ds-facts div { display: inline-flex; }
.atlas-dossier .ds-facts dd { margin: 0; font: 11.5px/1.5 var(--f-kai); color: var(--atlas-ink-2); padding: 2px 7px; background: color-mix(in srgb, var(--atlas-ink) 5%, transparent); border-radius: 2px; }
.atlas-dossier .ds-rel h4 { margin: 12px 0 6px; font: 12px var(--f-kai); color: var(--atlas-ink-3); letter-spacing: .1em; display: flex; align-items: center; gap: 8px; }
.atlas-dossier .ds-rel h4::after { content: ""; flex: 1; height: 1px; background: var(--atlas-line); }
.atlas-dossier .ds-rel h4 span { font: 10.5px var(--f-sans); opacity: .7; }
.atlas-dossier .ds-relrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 6px; border: none; border-radius: 2px; background: transparent; color: var(--atlas-ink-2); font: 13px var(--f-kai); text-align: left; cursor: pointer; }
.atlas-dossier .ds-relrow:hover, .atlas-dossier .ds-relrow:focus-visible { background: color-mix(in srgb, var(--atlas-ink) 6%, transparent); color: var(--atlas-ink); outline: none; }
.atlas-dossier .ds-more { font: 11px var(--f-sans); color: var(--atlas-ink-3); padding-left: 14px; }
.atlas-dossier .ds-empty { color: var(--atlas-ink-3); font-size: 12.5px; }
.atlas-dossier .ds-acts { display: flex; gap: 8px; margin-top: 18px; position: sticky; bottom: -24px; padding: 10px 0 12px; margin-bottom: -12px; background: linear-gradient(to top, var(--atlas-scrim) 70%, transparent); }
.atlas-dossier .ds-open { flex: 1; display: flex; justify-content: space-between; align-items: center; height: 38px; padding: 0 14px; background: var(--atlas-ink); color: var(--atlas-paper); text-decoration: none; font: 14px var(--f-kai); letter-spacing: .1em; border-radius: 2px; }
.atlas-dossier .ds-open:hover { background: var(--atlas-seal); }
.atlas-dossier .ds-pin { height: 38px; padding: 0 12px; border: 1px solid var(--atlas-line); background: transparent; color: var(--atlas-ink-2); font: 13px var(--f-kai); border-radius: 2px; cursor: pointer; }
.atlas-dossier .ds-pin[aria-pressed="true"] { color: var(--atlas-seal); border-color: color-mix(in srgb, var(--atlas-seal) 50%, transparent); }
.atlas-dossier kbd { font: 9.5px var(--f-sans); border: 1px solid var(--atlas-line); border-radius: 2px; padding: 0 4px; margin-left: 3px; opacity: .7; }
.ds-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rc, var(--atlas-ink-3)); flex: none; }

/* ---------- 面包屑 / 题卡 ---------- */
.atlas-crumb { position: absolute; left: 16px; top: 52px; z-index: 5; display: flex; align-items: center; gap: 6px; font: 12px var(--f-kai); color: var(--atlas-ink-3); }
.atlas-crumb button { border: none; background: none; color: var(--atlas-ink-3); font: inherit; cursor: pointer; padding: 2px 0; }
.atlas-crumb button:hover { color: var(--atlas-ink); }
.atlas-crumb b { color: var(--atlas-ink); font-weight: 400; }
.atlas-regioncard {
  position: absolute; left: 16px; top: 78px; z-index: 6;
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 14px 9px;
  background: var(--atlas-scrim);
  border-left: 2px solid var(--rc, var(--atlas-seal));
  box-shadow: 0 8px 22px rgba(20, 14, 8, .08);
  animation: atlas-slide-x .6s cubic-bezier(.16,1,.3,1) both;
}
.atlas-regioncard[hidden] { display: none; }
.atlas-regioncard b { font: 20px var(--f-brush); color: var(--rc); letter-spacing: .08em; }
.atlas-regioncard span { font: 12px var(--f-kai); color: var(--atlas-ink-3); }
.atlas-regioncard em { font: 10px var(--f-kai); font-style: normal; color: var(--atlas-seal); border: 1px solid color-mix(in srgb, var(--atlas-seal) 44%, transparent); padding: 0 4px; }

/* ---------- 图内搜索 ---------- */
.atlas-search { position: absolute; left: 50%; top: 54px; transform: translateX(-50%); z-index: 11; width: min(480px, calc(100% - 32px)); }
.atlas-search[hidden] { display: none; }
.atlas-search-box { display: flex; align-items: center; gap: 9px; padding: 0 12px; height: 42px; background: var(--atlas-surface); border: 1px solid var(--atlas-line); border-radius: 3px; box-shadow: 0 14px 40px rgba(20,14,8,.16); color: var(--atlas-ink-3); }
.atlas-search-box:focus-within { border-color: color-mix(in srgb, var(--atlas-seal) 45%, var(--atlas-line)); }
.atlas-search input { flex: 1; border: none; outline: none; background: none; color: var(--atlas-ink); font: 14px var(--f-kai); }
.atlas-search input::placeholder { color: var(--atlas-ink-3); }
.atlas-kbd { font: 10px var(--f-sans); border: 1px solid var(--atlas-line); border-radius: 2px; padding: 1px 5px; color: var(--atlas-ink-3); }
.atlas-search-list { margin-top: 6px; background: var(--atlas-surface); border: 1px solid var(--atlas-line); border-radius: 3px; box-shadow: 0 14px 40px rgba(20,14,8,.16); max-height: 46vh; overflow-y: auto; }
.asl-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 12px; border: none; background: transparent; color: var(--atlas-ink); font: 13.5px var(--f-kai); text-align: left; cursor: pointer; }
.asl-row.on, .asl-row:hover { background: color-mix(in srgb, var(--atlas-ink) 6%, transparent); }
.asl-sub { margin-left: auto; font: 11px var(--f-serif); color: var(--atlas-ink-3); }
.asl-empty { padding: 12px; font: 12.5px var(--f-kai); color: var(--atlas-ink-3); }

/* ---------- 名录 ---------- */
.atlas-guide {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 12;
  width: 300px; max-width: 86vw;
  background: var(--atlas-scrim);
  border-right: 1px solid var(--atlas-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  animation: atlas-slide-left .4s cubic-bezier(.16,1,.3,1) both;
}
.atlas-guide[hidden] { display: none; }
.atlas-guide header { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid var(--atlas-line); }
.atlas-guide header b { font: 16px var(--f-brush); letter-spacing: .12em; color: var(--atlas-ink); }
.atlas-guide header span { font: 10.5px var(--f-kai); color: var(--atlas-ink-3); }
.atlas-guide header button { margin-left: auto; border: none; background: none; color: var(--atlas-ink-3); font-size: 18px; cursor: pointer; }
.atlas-guide-list { flex: 1; overflow-y: auto; padding: 8px 10px 22px; }
.atlas-guide section h4 { display: flex; align-items: center; gap: 7px; margin: 12px 4px 4px; font: 12px var(--f-kai); color: var(--rc); letter-spacing: .1em; }
.atlas-guide section h4 em { font: 10px var(--f-sans); font-style: normal; color: var(--atlas-ink-3); margin-left: auto; }
.atlas-guide ul { list-style: none; margin: 0; padding: 0; }
.atlas-guide li button { width: 100%; text-align: left; border: none; background: none; color: var(--atlas-ink-2); font: 12.5px/2.2 var(--f-kai); padding: 0 6px; border-radius: 2px; cursor: pointer; }
.atlas-guide li button:hover, .atlas-guide li button:focus-visible { background: color-mix(in srgb, var(--atlas-ink) 7%, transparent); color: var(--atlas-ink); outline: none; }

/* ---------- 帮助 ---------- */
.atlas-help { position: absolute; inset: 0; z-index: 14; background: color-mix(in srgb, var(--atlas-ink) 22%, transparent); display: grid; place-items: center; backdrop-filter: blur(2px); }
.atlas-help[hidden] { display: none; }
.atlas-help-card { width: min(460px, calc(100% - 32px)); max-height: 84%; overflow-y: auto; background: var(--atlas-surface); border: 1px solid var(--atlas-line); padding: 18px 22px 20px; box-shadow: 0 24px 60px rgba(20,14,8,.22); animation: atlas-rise .4s cubic-bezier(.16,1,.3,1) both; }
.atlas-help-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.atlas-help-card b { font: 18px var(--f-brush); letter-spacing: .14em; }
.atlas-help-card button { border: none; background: none; font-size: 20px; color: var(--atlas-ink-3); cursor: pointer; }
.atlas-help-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.atlas-help-card dt { font: 12px var(--f-sans); color: var(--atlas-seal); white-space: nowrap; }
.atlas-help-card dd { margin: 0; font: 12.5px/1.6 var(--f-kai); color: var(--atlas-ink-2); }
.atlas-help-card p { margin: 12px 0 0; font: 12px var(--f-kai); color: var(--atlas-ink-3); }

/* ---------- 开场 / 载入 / 播报 ---------- */
.atlas-intro { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--atlas-paper); pointer-events: none; animation: atlas-intro-out 1s cubic-bezier(.7,0,.84,0) 1.1s forwards; }
.atlas-intro-card { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.atlas-intro .atlas-seal { width: 52px; height: 52px; display: grid; place-items: center; background: var(--atlas-seal); color: var(--atlas-paper); font: 17px/1.1 var(--f-brush); letter-spacing: .04em; animation: atlas-seal-drop .5s cubic-bezier(.34,1.56,.64,1) both; }
.atlas-intro b { font: 38px var(--f-brush); letter-spacing: .3em; color: var(--atlas-ink); animation: atlas-fade-up .7s cubic-bezier(.16,1,.3,1) .2s both; }
.atlas-intro i { width: 120px; height: 1px; background: var(--atlas-ink); opacity: .35; animation: atlas-grow-x .8s cubic-bezier(.16,1,.3,1) .5s both; }
@keyframes atlas-intro-out { to { opacity: 0; visibility: hidden; } }
@keyframes atlas-seal-drop { from { transform: scale(1.15); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes atlas-fade-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes atlas-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.atlas-boot { position: absolute; inset: 0; z-index: 19; display: grid; place-items: center; background: var(--atlas-paper); transition: opacity .35s ease; }
.atlas-boot[data-done="1"] { opacity: 0; pointer-events: none; }
.atlas-boot-ring { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--atlas-ink) 16%, transparent); border-top-color: var(--atlas-seal); animation: atlas-spin 1.1s linear infinite; }
.atlas-boot em { position: absolute; margin-top: 96px; font: 12.5px var(--f-kai); color: var(--atlas-ink-3); font-style: normal; }
@keyframes atlas-spin { to { transform: rotate(360deg); } }
.atlas-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes atlas-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes atlas-slide-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes atlas-slide-left { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes atlas-slide-x { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .atlas-hud { left: 8px; right: 8px; top: 8px; }
  .atlas-chips { gap: 4px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); }
  .atlas-chips::-webkit-scrollbar { display: none; }
  .atlas-chip { height: 28px; font-size: 12px; padding: 0 9px; white-space: nowrap; }
  .atlas-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: calc(100vw - 20px); }
  .atlas-chips::-webkit-scrollbar { display: none; }
  .atlas-chip span:last-child { display: none; }
  .atlas-chip b { font-weight: 400; }
  .atlas-tools { right: 10px; bottom: 12px; flex-direction: row; flex-wrap: wrap; width: 126px; }
  .atlas-tool { width: 40px; height: 40px; }
  .atlas-minimap { display: none; }
  .atlas-compass { right: 14px; top: 46px; width: 34px; height: 34px; }
  .atlas-crumb { top: 44px; left: 10px; }
  .atlas-regioncard { left: 10px; top: 66px; padding: 6px 10px; }
  .atlas-regioncard b { font-size: 17px; }
  .atlas-pins { left: 10px; bottom: 12px; }
  .atlas-pin { max-width: 180px; }
  .atlas-hover { display: none; }
  .atlas-search { top: 44px; }
  .atlas-dossier {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; max-height: 62svh;
    border-left: none; border-top: 1px solid var(--atlas-line);
    box-shadow: 0 -14px 36px rgba(20,14,8,.14);
    animation: atlas-drawer .42s cubic-bezier(.16,1,.3,1) both;
    padding: 14px 16px 18px;
  }
  @keyframes atlas-drawer { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
  .atlas-dossier .ds-verdict { font-size: 14px; }
  .atlas-guide { width: 84vw; }
  .atlas-help-card { padding: 14px 16px; }
}

/* ---------- 减弱动效：只减弱，不删除 ---------- */
@media (prefers-reduced-motion: reduce) {
  .atlas-chip, .atlas-regioncard, .atlas-help-card, .atlas-pin, .atlas-dossier, .atlas-guide { animation-duration: .2s !important; }
  .atlas-intro { animation: none; display: none; }
  .atlas-label, .atlas-hover { transition-duration: .15s; }
  .atlas-boot-ring { animation-duration: 3s; }
}

/* ---------- 无 WebGL2 的 2D 降级 ---------- */
.atlas-fallback .atlas2d-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; background: var(--atlas-scrim); border: 1px solid var(--atlas-line);
  font: 12px var(--f-kai);
}
.atlas2d-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.atlas2d-chip, .atlas2d-btn { border: 1px solid var(--atlas-line); background: transparent; color: var(--atlas-ink-2); font: 12px var(--f-kai); padding: 4px 8px; border-radius: 2px; cursor: pointer; }
.atlas2d-chip.active { color: var(--atlas-seal); border-color: color-mix(in srgb, var(--atlas-seal) 45%, transparent); }
.atlas2d-actions { display: flex; gap: 4px; }
.atlas2d-stat { margin-left: auto; color: var(--atlas-ink-3); font: 11px var(--f-sans); }
.atlas-fallback .atlas-tip { position: absolute; z-index: 4; background: var(--atlas-surface); border: 1px solid var(--atlas-line); padding: 6px 10px; font: 12px/1.5 var(--f-kai); color: var(--atlas-ink); max-width: 270px; }
.atlas-fallback .atlas-hud, .atlas-fallback .atlas-tools, .atlas-fallback .atlas-pins, .atlas-fallback .atlas-minimap, .atlas-fallback .atlas-compass, .atlas-fallback .atlas-dossier { display: none; }

/* 上下文丢失提示 */
.atlas-root.ctx-lost::after {
  content: "山海图暂时中断，正在重新起笔。";
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 9;
  font: 14px/1.8 var(--f-kai); letter-spacing: .1em;
  color: var(--atlas-ink); background: color-mix(in srgb, var(--atlas-paper) 92%, transparent);
  pointer-events: none;
}

/* iPhone 底部横条与横屏圆角：山海图的按钮与详情卡让出安全区 */
:root { --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.atlas-tools { bottom: calc(18px + var(--sab)); right: calc(16px + var(--sar)); }
.atlas-hud { padding-left: max(12px, var(--sal)); }
@media (max-width: 760px) {
  .atlas-tools { bottom: calc(12px + var(--sab)); right: calc(10px + var(--sar)); }
  .atlas-dossier { padding-bottom: calc(16px + var(--sab)); }
}
