: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; }

/* 品牌标识：以 alpha 蒙版着色（不是贴图），颜色由单一变量 --logo-ink 控制。
   全站统一为品牌暖金 --accent（#d8b48a），不再跟随各处文字色。
   覆盖位点：门禁 62 / 页头 26 / 顶栏 22 / 页脚 20 / 管理页 28·20。
   要换色只改下面这一行（favicon 需重跑 tools/make_logo.py，它无法用蒙版）。 */
:root { --logo-ink: var(--accent); }
.logo {
  display: block;
  background-color: var(--logo-ink);
  -webkit-mask: url("assets/logo-mark-sm.png") center / contain no-repeat;
  mask: url("assets/logo-mark-sm.png") center / contain no-repeat;
}

/* 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);
}
/* 顶栏品牌锁定：标识 + 字标 */
.brandbar { display: inline-flex; align-items: center; gap: 10px; }
.brandbar .logo { width: 22px; height: 22px; color: var(--logo-ink); }
.brand-name {
  font-size: 12px;
  letter-spacing: 0.14em;
  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-logo {
  width: 62px; height: 62px;
  margin: 0 auto 20px;
  display: block;
  /* 全站标识统一色：--logo-ink（暖金），不透明 */
  color: var(--logo-ink);
  background-color: var(--logo-ink);
  -webkit-mask: url("assets/logo-mark.png") center / contain no-repeat;
  mask: url("assets/logo-mark.png") center / contain no-repeat;
}
.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(35px, 5.6vw, 64px);
  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 .logo-row {
  display: flex; align-items: center; justify-content: center;
  gap: 9px; margin-bottom: 12px;
}
.app-header .logo-row .logo { width: 26px; height: 26px; color: var(--logo-ink); }
.app-header .logo-row .brand.small { text-align: center; margin: 0; }
.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; }

/* 页脚淡化改由文字色承担（--ink-3），不再用容器 opacity —— 否则标识会被一起淡化，
   导致全站标识颜色不统一 */
.app-foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 52px; }
.app-foot .logo { width: 20px; height: 20px; margin: 0 auto 10px; color: var(--logo-ink); }
.app-foot p { margin: 0; }
.app-foot .vc { margin-top: 8px; letter-spacing: 0.02em; }
.app-foot .vc span { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.gate-foot span { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }

/* 灯箱 */
.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);
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
}
.lightbox img:active { cursor: grabbing; }
.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-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  font-size: 30px; line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
  -webkit-user-select: none; user-select: none;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-cap { color: #ddd; margin-top: 14px; font-size: 14px; }
.lb-hint { color: rgba(255,255,255,.5); margin-top: 8px; font-size: 12px; letter-spacing: .04em; }

/* 下载防护：图片不可拖拽、不可选中、禁用右键保存；全景容器同理 */
.gallery img, .lightbox img, .pano-host {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

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

@media (max-width: 600px) {
  /* 登录页：保持与桌面一致的居中构图（LOGO + 品牌 + 标题 + 表单 + 页脚），
     仅压缩四周留白让卡片占满中心、背景少露 */
  .gate { padding: 92px 16px 44px; }
  .gate-card { padding: 40px 22px 30px; max-width: 420px; }
  .hero-title { font-size: clamp(30px, 8.8vw, 45px); }
  /* 小屏进一步压暗背景，主体更突出、背景更少 */
  .bg { filter: blur(8px) brightness(0.42) saturate(1.05); }
  .pano-item .pano-host { height: 320px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gallery img { height: 170px; }
}
/* 竖屏手机：上下留白压到最小，登录信息占满视口中心，背景面积最小 */
@media (max-width: 600px) and (orientation: portrait) {
  .gate { padding: 80px 14px 34px; min-height: 100vh; min-height: 100svh; }
  .gate-card { padding: 34px 20px 26px; }
  .gate-logo { margin: 0 auto 16px; }
}
