:root {
  --bg: #eee9f6;
  --surface: rgba(255, 253, 251, 0.9);
  --surface-solid: #fffdfb;
  --ink: #29243c;
  --ink-soft: #625c76;
  --muted: #8a8498;
  --accent: #7458c6;
  --accent-strong: #5d3fb8;
  --accent-soft: #eee8ff;
  --rose-soft: #f7eaf1;
  --blue-soft: #e7eef7;
  --line: rgba(63, 53, 88, 0.12);
  --line-strong: rgba(63, 53, 88, 0.22);
  --shadow: 0 24px 64px rgba(49, 37, 79, 0.13);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 245, 220, 0.78), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(215, 231, 241, 0.78), transparent 28%),
    linear-gradient(145deg, #f2eaf3 0%, #e6edf3 48%, #ece8f5 100%);
  font-family: var(--sans);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.bedroom-header {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 252, 0.86);
  backdrop-filter: blur(18px);
}

.back-link,
.room-mark,
.room-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link {
  width: fit-content;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent-strong);
}

.room-mark {
  justify-self: center;
  font-family: var(--serif);
  font-weight: 700;
}

.room-mark i {
  color: var(--accent);
}

.room-auth {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67a980;
  box-shadow: 0 0 0 4px rgba(103, 169, 128, 0.12);
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.bedroom-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.bedroom-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.bedroom-lead {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
}

.night-status {
  min-width: 190px;
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.night-status span,
.night-status small {
  color: var(--muted);
  font-size: 11px;
}

.night-status strong {
  font-family: var(--serif);
  font-size: 17px;
}

.bedroom-layout {
  display: block;
}

.room-scene {
  position: relative;
  min-height: 690px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(90deg, rgba(122, 96, 75, 0.06) 0 1px, transparent 1px 68px),
    linear-gradient(180deg, #f2edf4 0 40%, #e8ddd2 40% 100%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.room-scene::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 40% 0 auto;
  height: 3px;
  background: rgba(81, 64, 65, 0.08);
}

.sea-window {
  position: absolute;
  top: 44px;
  left: 50%;
  width: min(48%, 360px);
  height: 170px;
  display: grid;
  place-content: center;
  gap: 8px;
  transform: translateX(-50%);
  border: 10px solid rgba(255, 253, 251, 0.86);
  border-radius: 120px 120px 18px 18px;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 70% 28%, #f8f1dc 0 7px, transparent 8px),
    linear-gradient(180deg, #918db7 0%, #9cb0c5 54%, #d5d2dd 55%, #849caf 100%);
  box-shadow: 0 10px 30px rgba(66, 55, 91, 0.12);
}

.sea-window i {
  font-size: 30px;
}

.sea-window span {
  font-family: var(--serif);
  font-size: 13px;
}

.room-object {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(75, 61, 79, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: 0 12px 28px rgba(64, 48, 68, 0.1);
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.room-object:hover,
.room-object:focus-visible {
  z-index: 4;
  transform: translateY(-4px);
  border-color: rgba(116, 88, 198, 0.34);
  box-shadow: 0 16px 34px rgba(64, 48, 95, 0.18);
  outline: none;
}

.room-object i {
  color: var(--accent);
  font-size: 23px;
}

.room-object span,
.room-object strong {
  font-family: var(--serif);
  font-size: 14px;
}

.room-object small {
  color: var(--muted);
  font-size: 10px;
}

.object-bed {
  top: 235px;
  left: 50%;
  width: min(46%, 350px);
  height: 260px;
  transform: translateX(-50%);
  border-radius: 32px 32px 22px 22px;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(116, 88, 198, 0.08) 49% 51%, transparent 51%),
    linear-gradient(180deg, #fcfaf8, #e9e3ee);
}

.object-bed:hover,
.object-bed:focus-visible {
  transform: translateX(-50%) translateY(-4px);
}

.object-bed > i {
  font-size: 42px;
}

.pillow {
  position: absolute;
  top: 22px;
  width: 48%;
  height: 54px;
  border: 1px solid rgba(70, 55, 77, 0.08);
  border-radius: 18px;
  background: #fffdfb;
  box-shadow: 0 5px 12px rgba(65, 51, 72, 0.06);
}

.object-nightstand {
  top: 330px;
  width: 126px;
  min-height: 130px;
}

.object-nightstand-left {
  left: 7%;
}

.object-nightstand-right {
  right: 7%;
  background: linear-gradient(145deg, #fffafc, #f4e8f0);
}

.object-wardrobe {
  top: 82px;
  left: 5%;
  width: 132px;
  height: 180px;
}

.object-window-seat {
  right: 5%;
  bottom: 56px;
  width: 170px;
  min-height: 116px;
}

.object-bathroom-door {
  left: 5%;
  bottom: 56px;
  width: 150px;
  min-height: 116px;
}

.bedroom-rug {
  position: absolute;
  bottom: 54px;
  left: 50%;
  width: min(46%, 330px);
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(169, 144, 188, 0.18);
}

.bedroom-rug span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(116, 88, 198, 0.24);
}

.inventory-shortcut {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(116, 88, 198, 0.2);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 253, 251, 0.9);
  box-shadow: 0 10px 26px rgba(64, 48, 95, 0.12);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.inventory-shortcut:hover,
.inventory-shortcut:focus-visible {
  border-color: rgba(116, 88, 198, 0.42);
  transform: translateY(-2px);
  outline: none;
}

.inventory-shortcut > i:first-child {
  grid-row: 1 / span 2;
  color: var(--accent);
  font-size: 24px;
}

.inventory-shortcut span {
  font-family: var(--serif);
  font-size: 13px;
}

.inventory-shortcut small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.inventory-shortcut .shortcut-arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 18px;
}

.room-guide {
  position: sticky;
  top: 92px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(55, 43, 78, 0.1);
  backdrop-filter: blur(16px);
}

.room-guide h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
}

.room-guide > p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.privacy-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(139, 87, 118, 0.13);
  border-radius: 17px;
  background: rgba(247, 234, 241, 0.72);
}

.privacy-card > i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #8c5576;
  background: rgba(255, 255, 255, 0.72);
}

.privacy-card strong {
  font-family: var(--serif);
}

.privacy-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.room-legend {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.room-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.room-legend i {
  color: var(--accent);
  font-size: 15px;
}

.object-dialog {
  width: min(calc(100vw - 32px), 560px);
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 28px 72px rgba(43, 32, 65, 0.24);
}

.object-dialog::backdrop {
  background: rgba(38, 31, 57, 0.46);
  backdrop-filter: blur(9px);
}

.dialog-inner {
  padding: 26px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.dialog-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.dialog-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
}

.dialog-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  outline: none;
}

.object-description {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.object-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.object-tag {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 11px;
}

.object-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-left: 3px solid rgba(116, 88, 198, 0.34);
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 11px;
  line-height: 1.7;
}

.live-inventory {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inventory-heading,
.inventory-item-title,
.inventory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-heading > div {
  display: grid;
  gap: 3px;
}

.inventory-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.inventory-heading strong {
  font-family: var(--serif);
  font-size: 16px;
}

.inventory-heading button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.inventory-heading button:hover,
.inventory-heading button:focus-visible {
  border-color: var(--line-strong);
  color: var(--accent);
  outline: none;
}

.inventory-status {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 13px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  line-height: 1.6;
}

.inventory-status.is-private {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.inventory-status a {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.inventory-status.is-loading i {
  animation: inventory-spin 900ms linear infinite;
}

.inventory-list {
  display: grid;
  gap: 14px;
  margin-top: 13px;
}

.inventory-group {
  display: grid;
  gap: 8px;
}

.inventory-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.inventory-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.inventory-item-title strong {
  font-family: var(--serif);
  font-size: 15px;
}

.inventory-item-title b {
  color: var(--accent);
  font-size: 11px;
}

.inventory-meta {
  justify-content: flex-start;
  margin-top: 5px;
}

.inventory-meta span,
.inventory-tags em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.inventory-meta span + span::before {
  content: "·";
  margin-right: 8px;
}

.inventory-item p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.inventory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.inventory-tags em {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
}

@keyframes inventory-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 880px) {
  .bedroom-header {
    grid-template-columns: 1fr auto;
  }

  .room-mark {
    display: none;
  }

  .bedroom-layout {
    display: block;
  }

  .room-guide {
    position: static;
  }
}

@media (max-width: 640px) {
  .bedroom-header {
    min-height: 62px;
    padding: 10px 14px;
  }

  .back-link {
    font-size: 12px;
  }

  .room-auth {
    max-width: 142px;
    justify-content: flex-end;
    text-align: right;
    font-size: 10px;
  }

  main {
    width: min(100% - 24px, 1180px);
    padding: 34px 0 52px;
  }

  .bedroom-intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .bedroom-intro h1 {
    font-size: 40px;
  }

  .night-status {
    width: 100%;
  }

  .room-scene {
    min-height: 640px;
    border-radius: 25px;
  }

  .sea-window {
    top: 34px;
    width: 58%;
    height: 140px;
  }

  .object-bed {
    top: 205px;
    width: 42%;
    height: 230px;
  }

  .object-nightstand {
    top: 284px;
    width: 92px;
    min-height: 120px;
    padding: 9px;
  }

  .object-nightstand-left {
    left: 3%;
  }

  .object-nightstand-right {
    right: 3%;
  }

  .object-wardrobe {
    top: 54px;
    left: 3%;
    width: 92px;
    height: 124px;
  }

  .object-window-seat,
  .object-bathroom-door {
    bottom: 44px;
    width: 130px;
    min-height: 104px;
    padding: 9px;
  }

  .object-window-seat {
    right: 3%;
  }

  .object-bathroom-door {
    left: 3%;
  }

  .bedroom-rug {
    bottom: 42px;
    width: 48%;
    height: 100px;
  }

  .room-object small {
    max-width: 84px;
    line-height: 1.4;
  }

  .room-guide {
    padding: 20px;
    border-radius: 22px;
  }

  .dialog-inner {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
