#atlas {
  --atlas-gold: #dec28e;
  --atlas-stroke: var(--line, #39363c);
}

.atlas-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.atlas-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65em;
  min-height: 46px;
  padding: 8px;
  color: #c8c3bf;
  border: 1px solid var(--atlas-stroke);
  border-radius: 3px;
  background: #1a191e;
  cursor: pointer;
  font: inherit;
}

.atlas-tab:hover,
.atlas-tab[aria-selected="true"] {
  border-color: #8c7855;
  color: #f1d6a4;
  background: #2b2623;
}

.atlas-tab-number {
  color: #a99982;
  font: italic .82rem Georgia, "Times New Roman", serif;
}

.atlas-tab[aria-selected="true"] .atlas-tab-number { color: #f1d6a4; }
.atlas-tab-theme { font-size: .89rem; }

.atlas-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--atlas-stroke);
  border-radius: 5px;
  background: #1b1a1f;
}

.atlas-visual {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 285px;
  overflow: hidden;
  isolation: isolate;
}

.atlas-scene {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #f8f4ea;
  background: #16171c;
  font: inherit;
  cursor: zoom-in;
}

.atlas-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.atlas-scene::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, #121217bf);
  content: "";
  pointer-events: none;
}

.atlas-visual-caption,
.atlas-enlarge {
  position: absolute;
  z-index: 1;
  bottom: 15px;
}

.atlas-visual-caption {
  left: 19px;
  font-size: .74rem;
  letter-spacing: .08em;
  text-shadow: 0 1px 5px #000;
}

.atlas-enlarge {
  right: 17px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #e1d2b385;
  border-radius: 50%;
  background: #1a181bc4;
  font-size: 1.2rem;
}

.atlas-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(25px, 3.5vw, 52px);
}

.atlas-chapter-label {
  margin: 0 0 10px;
  color: var(--atlas-gold);
  font-size: .76rem;
  letter-spacing: .14em;
}

.atlas-title {
  margin: 0;
  color: #f3ede3;
  font: 600 clamp(1.7rem, 3.2vw, 2.75rem)/1.22 "Noto Serif SC", "Songti SC", SimSun, serif;
  letter-spacing: .06em;
}

.atlas-description {
  max-width: 32em;
  margin: 14px 0 0;
  color: #c6c0bd;
  font-size: .9rem;
  line-height: 1.85;
}

.atlas-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
  margin: 22px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--atlas-stroke);
}

.atlas-detail { display: flex; align-items: baseline; flex-wrap: wrap; gap: .55em; }
.atlas-detail dt { color: #a7a0a1; font-size: .72rem; }
.atlas-detail dd { margin: 0; color: #eee6d8; font-size: .8rem; }

.atlas-emblem {
  place-items: center;
  background-color: #211f22;
  background-image: radial-gradient(ellipse at 50% 58%, #6c5b3c60, transparent 68%),
    repeating-linear-gradient(0deg, transparent 0 29px, #9d866313 29px 30px),
    repeating-linear-gradient(90deg, transparent 0 29px, #9d866313 29px 30px);
}

.atlas-seal {
  display: grid;
  position: relative;
  width: 128px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #b19a6f99;
  border-radius: 50%;
  box-shadow: 0 0 0 10px #211f2266, 0 0 0 11px #aa946340, 0 0 0 35px #27252833, 0 0 0 36px #aa946322;
}

.atlas-seal::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid #c2a26b66;
  transform: rotate(45deg);
}

.atlas-glyph {
  color: #d3bd90;
  font: 400 3.1rem/1 SimSun, "Songti SC", serif;
}

#atlas :focus-visible { outline: 2px solid #f4d49b; outline-offset: 2px; }
#atlas .atlas-scene:focus-visible { outline-offset: -4px; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .atlas-scene:hover .atlas-image { transform: scale(1.025); }
}

@media (max-width: 760px) {
  .atlas-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .atlas-visual { min-height: 240px; }
  .atlas-tab { gap: .45em; }
  .atlas-details { gap: 1rem; }
}

@media (max-width: 590px) {
  .atlas-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
  .atlas-tab { flex: 1 1 calc(25% - 5px); padding: 7px 2px; }
  .atlas-panel { grid-template-columns: minmax(0, 1fr); }
  .atlas-visual { min-height: 0; aspect-ratio: 2.05; }
  .atlas-seal { width: 88px; }
  .atlas-glyph { font-size: 2.3rem; }
  .atlas-copy { padding: 23px; }
  .atlas-details { margin-top: 16px; }
}
