/* The same symbols identify destinations on the campus, in menus and at the bench. */
.ui-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* Arrival pairs the east campus street plan with the two playable modes. */
#intro { background: #051523d9; }
.intro-card {
  display: grid;
  grid-template-columns: .93fr 1.07fr;
  width: min(960px, calc(100% - 48px));
  max-height: calc(100dvh - 56px);
  padding: 0;
  border: 1px solid #8296a1;
  border-radius: 16px;
  background: #faf8f2;
  box-shadow: 0 24px 85px #020f1f80;
  scrollbar-width: thin;
}
.arrival-cover {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 28px 20px;
  background-color: #103854;
  color: #f4f0e6;
}
.arrival-place, .arrival-map-credit { display: flex; align-items: center; gap: 8px; }
.arrival-place { font-size: 14px; color: #ead3a4; }
.arrival-place { gap: 14px; }
.loader-logo, .title-mark, .rail-brand img, .arrival-place img {
  display: block;
  flex: none;
  color-scheme: dark;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.loader-logo { width: 84px; height: 84px; }
.title-mark { width: 46px; height: 46px; padding: 3px; border-radius: 7px; background: #133a55; }
.arrival-name { margin: 18px 0; }
.intro-card .arrival-name p {
  margin: 0 0 2px;
  color: #cfdee5;
  font-size: 17px;
  letter-spacing: .16em;
}
.arrival-name h1 {
  margin: 0;
  font: 600 clamp(32px, 3.1vw, 48px)/1.35 "STSong", "SimSun", "Songti SC", serif;
  letter-spacing: .03em;
}
.arrival-map {
  flex: 1;
  min-height: 200px;
  margin-inline: -28px;
  background: center / cover no-repeat url("../assets/ui/zijingang-map.webp");
  border-block: 1px solid #7696a44d;
}
.arrival-map-credit {
  justify-content: space-between;
  margin-top: 15px;
  font-size: 12px;
  color: #d9e4e9;
}
.arrival-map-credit a { color: #d0dfe8; text-underline-offset: 3px; }
.arrival-controls { min-width: 0; padding: clamp(24px, 3vw, 44px); }
.arrival-controls h2 { margin: 0 0 8px; font-size: clamp(24px, 2vw, 31px); letter-spacing: .015em; }
#arrival-choice:focus { outline: none; }
.intro-card .arrival-controls > p { line-height: 1.75; }
.intro-mode-choice { grid-template-columns: 1fr; gap: 10px; margin: 22px 0 16px; }
.intro-mode, .intro-mode:hover, .intro-mode.selected {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr 16px;
  gap: 3px 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid #cbd2d1;
  border-radius: 10px;
  background: #fffefa;
  color: #19334a;
  box-shadow: none;
}
.intro-mode:hover { border-color: #6286a3; background: #f6f8f8; }
.intro-mode.selected { border-color: #195990; background: #eaf1f7; box-shadow: inset 0 0 0 1px #195990; }
.intro-mode .ui-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  padding: 7px;
  background: #edf0ee;
  border-radius: 9px;
  color: #36546c;
}
.intro-mode.selected .ui-icon { background: #d7e5f1; color: #003f88; }
.intro-mode b { grid-column: 2; margin: 0; font-size: 17px; }
.intro-mode span { grid-column: 2; color: #435c6c; font-size: 14px; line-height: 1.6; }
.intro-mode::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 18px;
  width: 13px;
  height: 13px;
  border: 1px solid #8e9fac;
  border-radius: 50%;
}
.intro-mode.selected::after { background: #0b4c85; border-color: #0b4c85; box-shadow: inset 0 0 0 3px #eaf1f7; }
.intro-card #intro-go { min-height: 46px; margin: 0; font-size: 16px; }
#intro-go::after { content: "→"; margin-left: 12px; }
#intro-resume { width: 100%; margin-top: 8px; color: #193e5b; background: transparent; border: 1px solid #a5b8c5; }
#intro-resume[hidden] { display: none; }
.arrival-keys { margin-top: 16px; border-bottom: 1px solid #d4d9d7; color: #3a5469; }
.arrival-keys summary { padding: 8px 0 12px; cursor: pointer; font-size: 14px; }
.arrival-keys .intro-keys { gap: 10px 14px; margin: 4px 0 16px; font-size: 13px; }
.arrival-keys kbd { margin-right: 4px; font-size: 12px; }

.arrival-controls > .guide-entry, #panel .guide-entry {
  display: block; min-height: 42px; margin: 10px 0 0; padding: 7px 2px;
  border: 0; background: transparent; color: #195990; font: inherit; font-size: 15px;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
#panel .guide-entry { margin: 0 0 10px; }
#campus-guide {
  box-sizing: border-box; width: min(510px, calc(100% - 24px)); max-height: min(680px, calc(100dvh - 32px));
  margin: auto; padding: 0; border: 1px solid #91a0aa; border-radius: 14px;
  color: #19334a; background: #faf8f2; box-shadow: 0 20px 70px #05132066;
}
#campus-guide[open] { display: flex; flex-direction: column; overflow: hidden; }
#campus-guide::backdrop { background: #091c2da6; }
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 14px 22px; background: #103854; color: #fffdf6; }
.guide-head h2 { margin: 0; font-size: 22px; line-height: 1.4; }
.guide-head button { min-height: 40px; padding: 0 12px; border: 1px solid #aabcca; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.guide-body { overflow-y: auto; padding: 19px 22px 16px; overscroll-behavior: contain; }
.guide-body h3 { margin: 0 0 10px; color: #103854; font-size: 17px; }
.guide-body details { border-top: 1px solid #c4d0d1; }
.guide-body summary { padding: 12px 0; color: #195274; cursor: pointer; font-size: 15px; font-weight: 650; }
.guide-rows { display: grid; grid-template-columns: minmax(58px, auto) 1fr; align-items: baseline; gap: 8px 14px; margin: 0 0 15px; font-size: 14px; line-height: 1.65; }
.guide-rows dt { color: #244761; font-weight: 650; }
.guide-rows dd { margin: 0; }
.guide-rows kbd { padding: 0 4px; min-width: 0; border: 1px solid #b7c7ce; border-radius: 4px; background: #ecf0ef; color: #15354c; font-size: 12px; }
#campus-guide :focus-visible, .guide-entry:focus-visible { outline: 2px solid #3281b3; outline-offset: 2px; }
#campus-guide-title:focus { outline: none; }
@media (max-width: 450px) {
  .guide-body { padding: 16px; }
  .guide-head { padding: 10px 16px; }
  .guide-rows { grid-template-columns: 64px 1fr; gap: 8px 10px; }
}
#loader { background: radial-gradient(ellipse at 50% 30%, #173e5d, #091e32 75%); }
.loader-inner { width: min(340px, 84vw); }
.loader-status { font-size: 14px; }

/* Menus */
#panel { grid-template-columns: 198px minmax(0, 1fr); grid-template-rows: 95px minmax(0, 1fr); background: #f8f6ef; }
.menu-rail { background: linear-gradient(155deg, #003f88, #0b3159 68%); }
.rail-brand { font-family: Georgia, "SimSun", serif; }
.rail-brand > span { font: 600 12px/1.45 "Segoe UI", sans-serif; letter-spacing: .12em; }
.menu-rail > button { gap: 11px; }
.menu-rail > button > span, .menu-rail > button.selected > span { color: inherit; font-size: 14px; font-weight: 600; }
.menu-rail > button .ui-icon { width: 19px; height: 19px; }
.menu-rail > button.selected { background: #fff9eb; box-shadow: inset 3px 0 0 #d8b26a; }
.rail-footer { font-size: 13px; }
.panel-head { border-bottom-color: #b8c5ca; }
.panel-head h2 { margin: 0; font-size: 28px; }
#panel-toggle { width: 40px; height: 40px; }
.panel-scroll { min-width: 0; scrollbar-gutter: stable; }
#panel .grp > h2 { font-size: 16px; color: #344f65; }
#panel .hint, #panel .field > span, #panel .form i { font-size: 14px; color: #506675; }
#panel .grp > h2:not(:first-child) { margin-top: 24px; }
#panel .btn, #panel .btn.ghost, #panel select { font-size: 14px; }
#panel .btn:not(.lab-entry) { min-height: 40px; }
#panel .lab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; gap: 12px; }
#panel .lab-entry {
  align-content: start;
  gap: 6px;
  padding: 17px 15px;
  min-height: 154px;
  background: #fffefa;
  border: 1px solid #c7d2d7;
  border-radius: 10px;
}
#panel .lab-entry::after { content: "↗"; position: absolute; top: 14px; right: 14px; color: #607987; }
#panel .lab-entry .ui-icon { width: 34px; height: 34px; padding: 6px; border-radius: 7px; background: #e7eff4; color: #16557c; }
#panel .lab-entry b { font-size: 18px; }
#panel .lab-entry span { color: #506675; font-size: 14px; line-height: 1.55; }
#panel .lab-entry:hover { border-color: #6086a1; background: #f4f8fa; }
#panel .lab-entry:first-child { border-color: #a5bdd0; background: #ecf3f8; }
#panel .lab-entry:first-child .ui-icon { background: #124f80; color: #fff6df; }
#main-nav button { min-height: 40px; }
#main-nav svg { width: 20px; height: 20px; }
#main-nav button:not(:disabled):hover { color: #fff5dc; }
#player-hud .hud-heading > span, .mm-label { font-size: 12px; }
body .hud-panel-tab { font-size: 13px; }
.lux-head { width: 100%; text-align: left; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--stroke); }
.lux-head .ui-icon { margin-right: 4px; color: #dfc58f; }
.lux-sub { font-size: 13px; }
#lab-panel { top: 94px; right: 24px; width: min(450px, calc(100vw - 32px)); max-height: calc(100dvh - 112px); }
#lab-panel .lab-head { padding: 12px 16px; }
#lab-panel .lab-head h3 { font-size: 17px; }
.lab-modal.on { z-index: 95; }
.lab-close, .ws-x { width: 32px; height: 32px; font-size: 18px; }
.lab-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lab-grid2 .field, .lab-grid2 select { min-width: 0; }
.lab-body .lab-table:not(.lab-scroll) { display: block; overflow-x: auto; }
.lab-body .lab-table:not(.lab-scroll) tbody { display: table; width: 100%; }
.lab-tabs button, .lab-row button { min-height: 34px; }
#embodied-panel { top: 94px; right: 24px; width: min(355px, calc(100vw - 32px)); max-height: calc(100dvh - 112px); }
.ws-head__t { font-size: 16px; }

@media (min-width: 801px) {
  #panel [data-menu-page=lab] .lab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 621px) and (max-width: 800px) {
  #panel { grid-template-columns: 150px minmax(0, 1fr); }
  #panel [data-menu-page=lab] .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .intro-card { display: block; width: min(480px, calc(100% - 20px)); max-height: calc(100dvh - 20px); }
  .arrival-cover { position: relative; isolation: isolate; overflow: hidden; padding: 20px; }
  .arrival-name { margin: 12px 0 0; }
  .arrival-place img { width: 36px; height: 36px; }
  .arrival-name h1 { font-size: 30px; }
  .intro-card .arrival-name p { font-size: 14px; }
  .arrival-map { position: absolute; z-index: -1; inset: 0 0 0 24%; min-height: 0; margin: 0; border: 0; background-position: 55% 40%; mask-image: linear-gradient(90deg, transparent, #000 75%); }
  .arrival-map-credit { justify-content: flex-end; margin-top: 5px; font-size: 11px; }
  .arrival-map-credit span { display: none; }
  .arrival-map-credit a { background: #103854; }
  .arrival-controls { padding: 19px 20px; }
  .intro-mode-choice { margin: 14px 0; }
  .intro-mode, .intro-mode:hover, .intro-mode.selected { padding: 12px; }
}
@media (max-width: 620px) {
  #panel { inset: 8px; transform: none; width: auto; height: auto; grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr); }
  .panel-head { grid-row: 1; padding: 12px 16px; }
  .panel-head h2 { font-size: 22px; }
  .menu-rail { grid-row: 2; flex-direction: row; gap: 2px; padding: 5px; }
  .menu-rail > button { flex: 1; min-width: 0; flex-direction: column; gap: 3px; align-items: center; padding: 7px 1px; }
  .menu-rail > button > span, .menu-rail > button.selected > span { font-size: 12px; text-align: center; }
  .menu-rail > button > span { display: none; }
  .menu-rail > button::after { content: attr(data-short-label); font-size: 13px; }
  .menu-rail > button.selected { box-shadow: inset 0 -2px 0 #d8b26a; }
  .rail-brand, .rail-footer { display: none; }
  .panel-scroll { grid-row: 3; padding: 16px 12px; scrollbar-gutter: auto; }
  #panel [data-menu-page=lab] .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  #panel .lab-entry { min-height: 140px; padding: 12px; }
  #panel .lab-entry b { font-size: 16px; }
  #panel .lab-entry span { font-size: 13px; }
  #panel #help-body li { grid-template-columns: minmax(72px, .5fr) 1fr; gap: 10px; }
  #view-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #mode-row { flex-wrap: wrap; }
  #titlebar { top: 9px; left: 12px; }
  .title-main h1 { max-width: none; }
  .title-mark { width: 34px; height: 34px; font-size: 20px; }
  #main-nav { inset: 51px 10px auto; gap: 1px; padding: 3px; }
  #main-nav button { justify-content: center; flex: 1; padding: 5px 2px; }
  #main-nav #home-time-toggle { min-width: 59px; }
  #objective {
    top: 109px; left: 12px; max-width: calc(100vw - 24px); padding: 7px 38px 7px 10px;
    background: #0c2236e8; border: 1px solid #b5c9da36; border-radius: 9px;
  }
  #objective > .hud-panel-hide { top: 5px; right: 4px; }
  .hud-panel-tab[data-hud-show=objective] { top: 110px; }
  #sky-guide, .hud-panel-tab[data-hud-show=sky-guide] { top: 190px; right: 12px; }
  #sky-guide { width: min(230px, 65vw); max-height: 30dvh; overflow-y: auto; }
  #quick-controls { flex-direction: column; align-items: flex-end; gap: 4px; max-width: 100px; }
  #quick-controls > span.run-shortcut { display: none; }
  #player-hud { width: min(205px, 53vw); }
  #quick-controls button { font-size: 12px; }
  #quick-controls kbd { display: none; }
  #lab-panel, #embodied-panel {
    inset: auto 8px 8px; width: auto; max-height: calc(100dvh - 112px); transform: none;
  }
  #workshop-root { width: calc(100vw - 24px); left: 12px; }
  #workshop-root:has(#ws-mods:not(.ws-off)) { top: 108px; z-index: 62; }
  #ws-pilot { min-width: 0; width: calc(100vw - 24px); flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .menu-rail > button > span, .menu-rail > button.selected > span { font-size: 12px; letter-spacing: -.04em; }
  #panel [data-menu-page=lab] .lab-grid { grid-template-columns: 1fr; }
}
