:root {
  color-scheme: dark;
  --workshop-gold: #ffd180;
  --workshop-gold-hot: #ffaf45;
  --workshop-ink: #100b08;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background: #100b08;
  color: #fff1d2;
  font-family: var(--font-sans, "Microsoft YaHei", sans-serif);
}

body.workshop-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
}

.workshop-page > .site-header {
  z-index: 30;
  border-bottom: 1px solid rgba(244, 200, 121, .14);
  background: linear-gradient(180deg, rgba(10, 9, 8, .92), rgba(18, 12, 8, .76));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  backdrop-filter: blur(16px);
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff0c5;
  color: #1b1008;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workshop-room {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #100b08;
  display: grid;
  place-items: center;
}

.workshop-room::before,
.workshop-room::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.workshop-room::before {
  z-index: 0;
  background: var(--progressive-bg-image, url("./assets/room-bg-final-low.webp")) center / cover no-repeat;
  filter: blur(14px) brightness(.92) saturate(.96);
  transform: scale(1.05);
}

.workshop-room::after {
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(4, 3, 2, .45) 100%);
}

.room-scene {
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100dvh * 2.1417));
  aspect-ratio: 8192 / 3825;
  overflow: hidden;
  box-shadow: 0 0 70px rgba(0, 0, 0, .62);
}

/* 16:9 一类视口里场景上下会露出铺底：给场景上下边缘各 6% 的羽化，
   让它和模糊铺底融成一片，而不是两条硬边黑带 */
.room-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 11, 8, .55), transparent 7%, transparent 93%, rgba(16, 11, 8, .55));
}

.room-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  transform: scale(1);
  transform-origin: center;
  transition: transform 560ms cubic-bezier(.22, .8, .2, 1), filter 560ms ease;
  will-change: transform;
}

body[data-scene-focus] .room-background { filter: saturate(1.08) contrast(1.04); }
body[data-scene-focus="competitions"] .room-background { transform: scale(1.14) translate(18%, 1%); }
body[data-scene-focus="prompts"] .room-background { transform: scale(1.12) translate(0, 3%); }
body[data-scene-focus="works"] .room-background { transform: scale(1.14) translate(-16%, 1%); }

body[data-scene-focus] .workshop-room::after {
  background: radial-gradient(ellipse at center, transparent 24%, rgba(4, 3, 2, .66) 100%);
  transition: background 420ms ease;
}

.room-hotspots { position: absolute; z-index: 2; inset: 0; }

.room-hotspot {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--workshop-gold);
  cursor: pointer;
  touch-action: manipulation;
  font: inherit;
}

.room-hotspot::before,
.room-hotspot::after {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 14px;
  pointer-events: none;
  transition: opacity 220ms ease-out, box-shadow 220ms ease-out, transform 220ms ease-out;
}

.room-hotspot::before {
  border: 1px solid rgba(255, 215, 132, .1);
  background: radial-gradient(ellipse at center, rgba(255, 177, 63, .13), transparent 70%);
  box-shadow: inset 0 0 18px rgba(255, 166, 49, .08);
  opacity: .3;
}

.room-hotspot::after {
  inset: 0;
  border: 1px solid rgba(255, 215, 132, .88);
  box-shadow: 0 0 28px rgba(255, 170, 51, .52), inset 0 0 20px rgba(255, 170, 51, .2);
  opacity: 0;
}

.room-hotspot:hover::before,
.room-hotspot:focus-visible::before { opacity: 1; transform: scale(1.015); }
.room-hotspot:hover::after,
.room-hotspot:focus-visible::after { opacity: 1; }
.room-hotspot:active::before { transform: scale(.985); }
.room-hotspot:focus-visible { outline: 3px solid #ffe8b1; outline-offset: 5px; }

.room-hotspot--competitions { left: 18.1%; top: 25.5%; width: 14.1%; height: 51.2%; }
.room-hotspot--prompts { left: 39.2%; top: 37.5%; width: 21.5%; height: 25%; }
.room-hotspot--works { left: 67.2%; top: 26.5%; width: 13.7%; height: 44.5%; }

.scene-transition {
  position: fixed;
  z-index: 40;
  inset: 92px 0 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 188, 77, .16), rgba(10, 6, 3, .94) 72%);
  transition: opacity 420ms ease;
}

.scene-transition span {
  width: 10vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 221, 151, .95), rgba(255, 159, 45, .35) 34%, transparent 70%);
  filter: blur(8px);
  transform: scale(.2);
  transition: transform 560ms cubic-bezier(.2, .8, .2, 1);
}

body.is-departing .room-hotspots { pointer-events: none; }
body.is-departing .scene-transition { opacity: 1; }
body.is-departing .scene-transition span { transform: scale(8); }

.coming-soon { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; }
.coming-soon[hidden] { display: none; }
.coming-soon__scrim { position: absolute; inset: 0; background: rgba(5, 8, 8, .62); backdrop-filter: blur(5px); }
.coming-soon__card {
  position: relative;
  width: min(440px, 100%);
  padding: 42px 40px 36px;
  border: 1px solid rgba(255, 211, 125, .72);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(57, 34, 17, .96), rgba(15, 12, 9, .98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 1px rgba(255, 232, 179, .15);
  text-align: center;
  animation: room-card-enter 260ms cubic-bezier(.22, .8, .2, 1) both;
}

@keyframes room-card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.coming-soon__eyebrow { margin: 0 0 10px; color: #ffbf60; font-size: 12px; letter-spacing: .26em; }
.coming-soon h2 { margin: 0; color: #ffe1a5; font-family: var(--font-serif, serif); font-size: 34px; font-weight: 500; }
.coming-soon__copy { margin: 18px 0 0; color: #fff1d2; font-size: 17px; line-height: 1.75; }
.coming-soon__note { margin: 9px 0 0; color: rgba(255, 226, 175, .68); font-size: 13px; line-height: 1.7; }
.coming-soon__close { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #ffe0a1; cursor: pointer; font-size: 28px; line-height: 1; }
.coming-soon__close:hover, .coming-soon__close:focus-visible { background: rgba(255, 190, 85, .14); outline: 2px solid #ffe4a7; outline-offset: 2px; }

/* ---------- 村口公告牌（云端公告，app.js 动态注入） ----------
   弹层刻意不用 vh/dvh（移动端 WebView 不可靠）：外层 fixed 铺满并自身滚动，
   木牌用 margin auto 居中，内容超高时整层滚动。 */
.hall-notice {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: 26px 18px;
}

.hall-notice[hidden] { display: none; }

.hall-notice__scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 2, .66);
  backdrop-filter: blur(4px);
}

.hall-notice__board {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  margin: auto;
  padding: 28px 32px 24px;
  border: 1px solid rgba(255, 211, 125, .55);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(66, 41, 20, .97), rgba(26, 16, 9, .98)),
    repeating-linear-gradient(90deg, rgba(255, 220, 150, .04) 0 2px, transparent 2px 26px);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .7), inset 0 1px rgba(255, 232, 179, .18);
  animation: hall-notice-enter 300ms cubic-bezier(.22, .8, .2, 1) both;
}

/* 木牌顶部的两枚「钉子」 */
.hall-notice__board::before,
.hall-notice__board::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe6ae, #a8742f 65%, #5d3c14);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.hall-notice__board::before { left: 16px; }
.hall-notice__board::after { right: 16px; }

@keyframes hall-notice-enter {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hall-notice__eyebrow {
  margin: 0 0 8px;
  color: #ffbf60;
  font-size: 12px;
  letter-spacing: .26em;
}

.hall-notice__title {
  margin: 0 0 6px;
  color: #ffe1a5;
  font-family: var(--font-serif, serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.3;
}

.hall-notice__section { margin-top: 14px; }

.hall-notice__section h3 {
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 3px solid rgba(255, 191, 96, .75);
  color: #ffd489;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .05em;
}

.hall-notice__section p {
  margin: 0 0 8px;
  color: #fff1d2;
  font-size: 15px;
  line-height: 1.75;
}

.hall-notice__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.hall-notice__list li {
  padding: 7px 12px;
  border: 1px solid rgba(255, 215, 132, .16);
  border-radius: 10px;
  background: rgba(255, 190, 96, .06);
  color: #fff1d2;
  font-size: 14px;
  line-height: 1.65;
}

.hall-notice__list b {
  margin-right: 8px;
  color: #ffd489;
  font-weight: 600;
}

.hall-notice__footer {
  margin: 12px 0 0;
  color: rgba(255, 226, 175, .72);
  font-size: 13px;
  text-align: right;
}

.hall-notice__ok {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 211, 125, .7);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 191, 96, .24), rgba(255, 160, 60, .1));
  color: #ffe1a5;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  letter-spacing: .08em;
}

.hall-notice__ok:hover,
.hall-notice__ok:focus-visible {
  background: linear-gradient(180deg, rgba(255, 191, 96, .34), rgba(255, 160, 60, .16));
  outline: 2px solid #ffe4a7;
  outline-offset: 2px;
}

.hall-notice__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffe0a1;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.hall-notice__close:hover,
.hall-notice__close:focus-visible {
  background: rgba(255, 190, 85, .14);
  outline: 2px solid #ffe4a7;
  outline-offset: 2px;
}

.hall-notice-toggle {
  position: fixed;
  z-index: 25;
  left: 16px;
  bottom: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 211, 125, .6);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(52, 32, 16, .92), rgba(24, 14, 7, .94));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  color: #ffe1a5;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  letter-spacing: .1em;
}

.hall-notice-toggle[hidden] { display: none; }

.hall-notice-toggle:hover,
.hall-notice-toggle:focus-visible {
  border-color: rgba(255, 218, 143, .85);
  outline: 2px solid #ffe4a7;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1220px) {
  body.workshop-page { grid-template-rows: 82px minmax(0, 1fr); }
  .scene-transition { inset-block-start: 82px; }
}

@media (max-width: 760px) {
  body.workshop-page { grid-template-rows: 70px minmax(0, 1fr); }
  .scene-transition { inset-block-start: 70px; }
  .coming-soon { padding: 16px; }
  .coming-soon__card { padding: 38px 24px 30px; }
  .hall-notice { padding: 16px 12px; }
  .hall-notice__board { padding: 30px 20px 24px; }
  .hall-notice__title { font-size: 22px; }
  .hall-notice__section p { font-size: 14px; }
  .hall-notice__list li { font-size: 13px; }
}
