:root {
  --paper: #f6f0e1;
  --ink: #293129;
  --green: #354c3b;
  --line: #a29a83;
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.6 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a, button { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.atlas { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 42%, #fbf6ea, var(--paper) 63%, #eee7d8); }
.atlas::before { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .32; pointer-events: none; z-index: -1; }
.world { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: manipulation; }
.pins { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pins a { position: absolute; translate: -50% -50%; pointer-events: auto; min-height: 30px; padding: 4px 10px; text-decoration: none; white-space: nowrap; background: #fff9e9f4; border: 1px solid #85806a; border-radius: 4px; font-size: clamp(.79rem, 1.12vw, .94rem); font-weight: 750; box-shadow: 0 2px 8px #40391f27; }
.pins a:hover,.pins a[aria-current] { background: var(--green); color: #fff; }
.atlas:not([data-state="map"]) .pins, .atlas:not([data-state="map"]) .object-access, .atlas:not([data-state="map"]) .hint { visibility: hidden; }
.object-access { position: fixed; left: 12px; bottom: 51px; z-index: 4; }
.object-access button { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.object-access button:focus-visible { position: relative; inline-size: auto; block-size: auto; overflow: visible; clip-path: none; background: #fff9e9; border: 1px solid var(--line); }
.identity, .language, .controls, .hint { position: fixed; z-index: 2; }
.identity { inset: 16px auto auto 16px; display: flex; gap: 8px; align-items: baseline; background: #faf4e6e8; border: 1px solid #aaa18a; border-radius: 4px; padding: 4px 10px; }
.identity strong { font: 800 1.39rem Georgia, "Songti SC", SimSun, serif; }
.identity span { font-size: .85rem; }
.language { inset: 16px 16px auto auto; }
.controls { inset: auto 16px 16px auto; }
.hint { inset: auto auto 16px 16px; margin: 0; max-width: calc(100% - 165px); font-size: .87rem; color: #4b5b4f; pointer-events: none; }
.controls button, .language, .close { background: #fbf6e9; border: 1px solid var(--line); border-radius: 4px; min-height: 40px; padding: 6px 11px; font-size: .9rem; }
.controls button:hover, .language:hover, .close:hover { background: #eae4d2; }
.error { text-align: center; position: absolute; top: 46%; inset-inline: 24px; }
.leaf { position: fixed; inset: auto; left: var(--leaf-x,50%); top: var(--leaf-y,50%); margin: 0; translate: -50% -50%; width: min(460px, calc(100% - 34px)); max-height: calc(100svh - 34px); overflow: auto; border: 1px solid var(--line); border-left: 6px double #a89b79; border-radius: 3px; background: #fbf5e7; color: var(--ink); padding: clamp(19px, 3.8vw, 38px); box-shadow: 0 12px 36px #453a2441; }
.leaf::backdrop { background: #c8bea342; }
.leaf-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #bfb498; padding-bottom: 10px; }
.leaf-name { color: var(--green); font-weight: 800; }
.leaf h1 { margin: 16px 0 0; font: 750 clamp(1.85rem, 4.3vw, 2.9rem)/1.12 Georgia, "Songti SC", SimSun, serif; }
.leaf p { margin: 14px 0 0; }
@media (max-width: 620px) {
  .pins a { min-height: 26px; padding: 3px 6px; }
  .leaf { left: 50%; top: 50%; }
  .identity, .language { top: 11px; }
  .identity, .hint { left: 11px; }
  .language, .controls { right: 11px; }
  .controls, .hint { bottom: 11px; }
}
@media (prefers-reduced-motion: no-preference) {
  .leaf[open] { animation: unfold-leaf .55s cubic-bezier(.24,.67,.27,1) both; transform-origin: left center; }
  @keyframes unfold-leaf { from { transform: perspective(750px) rotateY(-38deg) translateX(-16px); opacity: .08; } to { transform: none; opacity: 1; } }
}
