
:root {
  --ink: #261f30;
  --muted: #70677a;
  --cream: #fff9ee;
  --surface: rgba(255,255,255,.9);
  --line: rgba(53,42,70,.13);
  --purple: #6c56a5;
  --purple-dark: #45376e;
  --gold: #d9a442;
  --shadow: 0 20px 55px rgba(37,27,52,.11);
  --radius-lg: 30px;
  --radius-md: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }

.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 22%, rgba(236,190,80,.20), transparent 30%),
    radial-gradient(circle at 80% 28%, rgba(123,91,181,.30), transparent 34%),
    linear-gradient(180deg, #171321 0%, #2a203e 58%, #43345c 100%);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
}
.hero::before { width: 380px; height: 380px; right: -140px; top: -120px; }
.hero::after { width: 240px; height: 240px; left: -90px; bottom: 40px; }

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}
.brand-pill {
  display: inline-flex;
  padding: .5rem .8rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .88rem;
  letter-spacing: .04em;
}
.hero h1 {
  max-width: 760px;
  margin: 0 0 1.25rem;
  font-size: clamp(3rem, 12vw, 6.2rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -.055em;
}
.hero h1 span { color: #f2cc77; }
.hero p {
  max-width: 680px;
  margin-bottom: 1.7rem;
  color: rgba(255,255,255,.78);
  font-size: clamp(1.03rem, 3vw, 1.3rem);
  line-height: 1.8;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4rem;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
}
.scroll-cue b { font-size: 2rem; line-height: 1; animation: floatY 1.8s ease-in-out infinite; }
@keyframes floatY { 0%,100%{transform:translateY(0)}50%{transform:translateY(7px)} }

.loading-state {
  min-height: 45vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  color: var(--muted);
}

.floor {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 5.5rem 0;
  overflow: hidden;
}
.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .52;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.58) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 72%, rgba(255,255,255,.42) 0 2px, transparent 3px);
  background-size: 135px 135px, 175px 175px;
}
.floor > .container { position: relative; z-index: 1; }

.theme-hall       { background: linear-gradient(180deg,#ead8b9,#f8edd7); }
.theme-exhibition { background: linear-gradient(180deg,#f5ecdc,#e9dfce); }
.theme-logic      { background: linear-gradient(180deg,#e9e4f3,#ddd5eb); }
.theme-history    { background: linear-gradient(180deg,#efe2cf,#decab1); }
.theme-stories    { background: linear-gradient(180deg,#f3e7dc,#ead9cf); }
.theme-fantasy    { background: linear-gradient(180deg,#ded4ed,#cfc1e5); }
.theme-ai {
  color: #fff;
  background:
    radial-gradient(circle at 80% 15%, rgba(121,86,177,.32), transparent 34%),
    linear-gradient(180deg,#403253,#191421);
}

.floor-number {
  position: absolute;
  top: -2rem;
  right: 1rem;
  z-index: 0;
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 950;
  line-height: .8;
  letter-spacing: -.09em;
  opacity: .075;
  user-select: none;
}
.theme-ai .floor-number { opacity: .12; }

.floor-panel {
  position: relative;
  max-width: 980px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.theme-ai .floor-panel { color: var(--ink); }

.floor-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
}
.floor-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  border: 1px solid rgba(60,45,80,.10);
  background: rgba(255,255,255,.72);
  font-size: 2.1rem;
}
.floor-copy { min-width: 0; }
.eyebrow {
  margin-top: .1rem;
  color: var(--purple);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .14em;
}
.floor-copy h2 {
  margin: .16rem 0 .65rem;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -.025em;
}
.floor-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}
.floor-cta { margin-top: 1.15rem; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .85rem;
  margin-top: 1.15rem;
}
.room-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem;
  min-width: 0;
  padding: 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.67);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.room-card:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(108,86,165,.28);
}
.room-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #fff;
  font-size: 1.45rem;
}
.room-body { min-width: 0; }
.room-body h3 {
  margin: .05rem 0 .35rem;
  font-size: 1.03rem;
  font-weight: 800;
}
.room-body p {
  margin: 0 0 .6rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.room-link {
  color: var(--purple);
  font-size: .84rem;
  font-weight: 800;
}

.btn-primary {
  --bs-btn-bg: var(--purple);
  --bs-btn-border-color: var(--purple);
  --bs-btn-hover-bg: var(--purple-dark);
  --bs-btn-hover-border-color: var(--purple-dark);
}
.btn-elevator {
  color: #2b2138;
  border: none;
  background: linear-gradient(135deg,#f8dc91,#d7a039);
  font-weight: 850;
}
.btn-elevator:hover { color: #211829; filter: brightness(.98); }

.floating-elevator {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 1040;
  min-height: 48px;
  padding-inline: 1rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(30,21,42,.26);
}
.floor-status {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 1020;
  padding: .55rem .75rem;
  border-radius: 999px;
  background: rgba(25,20,34,.80);
  color: #fff;
  font-size: .82rem;
  backdrop-filter: blur(8px);
}

.offcanvas { --bs-offcanvas-width: min(88vw,390px); }
.floor-nav { display: grid; gap: .55rem; }
.floor-nav a {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .6rem;
  align-items: center;
  min-height: 54px;
  padding: .7rem .8rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
}
.floor-nav a:hover {
  background: #f8f3fb;
  border-color: rgba(108,86,165,.25);
}
.floor-nav strong { color: var(--purple); }
.floor-nav small {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}
.tip-box {
  padding: 1rem;
  border-radius: 18px;
  background: #f8f3ea;
  color: var(--muted);
  font-size: .92rem;
}

.roof {
  padding: 5.5rem 0;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0%, rgba(121,91,177,.34), transparent 40%),
    #15111e;
}
.roof-icon { font-size: 3.2rem; margin-bottom: .75rem; }
.roof h2 { font-weight: 900; }
.roof p { color: rgba(255,255,255,.72); }

.error-state {
  max-width: 720px;
  margin: 4rem auto;
  padding: 1.25rem;
  border: 1px solid #e8ccd0;
  border-radius: 18px;
  color: #6d2e38;
  background: #fff3f5;
}
code { color: #714f9d; }

@media (max-width: 767.98px) {
  .hero { min-height: 74vh; }
  .hero-inner { padding-top: 3.4rem; padding-bottom: 3.4rem; }
  .floor { min-height: 72vh; padding: 4.4rem 0; }
  .floor-panel { padding: 1.1rem; border-radius: 23px; }
  .floor-heading { grid-template-columns: 1fr; }
  .floor-icon { width: 58px; height: 58px; border-radius: 18px; }
  .room-grid { grid-template-columns: 1fr; }
  .floor-number { right: .8rem; top: -1.7rem; }
  .floor-cta .btn { width: 100%; padding-block: .75rem; }
}

@media (max-width: 360px) {
  .room-card { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue b { animation: none; }
  .room-card { transition: none; }
}
