/* Shared paper, bronze and jade UI. Original artwork and 3D canvases are untouched. */
.site-ux {
  --ux-ink: #263f38;
  --ux-muted: #58675e;
  --ux-paper: #fffdf5;
  --ux-jade: #31564d;
  --ux-bronze: #987540;
  --ux-line: #cbd1c2;
}

.site-ux :is(a, button, summary, select, input, textarea):focus-visible {
  outline: 3px solid #a57d3e;
  outline-offset: 4px;
}

.site-ux .ux-route-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  width: min(100% - 3rem, 1240px);
  margin: 0.5rem auto 1.1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--ux-line);
  color: var(--ux-ink);
  font: 14px/1.45 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.site-ux .ux-route-nav a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.28rem;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  white-space: normal;
}

.site-ux .ux-route-nav a:hover {
  border-color: var(--ux-line);
  background: #e8edde;
}

.site-ux .ux-route-nav a[aria-current='page'] {
  color: var(--ux-jade);
  box-shadow: inset 0 -2px var(--ux-bronze);
}

.site-ux .ux-route-nav .ux-book-entry {
  border-color: #b4c1ae;
  background: #e6ecdf;
  color: #244a3c;
  font-weight: 600;
}

.site-ux .primary-nav.ux-route-nav {
  width: auto;
  margin: 0;
  padding: 0;
  border-bottom: 0;
  gap: 0.15rem;
}

.site-ux .ux-book-navigation {
  position: fixed;
  z-index: 70;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  color: #f8f0d9;
  font: 13px/1.4 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.site-ux .ux-book-navigation > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid #bda56c88;
  border-radius: 0.35rem;
  background: #12343eec;
  list-style: none;
  cursor: pointer;
}

.site-ux .ux-book-navigation > summary::-webkit-details-marker {
  display: none;
}

.site-ux .ux-book-navigation > summary::after {
  content: '+';
  color: #ddc18a;
}

.site-ux .ux-book-navigation[open] > summary::after {
  content: '−';
}

.site-ux .ux-book-navigation > .ux-route-nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  display: grid;
  width: min(19rem, calc(100vw - 2rem));
  max-height: min(65vh, 28rem);
  margin: 0;
  padding: 0.65rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #c0b18e;
  border-radius: 0.45rem;
  background: var(--ux-paper);
  box-shadow: 0 14px 45px #08181d50;
}

.site-ux .ux-book-navigation > .ux-route-nav a {
  justify-content: flex-start;
}

.site-ux .ux-page-end {
  width: min(100% - 3rem, 1240px);
  margin: 1rem auto 0;
  padding: 0 0 5.5rem;
  text-align: right;
}

.site-ux .ux-page-end button {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ux-line);
  border-radius: 0.3rem;
  background: var(--ux-paper);
  color: var(--ux-jade);
  cursor: pointer;
}

/* The home keeps its illustrated journey; the book now has a direct, primary entrance. */
.site-ux[data-section] {
  color: var(--ux-ink);
  --ink: #263f38;
  --muted: #53695e;
  --line: #bcc9b766;
  --accent: #95733c;
  --detail-muted: #53675f;
  background: radial-gradient(ellipse at 90% 12%, #dcebe5 0, transparent 57%), linear-gradient(145deg, #faf6e8, #eef2e8 70%, #e8f0ec);
}

.site-ux[data-section] .topbar {
  gap: 0.6rem;
  padding-block: 1rem 0.3rem;
}

.site-ux[data-section] .topbar nav {
  max-height: min(70vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-color: #becab9;
  background: #fffdf7;
  color: #29453b;
  box-shadow: 0 12px 36px #193f3429;
}

.site-ux[data-section] .topbar nav a {
  min-height: 44px;
}

.site-ux[data-section] main {
  padding-top: 0.4rem;
}

.site-ux .ux-reading-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.6rem);
  margin: 1.2rem 0 1.7rem;
  border: 1px solid #bfcaaf;
  border-left: 3px solid #a28346;
  border-radius: 0.3rem 0.7rem 0.7rem 0.3rem;
  background: linear-gradient(110deg, #fffbeeef, #f4f6eae8);
  box-shadow: 0 6px 18px #46623e08;
}

.site-ux .ux-reading-entry > div {
  flex: 1 1 17rem;
  min-width: 0;
}

.site-ux .ux-reading-entry strong {
  display: block;
  color: #294b3c;
  font: 500 clamp(18px, 2vw, 23px)/1.5 Georgia, 'Microsoft YaHei', serif;
}

.site-ux .ux-reading-entry span {
  display: block;
  margin-top: 0.35rem;
  color: #546a5b;
  font-size: 13px;
}

.site-ux .ux-open-book {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border: 1px solid #315849;
  border-radius: 0.3rem;
  color: #fff9e9;
  background: #315849;
  font: 600 15px/1.5 'Segoe UI', 'Microsoft YaHei', sans-serif;
  text-decoration: none;
}

.site-ux[data-section] .home-intro {
  padding-bottom: 1.2rem;
}

.site-ux[data-section] #main .element-portal {
  border-color: #c4cbb8;
  background: linear-gradient(145deg, #fffdf6dc, #eef3e7dd);
  box-shadow: inset 0 1px #fff, 0 8px 26px #3e614915;
}

.site-ux[data-section] #main .element-portal :is(h2, .translated, p) {
  color: #304f45;
}

.site-ux[data-section] .about-card {
  background: #fffaf0;
  color: #2d473b;
}

.site-ux .hall-model {
  --muted: #56665e;
}

.site-ux .hall-heading,
.site-ux #hall-budget,
.site-ux .hall-model figcaption {
  font-size: max(12px, 0.75rem);
}

.site-ux .hall-view-tabs button,
.site-ux .hall-controls button,
.site-ux #hall-status {
  font-size: max(13px, 0.8rem);
}

@media (max-width: 600px) {
  .site-ux .ux-route-nav {
    width: calc(100% - 2rem);
    gap: 0.25rem;
  }
  .site-ux .ux-route-nav a {
    flex: 1 1 6.5rem;
    padding-inline: 0.55rem;
    text-align: center;
  }
  .site-ux[data-section] .topbar {
    padding-inline: 1rem;
  }
  .site-ux[data-section] main {
    padding-inline: 1rem;
  }
  .site-ux .ux-reading-entry {
    padding: 1.1rem;
  }
  .site-ux .ux-open-book {
    width: 100%;
    justify-content: center;
  }
  .site-ux .ux-page-end {
    width: calc(100% - 2rem);
    padding-bottom: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-ux .ux-route-nav *,
  .site-ux .ux-reading-entry * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
