.atlas {
  color-scheme: dark;
  --atlas-bg: #0b0d14;
  --atlas-panel: #10131c;
  --atlas-border: #31323e;
  --atlas-text: #f8f0e9;
  --atlas-muted: #adb3c1;
  padding: clamp(17px, 2.7vw, 38px);
  color: var(--atlas-text);
  background:
    radial-gradient(ellipse at 6% -20%, #60382b50, transparent 45%),
    radial-gradient(ellipse at 87% 4%, #28375c50, transparent 38%),
    var(--atlas-bg);
  border: 1px solid var(--atlas-border);
  border-radius: 24px;
  font-family: "Inter", "Microsoft YaHei", sans-serif;
}
.atlas *, .atlas *::before, .atlas *::after { box-sizing: border-box; }
.atlas [hidden] { display: none !important; }
.atlas h1, .atlas h2, .atlas h3, .atlas p { margin: 0; }
.atlas button, .atlas input, .atlas select { font: inherit; }
.atlas :is(button, a, input, select, summary):focus-visible { outline: 2px solid var(--atlas-accent); outline-offset: 3px; }
.atlas button { cursor: pointer; }
.atlas button:disabled { opacity: .38; cursor: default; }
.atlas svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.atlas-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; }
.atlas-title h1 { font: 600 clamp(30px, 4.4vw, 60px)/1.12 "Instrument Serif", "Noto Serif SC", "Songti SC", SimSun, serif; letter-spacing: -.04em; }
.atlas-title p { margin-top: 12px; color: var(--atlas-muted); font-size: 13px; letter-spacing: .025em; }
.atlas-button, .atlas select {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 11px; border: 1px solid #3a3e4c; border-radius: 7px;
  background: #1a1e29; color: var(--atlas-text); font-size: 12px;
  white-space: nowrap; text-decoration: none;
}
.atlas-button:not(:disabled):hover, .atlas select:hover { border-color: #8d7d76; background: #292633; color: white; }
.atlas select { justify-content: normal; }
.atlas-directions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 10px; margin-bottom: 16px; }
.atlas-direction {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 9px; min-height: 76px; padding: 12px; text-align: left; color: var(--atlas-text);
  background: #11141d; border: 1px solid var(--atlas-border); border-radius: 9px;
}
.atlas-direction:hover, .atlas-direction[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--direction-color), #30333e 35%);
  background: linear-gradient(120deg, color-mix(in srgb, var(--direction-color) 13%, #11141d), #11141d);
}
.atlas-direction[aria-pressed="true"]::after {
  position: absolute; bottom: -1px; left: 12px; width: 34px; height: 2px;
  background: var(--direction-color); content: ""; box-shadow: 0 0 14px var(--direction-color);
}
.atlas-direction-icon {
  display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px;
  background: color-mix(in srgb,var(--direction-color) 12%,#171921); color: var(--direction-color);
}
.atlas-direction strong { display: block; font-size: 13px; }
.atlas-direction small { display: block; margin-top: 5px; color: var(--atlas-muted); font-size: 10px; line-height: 1.45; }
.atlas-direction-count { align-self: start; color: var(--direction-color); font: 11px/1.5 "IBM Plex Mono", Consolas, monospace; }
.atlas-workspace { overflow: hidden; border: 1px solid var(--atlas-border); border-radius: 12px; background: var(--atlas-panel); }
.atlas-toolbar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--atlas-border); }
.atlas-search { display: flex; align-items: center; gap: 9px; min-width: min(240px,100%); flex: 1 1 245px; border: 1px solid #3a3e4c; border-radius: 7px; padding: 0 9px; color: var(--atlas-muted); background: #0c0f17; }
.atlas-search:focus-within { border-color: var(--atlas-accent); }
.atlas-search input { flex: 1; min-width: 0; width: 100%; min-height: 34px; padding: 6px 0; font-size: 13px; border: 0; background: none; color: var(--atlas-text); }
.atlas-search input:focus-visible { outline: none; }
.atlas-search input::placeholder { color: #a2a9b6; }
.atlas-saved[aria-pressed="true"], .atlas-highlight[aria-pressed="true"] { color: var(--atlas-accent); border-color: var(--atlas-accent); }
.atlas-main { display: grid; grid-template-columns: minmax(0,1fr) minmax(235px, 28%); }
.atlas-stage { min-width: 0; background: #0c0f17; }
.atlas-title-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-maximize { border-color: var(--atlas-accent); }
.atlas-maximize > span:first-child { font-size: 17px; line-height: 1; }
body:has(.atlas-maximized) { overflow: hidden; }
.atlas.atlas-maximized {
  position: fixed; z-index: 1000; inset: 0; display: flex; flex-direction: column;
  overflow: auto; border: 0; border-radius: 0; padding: clamp(10px, 1.4vw, 22px);
}
.atlas-maximized .atlas-title { margin-bottom: 10px; }
.atlas-maximized .atlas-title h1 { font-size: clamp(24px, 3vw, 40px); }
.atlas-maximized .atlas-title p { display: none; }
.atlas-maximized .atlas-directions { margin-bottom: 10px; }
.atlas-maximized .atlas-direction { min-height: 44px; padding: 7px; }
.atlas-maximized .atlas-direction small { display: none; }
.atlas-maximized .atlas-workspace { display: flex; flex-direction: column; flex: 1 0 auto; }
.atlas-maximized .atlas-main { flex: 1; }
.atlas-maximized .atlas-stage { display: flex; flex-direction: column; }
.atlas-maximized .atlas-surface { flex: 1; min-height: 290px; height: auto; }
.atlas-maximized .atlas-sources { margin-top: 8px; }
@media (min-width: 891px) {
  .atlas-maximized .atlas-workspace { flex: 1; min-height: 360px; }
  .atlas-maximized .atlas-main { min-height: 0; grid-template-columns: minmax(0,1fr) clamp(235px,23vw,350px); }
  .atlas-maximized .atlas-stage { min-height: 0; }
  .atlas-maximized .atlas-surface { min-height: 0; }
  .atlas-maximized .atlas-inspector { overflow: auto; }
}
@media (max-width: 890px) {
  .atlas-maximized .atlas-surface { min-height: max(290px, 52dvh); }
}
.atlas-stage-toolbar, .atlas-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px;
}
.atlas-stage-toolbar strong { display: block; font-size: 14px; }
.atlas-stage-toolbar small { display: block; margin-top: 3px; font-size: 11px; color: var(--atlas-muted); }
.atlas-toggle { display: flex; padding: 3px; gap: 3px; border: 1px solid #333746; border-radius: 7px; background: #10131c; }
.atlas-toggle button { padding: 5px 10px; color: var(--atlas-muted); background: transparent; border: 0; border-radius: 4px; font-size: 12px; }
.atlas-toggle button[aria-pressed="true"] { color: var(--atlas-text); background: #2b2e3b; }
.atlas-surface {
  position: relative; isolation: isolate; min-height: 420px; height: min(56vw, 570px); overflow: hidden;
  border-block: 1px solid #2d303c;
  background:
    radial-gradient(ellipse at 70% 35%, #5a365829, transparent 56%),
    radial-gradient(ellipse at 20% 70%, #1b405b48, transparent 67%),
    #080b13;
}
.atlas-surface::before {
  position: absolute; z-index: -1; inset: 0; content: "";
  background: url("atlas-flame.webp") 53% 56% / cover no-repeat;
  mix-blend-mode: screen; opacity: .34; filter: saturate(.75) hue-rotate(-12deg);
  mask-image: radial-gradient(ellipse at 53% 52%,black 13%,#000c 50%,transparent 92%);
}
.atlas-surface::after {
  position: absolute; z-index: -1; inset: 0; content: "";
  background:
    radial-gradient(ellipse at 50% 43%, transparent 42%, #05070d91 98%),
    linear-gradient(#8994b013 1px,transparent 1px),
    linear-gradient(90deg,#8994b013 1px,transparent 1px);
  background-size: auto, 40px 40px,40px 40px;
}
.atlas-surface canvas { display: block; position: absolute; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atlas-zoom { position: absolute; right: 12px; bottom: 13px; display: grid; grid-template-columns: 32px 32px minmax(46px,auto) 32px; gap: 1px; align-items: center; padding: 3px; border: 1px solid #3a3e4c; border-radius: 8px; background: #10131cea; }
.atlas-zoom output { color: var(--atlas-muted); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.atlas-zoom button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 4px; color: var(--atlas-text); background: transparent; font-size: 17px; }
.atlas-zoom button:hover { background: #2b2e3a; }
.atlas-tooltip { position: absolute; z-index: 2; width: max-content; max-width: min(222px,80%); pointer-events: none; background: #191c27; border: 1px solid #51505e; border-radius: 7px; padding: 8px 10px; font-size: 11px; line-height: 1.5; }
.atlas-node-card {
  position: absolute; z-index: 3; width: min(330px, calc(100% - 16px)); max-height: calc(100% - 16px);
  overflow: auto; overscroll-behavior: contain; padding: 13px; border-radius: 9px;
  background: #191c27; border: 1px solid var(--atlas-accent); box-shadow: 0 9px 26px #0009;
}
.atlas-node-card h3 { padding-right: 25px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.atlas-node-meta, .atlas-node-summary { margin-top: 7px !important; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.atlas-node-meta { color: var(--atlas-muted); }
.atlas-node-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; color: var(--atlas-text); border: 0; border-radius: 5px; background: #2b2e3a; font-size: 18px; }
.atlas-node-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.atlas-node-actions .atlas-button { min-height: 29px; padding: 4px 8px; }
.atlas-empty { position: absolute; top: 44%; left: 50%; transform: translate(-50%,-50%); display: grid; gap: 12px; place-items: center; font-size: 13px; text-align: center; }
.atlas-empty button { border: 1px solid #595568; padding: 6px 10px; border-radius: 5px; color: var(--atlas-text); background: #1c1d2a; }
.atlas-legend { justify-content: flex-start; color: var(--atlas-muted); font-size: 11px; }
.atlas-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.atlas-legend i { width: 7px; height: 7px; background: var(--atlas-accent); border-radius: 50%; box-shadow: 0 0 8px #ffc28c66; }
.atlas-legend .atlas-dash, .atlas-legend .atlas-line, .atlas-legend .atlas-shared { width: 17px; height: 0; border-top: 1px dashed #b6a4aa; background: none; box-shadow: none; border-radius: 0; }
.atlas-legend .atlas-line { border-top-style: solid; border-color: #b0d1e9; }
.atlas-legend .atlas-shared { border-color: #75e7c4; }
.atlas-orbit { position: absolute; left: 12px; bottom: 13px; display: flex; align-items: center; gap: 8px; }
.atlas-orbit .atlas-button { min-height: 32px; background: #10131cea; }
.atlas-orbit .atlas-button[aria-pressed="true"] { color: var(--atlas-accent); border-color: var(--atlas-accent); }
.atlas-orbit span { color: #c0bdcb; font-size: 10px; }
.atlas-surface canvas:focus-visible { outline: 2px solid var(--atlas-accent); outline-offset: -2px; }
.atlas-online { padding: 13px 16px; border-bottom: 1px solid var(--atlas-border); background: #151823; }
.atlas-online header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.atlas-online h2 { font-size: 15px; }
.atlas-online p { margin: 5px 0; color: var(--atlas-muted); font-size: 12px; overflow-wrap: anywhere; }
.atlas-online ol { max-height: 320px; overflow: auto; margin: 12px 0; padding-left: 25px; scrollbar-color: #484a58 #11131c; }
.atlas-online li { padding: 7px 8px 7px 2px; font-size: 13px; border-bottom: 1px solid var(--atlas-border); overflow-wrap: anywhere; }
.atlas-online li small { display: block; margin-top: 3px; color: var(--atlas-muted); }
.atlas-online a, .atlas-detail a:not(.atlas-button) { color: #f7c7a6; }
.atlas-search-pages { display: flex; gap: 7px; }
.atlas-legend label { margin-left: auto; }
.atlas-legend select { min-height: 28px; padding: 3px 7px; }
.atlas-inspector { min-width: 0; border-left: 1px solid var(--atlas-border); background: linear-gradient(170deg,#191925,#10131c 22%); }
.atlas-inspector-head, .atlas-results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--atlas-border); }
.atlas-inspector-head h2, .atlas-results-head h2 { font-size: 13px; font-weight: 650; }
.atlas-inspector-head span { color: var(--atlas-accent); display: flex; }
.atlas-detail { padding: 13px; }
.atlas-paper-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.atlas-paper-meta span { padding: 2px 6px; border: 1px solid #3a3c48; border-radius: 4px; color: var(--atlas-accent); font-size: 10px; }
.atlas-detail h3 { font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.atlas-venue, .atlas-provenance { margin-top: 7px !important; font-size: 11px; line-height: 1.45; color: var(--atlas-muted); }
.atlas-detail-actions { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 11px; }
.atlas-detail-actions .atlas-button { min-height: 29px; padding: 4px 6px; font-size: 10px; }
.atlas-detail-actions .atlas-button svg { width: 12px; height: 12px; }
.atlas-primary { background: color-mix(in srgb,var(--atlas-accent) 19%,#181c28); border-color: color-mix(in srgb,var(--atlas-accent) 48%,#343644); }
.atlas-related { font-size: 11px; margin-top: 12px; }
.atlas-abstract { margin-top: 10px; font-size: 11px; color: var(--atlas-muted); }
.atlas-abstract summary { cursor: pointer; }
.atlas-abstract p { line-height: 1.55; margin-top: 5px; max-height: 155px; overflow: auto; overflow-wrap: anywhere; }
.atlas-cross { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; color: var(--atlas-muted); font-size: 10px; }
.atlas-cross button { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #494757; border-radius: 4px; padding: 2px 5px; color: var(--atlas-accent); background: none; }
.atlas-cross button:hover { background: #242432; }
.atlas-cross button svg { width: 10px; height: 10px; }
.atlas-related summary { cursor: pointer; color: var(--atlas-muted); }
.atlas-related button { display: block; width: 100%; color: var(--atlas-text); border: 0; background: transparent; padding: 6px 0; text-align: left; overflow-wrap: anywhere; }
.atlas-related button:hover { color: var(--atlas-accent); }
.atlas-related small { color: var(--atlas-accent); margin-right: 8px; }
.atlas-related-list { max-height: 260px; overflow: auto; scrollbar-color: #484a58 #11131c; }
.atlas-relationship { padding: 5px 0 7px; border-bottom: 1px solid var(--atlas-border); }
.atlas-relationship p, .atlas-relationship details { color: var(--atlas-muted); font-size: 10px; line-height: 1.45; margin: 3px 0; }
.atlas-relationship strong { color: #cfdbef; font-weight: 600; }
.atlas-relationship ul { padding-left: 15px; overflow-wrap: anywhere; }
.atlas-results-head { border-top: 1px solid var(--atlas-border); }
.atlas-results-head span, .atlas-empty-detail { color: var(--atlas-muted); font-size: 11px; }
.atlas-empty-detail { padding: 15px; }
.atlas-results { padding: 5px; height: clamp(215px,29vw,355px); overflow: auto; scrollbar-color: #484a58 #11131c; }
.atlas-result {
  display: grid; grid-template-columns: 8px minmax(0,1fr); gap: 7px; align-items: start; width: 100%;
  padding: 8px 6px; color: var(--atlas-text); background: transparent; border: 1px solid transparent;
  border-bottom-color: #292c37; text-align: left; border-radius: 5px;
}
.atlas-result i { margin-top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--node-color); box-shadow: 0 0 7px var(--node-color); }
.atlas-result strong { display: -webkit-box; font-size: 11px; font-weight: 550; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.atlas-result small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.35; color: var(--atlas-muted); }
.atlas-result:hover, .atlas-result[aria-pressed="true"] { background: #242530; border-color: #4a4859; }
.atlas-more { width: 100%; margin-top: 6px; }
.atlas-sources { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--atlas-muted); }
.atlas-sources summary { cursor: pointer; }
.atlas-sources p { margin-top: 9px; }
.atlas-sources a { color: #f9c7ad; }
@media(max-width: 1210px) {
  .atlas-direction { grid-template-columns: auto minmax(0,1fr); }
  .atlas-direction-count { grid-column: 2; }
}
@media(max-width: 890px) {
  .atlas-main { grid-template-columns: minmax(0,1fr); }
  .atlas-inspector { border-left: 0; border-top: 1px solid var(--atlas-border); }
  .atlas-results { height: 240px; }
  .atlas-directions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width: 520px) {
  .atlas { padding: 12px; border-radius: 14px; }
  .atlas-title { flex-wrap: wrap; align-items: start; }
  .atlas-direction { min-height: 65px; padding: 7px; gap: 5px; }
  .atlas-direction small { display: none; }
  .atlas-direction-count { grid-column: 2; }
  .atlas-surface { min-height: 330px; }
  .atlas-legend label { margin-left: 0; }
  .atlas-orbit span { display: none; }
}
