/* styles.css （包含天空背景、层样式与画廊样式；已将楼层标题改为小角标并去掉查看插画按钮） */

/* 基本重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  position: relative;
  min-height: 100vh;
}

/* 可调变量 */
:root {
  --floor-width: 360px;
  --max-site-width: 900px;
  --img-aspect-ratio: 0.7446629213483146; /* 880/1184 */
  --sky-top: #87CEFF;
  --sky-mid: #a7d8ff;
  --sky-bottom: #f6fbff;
  --cloud-speed: 60s;
}

/* 天空背景 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -999;
  pointer-events: none;
  background-image:
    radial-gradient(closest-side at 10% 20%, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.00) 45%),
    radial-gradient(closest-side at 80% 25%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.00) 45%),
    radial-gradient(closest-side at 40% 50%, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.00) 60%),
    radial-gradient(closest-side at 70% 60%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.00) 60%),
    radial-gradient(closest-side at 20% 65%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.00) 60%),
    linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
  background-size:
    140% 90%, 160% 80%, 120% 60%, 110% 50%, 100% 50%, 100% 100%;
  background-position:
    0% 0%, 100% 10%, 10% 20%, 80% 30%, 25% 60%, 50% 50%;
  animation: cloudShift var(--cloud-speed) linear infinite;
}
@keyframes cloudShift {
  0% {
    background-position: 0% 0%,100% 10%,10% 20%,80% 30%,25% 60%,50% 50%;
  }
  50% {
    background-position: 10% 0%,90% 10%,0% 20%,70% 30%,35% 60%,50% 50%;
  }
  100% {
    background-position: 0% 0%,100% 10%,10% 20%,80% 30%,25% 60%,50% 50%;
  }
}

/* 入口遮罩 */
.entrance {
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, rgba(3,6,18,0.65), rgba(3,6,18,0.8));
  z-index: 30;
}
.entrance-inner {
  text-align:center;
  padding: 26px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.entrance h1 { font-size: 22px; margin-bottom: 8px; }
.entrance p { color: #eee; margin-bottom: 14px; font-size: 14px; }
.enter-btn {
  background: linear-gradient(90deg,#4f9cff,#8a6cff);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

/* 大楼容器：减少层间隙 */
.building {
  width: 100%;
  max-width: var(--max-site-width);
  margin: 0 auto;
  padding: 24px 0 160px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px; /* 缩小层间距离 */
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

/* 每层固定宽度，按图片比例高度 */
.floor {
  position: relative;
  width: var(--floor-width);
  max-width: var(--floor-width);
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  scroll-snap-align: end;
  box-shadow: 0 6px 20px rgba(10,15,25,0.45);
  aspect-ratio: 1184 / 880;
  height: calc(var(--floor-width) * var(--img-aspect-ratio));
  cursor: pointer; /* 指示可点击 */
}

/* 背景图层 */
.floor .floor-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.02) contrast(1.02) brightness(.98);
  transform-origin: center;
  transition: transform 0.5s ease, opacity 0.35s ease;
  opacity: 0;
}
.floor.loaded .floor-bg { opacity: 1; transform: scale(1); }

/* 层内部内容：标题变为小角标，尽量不遮挡画面 */
.floor .floor-content {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.82); /* 轻微亮色背景，确保文字可读但不太抢眼 */
  color: #0b2136;
  font-size: 12px; /* 更小的标题字号 */
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  max-width: calc(var(--floor-width) - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none; /* 防止遮挡点击（整层点击由 section 处理） */
}

/* 当需要让标题可以接收事件（例如加入图标）时，可移除 pointer-events: none */

/* 去掉原先的“查看插画”按钮样式（按钮已移除） */

/* 院子样式 */
.floor.courtyard { box-shadow: 0 12px 40px rgba(0,0,0,0.35); }

/* 浮动提示 */
.hint {
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: rgba(0,0,0,0.38);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 40;
  color: #f1f6fb;
}

/* ---- 画廊模态样式 ---- */
.gallery-modal { position: fixed; inset: 0; display: none; z-index: 200; align-items: center; justify-content: center; }
.gallery-modal.open { display: flex; }

.gallery-backdrop { position: absolute; inset: 0; background: rgba(6,16,32,0.55); backdrop-filter: blur(4px); }

.gallery-panel {
  position: relative;
  width: min(960px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,250,255,0.98));
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(5,10,20,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-header { display:flex; align-items:center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.gallery-header h3 { margin: 0; color: #08263a; font-size: 16px; }
.gallery-close { background: transparent; border: none; font-size: 26px; line-height:1; cursor: pointer; color: #08263a; }

.gallery-body { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.gallery-main { display: flex; align-items: center; justify-content: center; background: #eef7ff; border-radius: 8px; padding: 12px; }
.gallery-main img { max-width: 100%; max-height: 60vh; border-radius: 6px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gallery-grid .thumb { background: #fff; border-radius: 6px; overflow: hidden; display: block; cursor: pointer; border: 1px solid rgba(0,0,0,0.05); }
.gallery-grid .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-footer { padding: 8px 12px; border-top: 1px solid rgba(0,0,0,0.04); font-size: 13px; color: #062233; }

body.modal-open { overflow: hidden; touch-action: none; }

/* 响应式 */
@media (min-width: 700px) { :root { --floor-width: 420px; } .entrance h1 { font-size: 28px; } }
@media (max-width: 360px) { :root { --floor-width: calc(100vw - 28px); } .floor { border-radius: 8px; } }