:root {
  /* Apple 暗色语义色 */
  --bg: #000000;
  --panel: rgba(28, 28, 30, 0.62);
  --panel-solid: #161618;
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, 0.72);   /* 次级文字（引导段） */
  --ink-3: rgba(245, 245, 247, 0.56);   /* 三级文字（说明） */
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #d8b48a;        /* 暖金，贴合室内设计调性 */
  --accent-strong: #e7c79c;
  --accent-ink: #1a140d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

/* hidden 属性必须永远生效（防止被 .lightbox{display:flex} 等类规则覆盖） */
[hidden] { display: none !important; }

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  /* 关键：body 必须透明。若 body 也有不透明背景，会按绘制顺序
     盖在 z-index:-2 的 .bg 背景层之上，导致背景图不可见 */
  background: transparent;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* ---------- 全屏室内背景（暗化 + 模糊 + 暗角，本地优先，远程兜底） ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    url("assets/bg.jpg"),
    url("https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?auto=format&fit=crop&w=2000&q=80");
  background-size: cover;
  background-position: center;
  filter: blur(6px) brightness(0.55) saturate(1.05);
  transform: scale(1.08);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(180deg, rgba(0,0,0,0.32) 0%, rgba(0,0,0,0.52) 52%, rgba(0,0,0,0.78) 100%);
}

/* ---------- 顶栏（Apple 44px 毛玻璃导航） ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(10, 10, 11, 0.72);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .brand {
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--ink);
}

.brand {
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.brand.small { font-size: 11px; letter-spacing: 0.16em; text-align: left; }

/* ---------- 门禁（Apple 风超大居中标题 + 引导段 + 浮起卡片） ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
}
.gate-card {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  backdrop-filter: saturate(150%) blur(26px);
  -webkit-backdrop-filter: saturate(150%) blur(26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 56px 44px 40px;
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gate-icon {
  width: 56px; height: 56px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: rgba(216, 180, 138, 0.12);
  border: 1px solid rgba(216, 180, 138, 0.25);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}
.hero-title {
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0 0 18px;
  color: #f5f5f7;
}
.sub {
  color: var(--ink-2);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 400;
  line-height: 1.45;
  margin: 0 auto 34px;
  max-width: 600px;
}
#keyForm { display: flex; gap: 12px; }
#keyInput {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  font-size: 17px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
#keyInput::placeholder { color: #8a8a8e; }
#keyInput:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(216,180,138,0.18); }
#keyForm button {
  height: 48px;
  padding: 0 30px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
#keyForm button:hover { filter: brightness(1.06); }
#keyForm button:active { transform: translateY(1px); }
.gate-error { color: #ff9a8b; font-size: 14px; margin: 16px 0 0; }
.gate-foot { color: var(--ink-3); font-size: 13px; margin: 26px 0 0; line-height: 1.5; }
.gate-foot.muted { margin-top: 6px; opacity: 0.7; }

/* ---------- 内容区（Apple 980px 标准容器 + 大留白） ---------- */
.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 104px 22px 80px;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.app-header {
  text-align: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 48px;
  position: relative;
}
.app-header .brand.small {
  text-align: center;
  margin-bottom: 12px;
}
.app-header h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f5f5f7;
}
.welcome {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
  margin: 12px auto 0;
  max-width: 560px;
}
.app-header .ghost { position: absolute; top: 0; right: 0; }
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 9px 18px;
  border-radius: 980px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .15s, color .15s;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.block { margin-bottom: 56px; }
.block-title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f5f5f7;
  margin: 0 0 24px;
  text-align: center;
}

/* 画廊 */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.gallery figure {
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.gallery figure:hover { transform: translateY(-5px); border-color: rgba(216,180,138,0.4); box-shadow: var(--shadow); }
.gallery img { width: 100%; height: 240px; object-fit: cover; display: block; }
.gallery figcaption {
  padding: 13px 16px;
  font-size: 15px;
  color: var(--ink);
}

/* 全景 */
.panos { display: grid; grid-template-columns: 1fr; gap: 22px; }
.pano-item {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pano-item .pano-title {
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 500;
}
.pano-item .pano-host { height: 480px; background: #000; }

.app-foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 52px; opacity: 0.8; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 50;
  padding: 24px;
  backdrop-filter: blur(8px);
}
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 26px; line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.22); }
.lb-cap { color: #ddd; margin-top: 14px; font-size: 14px; }

.empty { color: var(--ink-3); font-size: 15px; padding: 8px 2px; }

@media (max-width: 600px) {
  .gate-card { padding: 44px 26px 32px; }
  .pano-item .pano-host { height: 320px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gallery img { height: 170px; }
}
