/* 小秘和小白 · 官网四屏站（互助大楼版）
   色板：深棕夜空 #101220 / 牛皮纸 #F2E8D5 / 暖黄 #FCC873 */
:root {
  --night: #101220;
  --kraft: #F2E8D5;
  --warm: #FCC873;
  --warm-deep: rgb(234, 150, 60);
  --warm-top: rgb(252, 200, 115);
  --wood: rgb(74, 48, 28);
  --ink: #2b2118;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--night);
  color: var(--kraft);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .ep-num { font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", serif; font-weight: 700; }
img { display: block; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; }

/* ============ 屏 1 · 首屏视频 ============ */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,18,32,.25) 0%, rgba(16,18,32,0) 35%, rgba(16,18,32,.78) 100%);
}
.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 12vh;
  text-align: center; padding: 0 24px;
}
.hero-logo {
  width: 76px; height: 76px; border-radius: 22px; object-fit: contain;
  margin: 0 auto 18px; padding: 7px;
  background: rgba(243,221,189,.94); border: 2px solid rgba(93,64,55,.85);
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.hero-slogan {
  font-size: clamp(34px, 6.4vw, 64px);
  letter-spacing: .08em; color: var(--kraft);
  text-shadow: 0 2px 18px rgba(0,0,0,.65);
}
.hero-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 999px;
  font-size: 16px; letter-spacing: .12em; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(180deg, var(--warm-top), var(--warm-deep));
  color: #3a2410; font-weight: 700;
  box-shadow: 0 6px 22px rgba(234,150,60,.38);
}
.btn-ghost {
  border: 1px solid rgba(242,232,213,.6); color: var(--kraft);
  background: rgba(16,18,32,.35); backdrop-filter: blur(4px);
}
.hero-scrollhint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(242,232,213,.55); border-radius: 14px;
}

/* F1：屏外渲染隔离，首屏以下不阻塞 */
#screen-rules { content-visibility: auto; contain-intrinsic-size: 1100px; }
.footer { content-visibility: auto; contain-intrinsic-size: 460px; }

/* G1(v2.1)：移动端播放钮——原声音钮的右上角位置，油画风圆钮（牛皮纸底/深棕描边/红三角） */
.hero-cplay {
  position: absolute; top: 22px; right: 22px; z-index: 6;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(93,64,55,.9); background: rgba(243,221,189,.96);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.hero-cplay:active { transform: scale(.94); }
.hero-scrollhint span {
  position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--warm);
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ============ 屏 2 · 互助大楼 ============ */
#screen-building { position: relative; background: var(--night); }
.elevator-sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  overflow-anchor: none;
  background: url("../assets/sky.png") center / cover no-repeat;
}
.bld-stage {
  position: absolute; left: 0; right: 0; top: 0; margin: 0 auto;
  width: min(92vw, 860px);
  will-change: transform;
}
.bld-seg { position: relative; }
.bld-seg img { width: 100%; height: auto; }

/* 窗户三态：默认关窗看不到人；开窗（hover/click）人物冒出+弹卡 */
.win { position: absolute; }
.win-dark { /* 暗户：保持原画 */ }
.win-lit { cursor: pointer; }
.win-hole {
  position: absolute; inset: 0; overflow: hidden;
}
.win-lit .win-glow {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 50% 52%, rgba(255,190,90,.35), rgba(255,190,90,0) 160%),
    linear-gradient(90deg, transparent calc(50% - 4px), rgba(74,48,28,.85) calc(50% - 4px), rgba(74,48,28,.85) calc(50% + 4px), transparent calc(50% + 4px)),
    linear-gradient(0deg, transparent calc(50% - 4px), rgba(74,48,28,.85) calc(50% - 4px), rgba(74,48,28,.85) calc(50% + 4px), transparent calc(50% + 4px)),
    linear-gradient(180deg, rgb(252,200,115), rgb(234,150,60));
  box-shadow: 0 0 26px 6px rgba(252,200,115,.45), inset 0 0 18px rgba(255,220,150,.5);
  animation: winflicker 5.2s ease-in-out infinite;
}
@keyframes winflicker {
  0%, 100% { filter: brightness(1); }
  46% { filter: brightness(1.04); }
  52% { filter: brightness(.97); }
  58% { filter: brightness(1.03); }
}
.win-person {
  position: absolute; left: -5%; bottom: -14%;
  width: 110%; height: auto; pointer-events: none;
  opacity: 0; transform: translateY(16%);
  transition: opacity .28s ease, transform .28s ease;
  filter: drop-shadow(0 0 10px rgba(255,190,90,.35));
}
.win-lit.open .win-person { opacity: 1; transform: translateY(0); }

/* 户内互助卡弹层（伸出窗外，遮挡部分其他窗户——按册口径） */
.win-pop {
  position: absolute; left: 50%; bottom: 104%; width: 240px;
  transform: translateX(-50%) translateY(8px);
  background: linear-gradient(170deg, #f7eeda, #efe2c6);
  color: var(--ink); border: 1px solid #d9c9a4; border-radius: 12px;
  padding: 14px 15px 12px; z-index: 8;
  box-shadow: 0 14px 44px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.win-lit.open .win-pop { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.win-pop::after {
  content: ''; position: absolute; left: 50%; top: 100%; margin-left: -7px;
  border: 7px solid transparent; border-top-color: #efe2c6;
}
.win-lit.pop-below .win-pop {
  bottom: auto; top: 104%;
  transform: translateX(-50%) translateY(-8px);
}
.win-lit.open.pop-below .win-pop { transform: translateX(-50%) translateY(0); }
.win-lit.pop-below .win-pop::after {
  top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #f7eeda;
}
.win-pop-tag { font-size: 12px; color: #7a6438; }
.win-pop-tag b { color: #b05a1e; }
.win-pop-sum { margin-top: 6px; font-size: 15px; font-weight: 600; line-height: 1.55; }
.win-pop-time { margin-top: 6px; font-size: 11px; color: #9a8554; }
.win-pop-cta { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d3c096; font-size: 11px; color: #b05a1e; }

/* 地面层热区 */
.ground-duty, .ground-door { position: absolute; }
.ground-duty { left: 68.2%; top: 26%; width: 17.5%; height: 31%; cursor: pointer; }
.ground-door { left: 43.9%; top: 24%; width: 13.5%; height: 61%; cursor: pointer; }
.ground-duty:hover, .ground-door:hover { background: rgba(252,200,115,.08); border-radius: 8px; }

/* 电梯面板（黄铜质感自绘） */
.elevator-panel {
  position: absolute; right: max(10px, 3.4vw); top: 50%; transform: translateY(-50%);
  width: 118px; padding: 18px 12px 12px; border-radius: 20px;
  background: linear-gradient(160deg, #9a7a49 0%, #6f5127 38%, #8a6a3f 62%, #5b421f 100%);
  border: 2px solid rgba(43,30,12,.8);
  box-shadow: inset 0 2px 6px rgba(255,235,190,.35), inset 0 -6px 14px rgba(30,18,5,.55), 0 10px 30px rgba(0,0,0,.55);
  text-align: center; z-index: 6;
}
/* G4(v2.1)：点门 → 面板左右 30 度晃动 2 秒（保留 translateY(-50%) 定位，纯动画无跳转） */
@keyframes ep-wobble {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  20% { transform: translateY(-50%) rotate(-30deg); }
  40% { transform: translateY(-50%) rotate(24deg); }
  60% { transform: translateY(-50%) rotate(-16deg); }
  80% { transform: translateY(-50%) rotate(8deg); }
}
.elevator-panel.wobble { animation: ep-wobble 2s ease-in-out; transform-origin: 50% 15%; }
.ep-display {
  margin: 0 auto 14px; padding: 10px 6px 8px;
  width: 84px; border-radius: 42px 42px 10px 10px;
  background: radial-gradient(ellipse at 50% 0%, #fdf3d8, #e8d3a0 70%, #c8ab72);
  border: 2px solid rgba(43,30,12,.75);
  box-shadow: inset 0 2px 8px rgba(90,60,20,.5);
  color: #4a3010;
}
.ep-num { display: block; font-size: 34px; line-height: 1; }
.ep-caption { display: block; font-size: 10px; letter-spacing: .3em; margin-top: 3px; color: #7a5a28; }
.ep-btn {
  display: block; margin: 10px auto 0; width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d9b878, #8a6530 68%, #6b4a1c);
  border: 2px solid rgba(43,30,12,.8); color: #2e1d08; font-size: 17px;
  box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 1px 3px rgba(255,240,200,.6);
}
.ep-btn:active { transform: translateY(2px); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.ep-btn.ep-top { font-family: "STKaiti", "KaiTi", serif; font-size: 20px; }
/* H2(v3)：值班室入口改为与楼层按钮同款圆形，文字只写「1」 */
.ep-btn.ep-duty { font-family: "STKaiti", "KaiTi", serif; font-size: 22px; }

/* 值班室对话弹窗（App 样式；贴左侧，不遮挡管理员图像） */
.duty-chat {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  width: min(88vw, 340px); height: min(64vh, 460px);
  display: flex; flex-direction: column;
  background: #fdf7ea; color: var(--ink);
  border-radius: 16px; border: 1px solid #e0d0a8;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden;
}
.dc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #f3e7c8; border-bottom: 1px solid #e0d0a8;
}
.dc-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.dc-head b { font-size: 15px; display: block; }
.dc-head span { font-size: 11px; color: #7a9a5a; }
.dc-close { margin-left: auto; font-size: 18px; color: #8a744a; padding: 2px 8px; }
.dc-body { flex: 1; overflow-y: auto; padding: 12px; background: #f9f1de; }
.dc-msg {
  max-width: 82%; margin-bottom: 10px; padding: 9px 12px;
  border-radius: 12px; font-size: 14px; line-height: 1.55;
}
.dc-msg.bot { background: #fff; border: 1px solid #e8dcb8; border-top-left-radius: 4px; }
.dc-msg.me { margin-left: auto; background: #fce9bd; border-top-right-radius: 4px; }
.dc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e0d0a8; background: #fdf7ea; }
.dc-form input {
  flex: 1; padding: 9px 12px; border: 1px solid #d9c9a4; border-radius: 999px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); outline: none;
}
.dc-form button {
  padding: 0 18px; border-radius: 999px; font-size: 14px;
  background: linear-gradient(180deg, var(--warm-top), var(--warm-deep)); color: #3a2410; font-weight: 700;
}

/* ============ 屏 3 · 这栋楼的生活指南 ============ */
.rules {
  background:
    linear-gradient(180deg, rgba(16,18,32,.78) 0%, rgba(16,18,32,.88) 100%),
    url("../assets/sky.png") center / cover no-repeat;
  padding: 110px 24px 120px;
}
.rules-inner { max-width: 1020px; margin: 0 auto; }
.rules h2 {
  text-align: center; font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: .18em; color: var(--kraft);
}
.rules h2::after {
  content: ''; display: block; width: 56px; height: 3px; margin: 18px auto 0;
  background: linear-gradient(90deg, var(--warm-top), var(--warm-deep)); border-radius: 2px;
}
.rules-cards {
  margin-top: 56px; display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.rule-card {
  background: linear-gradient(170deg, #f7eeda, #efe2c6);
  color: var(--ink); border: 1px solid #d9c9a4; border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.rule-card h3 { font-size: 24px; color: #5a3c14; letter-spacing: .06em; }
.rule-card p { margin-top: 12px; font-size: 15px; line-height: 1.85; color: #4a3a22; }
.rule-card strong { color: #b05a1e; }
.rule-hero-card {
  grid-column: 1 / -1;
  background: linear-gradient(170deg, #fbf3df, #f2e4c2);
  border: 2px solid rgba(252,200,115,.65);
}
.rule-hero-card h3 { font-size: clamp(26px, 3.6vw, 36px); }
.rule-sub { margin-top: 8px !important; font-size: 16px !important; color: #8a6a30 !important; letter-spacing: .1em; }
.rule-points { margin-top: 16px; list-style: none; display: grid; gap: 8px; }
.rule-points li {
  padding-left: 22px; position: relative; font-size: 15px; line-height: 1.7; color: #4a3a22;
}
.rule-points li::before {
  content: ''; position: absolute; left: 0; top: .52em;
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--warm-top), var(--warm-deep));
}

/* ============ 屏 4 · 页尾全家桶 ============ */
.footer { background: #0b0d18; padding: 70px 24px 34px; }
.footer-inner { max-width: 1020px; margin: 0 auto; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.footer-cell h4 {
  font-family: "STKaiti", "KaiTi", serif; font-size: 19px; letter-spacing: .14em;
  color: var(--warm); margin-bottom: 10px;
}
.footer-cell p { font-size: 13px; color: rgba(242,232,213,.65); line-height: 1.8; }
.footer-link { color: var(--kraft); font-size: 14px; text-decoration: none; border-bottom: 1px dashed rgba(252,200,115,.5); }
.footer-link:hover { color: var(--warm); }
.footer-qr {
  width: 128px; height: 128px; margin-top: 10px;
  display: block;
}
.footer-join-title { font-size: 15px !important; color: var(--warm) !important; font-weight: 600; }
.footer-join-note { margin-top: 8px; font-size: 11px !important; color: rgba(242,232,213,.45) !important; }
.footer-qr-fallback { display: none; margin-top: 6px; }
.qr-missing .footer-qr-fallback { display: block; }
.channels { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.channels li { font-size: 13px; color: var(--kraft); }
.channels li a { text-decoration: none; border-bottom: 1px dashed rgba(252,200,115,.4); }
.channels li.dim { color: rgba(242,232,213,.35); }
.channels li.dim span { display: block; font-size: 10px; color: rgba(242,232,213,.22); }
.footer-legal {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(242,232,213,.12);
  text-align: center; font-size: 12px; color: rgba(242,232,213,.5); line-height: 2.1;
}
.footer-legal a { text-decoration: none; color: rgba(242,232,213,.65); }

/* ============ 移动端 ============ */
@media (max-width: 719px) {
  .bld-stage { width: 96vw; }
  .elevator-panel {
    width: 92px; padding: 12px 8px 9px; border-radius: 16px;
    right: 8px; top: auto; bottom: 12px; transform: none;
  }
  .ep-display { width: 66px; padding: 7px 4px 6px; }
  .ep-num { font-size: 26px; }
  .ep-btn { width: 46px; height: 46px; font-size: 14px; margin-top: 8px; }
  .ep-btn.ep-top, .ep-btn.ep-duty { font-size: 17px; }
  .win-pop { width: 200px; }
  .hero-copy { bottom: 15vh; }
  .duty-chat { left: 8px; right: 8px; bottom: 8px; width: auto; height: min(60vh, 420px); }
  .rules { padding: 80px 18px 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .win-lit .win-glow { animation: none; }
  html { scroll-behavior: auto; }
}
