/* 屋外 · 插画版 —— 2026-11-19
   客厅右前方一块「室外 →」的小告示牌 → 出去就是这张插画：山坡、大树、树下的秋千和女孩。
   底色是那张画，星星/月亮只落在天空里，萤火虫只落在草上，树枝上挂一串小灯。
   天色跟北京时间同步：白天通透、黄昏染橘、夜里深蓝，流星不定时划过。
   只做加法，不碰原站任何组件。 */

/* ============================
   客厅里那块「室外 →」的小告示牌（SVG 注入）
   ============================ */
.os-sign { cursor: pointer; }
.os-sign text { font-family: zpix, monospace; pointer-events: none; }
.os-sign:hover { filter: brightness(1.06); }
.os-sign:active { filter: brightness(.96); }
.os-sign:focus { outline: none; }
.os-sign:focus-visible { filter: drop-shadow(0 0 4px rgba(255, 214, 150, .8)); }

/* ============================
   室外整层
   ============================ */
.os-layer {
  position: fixed; inset: 0; z-index: 8600;
  background: #070a16;
  opacity: 0; visibility: hidden;
  transition: opacity .62s ease, visibility .62s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.os-layer.on { opacity: 1; visibility: visible; }
.os-layer[hidden] { display: none; }

/* 画面（左右上下由脚本按屏幕算） */
.os-art {
  position: absolute;
  transform-origin: 50% 55%;
  animation: osDrift 110s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes osDrift {
  from { transform: scale(1); }
  to   { transform: scale(1.045); }
}

.os-bg {
  display: block; position: absolute; inset: 0;
  width: 100%; height: 100%;
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
  transform: translateZ(0);
  transition: filter 1.6s linear;
}

/* 秋千连人一起：从底图抠出来的一块，绕树枝上的挂点转。
   默认是静的。点一下女孩 → 晃几下自己停住；连点会越荡越大，但有上限。
   角度完全由 outside-play.js 逐帧写 transform（衰减正弦），这里不给动画。 */
.os-swing {
  position: absolute;
  pointer-events: none;
  background: url("/mb/outside-swing.png") 0 0 / 100% 100% no-repeat;
  transform-origin: 50% 0;
  transform: rotate(0deg);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 天色三层：夜、黄昏、日照 */
.os-tint { position: absolute; inset: 0; pointer-events: none; transition: opacity 1.6s linear; }
.os-night {
  background: #0c1a3e;
  mix-blend-mode: multiply;
  opacity: 0;
}
.os-dusk {
  background:
    linear-gradient(102deg,
      rgba(255, 140, 44, .95) 0%,
      rgba(255, 126, 88, .70) 32%,
      rgba(206, 98, 148, .48) 66%,
      rgba(120, 92, 176, .40) 100%);
  mix-blend-mode: overlay;
  opacity: 0;
}
.os-moonlight {
  mix-blend-mode: screen;
  opacity: 0;
}
.os-sun {
  background:
    radial-gradient(circle at 14% 10%,
      rgba(255, 248, 220, .85) 0%,
      rgba(255, 220, 158, .34) 32%,
      rgba(255, 210, 150, 0) 64%);
  mix-blend-mode: screen;
  opacity: 0;
}

/* 光效层 */
.os-fx {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* 四边压暗一点，画面更“画” */
.os-vig {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 92% at 50% 46%,
      rgba(0, 0, 0, 0) 52%,
      rgba(6, 10, 24, .30) 100%);
}

/* ============================
   光效的微动
   ============================ */
@keyframes osStarTwinkle {
  0%, 100% { opacity: .28; }
  50%      { opacity: 1; }
}
.os-star { animation: osStarTwinkle 6.5s ease-in-out infinite; }

/* 萤火虫的游动和明灭由 outside-night.js 逐帧算，不再用 CSS 动画：
   它们会按自己的节奏飘、会躲手，CSS 那套固定轨迹做不到。 */
.os-fly2 { will-change: transform; }
.os-fly-halo { will-change: opacity; }

@keyframes osMoteFloat {
  0%, 100% { transform: translate(0, 0); opacity: .15; }
  50%      { transform: translate(9px, -18px); opacity: .7; }
}
.os-mote { animation: osMoteFloat 13s ease-in-out infinite; }

@keyframes osMeteorGo {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: 1; }
  68%  { opacity: .85; }
  100% { transform: translate(var(--mdx, -280px), 0); opacity: 0; }
}
.os-meteor { animation: osMeteorGo 1.6s linear forwards; }

@keyframes osLeafFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .9; }
  45% { transform: translate(-13px, 150px) rotate(140deg); }
  100% { transform: translate(9px, 330px) rotate(330deg); opacity: 0; }
}
.os-leaf { animation: osLeafFall 15s linear infinite; }

@keyframes osBirdFly {
  from { transform: translate(-120px, 0); }
  to   { transform: translate(1420px, -34px); }
}
.os-bird { animation: osBirdFly 20s linear forwards; }

/* 小灯笼的灯芯轻轻抖 */
@keyframes osLampFlicker {
  0%, 100% { opacity: 1; }
  46%      { opacity: .84; }
  72%      { opacity: .95; }
}
.os-lamps { animation: osLampFlicker 7s ease-in-out infinite; }

/* ============================
   顶部提示 / 底部按钮
   ============================ */
.os-hud {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none; z-index: 3;
}
.os-hud-in {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(14, 18, 38, .42);
  border: 1px solid rgba(255, 240, 214, .18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #f6ecd8; font-size: 12.5px; letter-spacing: .4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  font-family: zpix, "PingFang SC", sans-serif;
}
.os-hud-in b { font-weight: normal; color: #ffe6b8; }

.os-tip {
  position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 8px 18px; border-radius: 999px;
  background: rgba(12, 16, 34, .46);
  border: 1px solid rgba(255, 240, 214, .16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #f2e6d2; font-size: 12.5px; white-space: nowrap;
  font-family: zpix, "PingFang SC", sans-serif;
  pointer-events: none; z-index: 3;
  opacity: 1; transition: opacity .8s ease;
  animation: osTipPulse 4.5s ease-in-out infinite;
}
@keyframes osTipPulse { 0%,100% { opacity: .62; } 50% { opacity: 1; } }
.os-tip.gone { opacity: 0; animation: none; }

.os-back {
  position: absolute; left: calc(14px + env(safe-area-inset-left, 0px));
  top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px 8px 12px; border-radius: 999px;
  background: rgba(14, 18, 38, .46);
  border: 1px solid rgba(255, 240, 214, .2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #f6ecd8; font-size: 13px; font-family: zpix, "PingFang SC", sans-serif;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .2s;
}
.os-back:hover { background: rgba(30, 38, 66, .62); }
.os-back:active { transform: scale(.96); }

/* ============================
   确认框
   ============================ */
.os-modal {
  position: fixed; inset: 0; z-index: 8900;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 22, .58);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: osFadeIn .22s ease;
}
@keyframes osFadeIn { from { opacity: 0; } to { opacity: 1; } }
.os-card {
  width: min(400px, 88vw);
  background: linear-gradient(170deg, #2c2440 0%, #221b34 62%, #1b1529 100%);
  border: 1px solid rgba(255, 226, 176, .22);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 240, 214, .1);
  overflow: hidden;
  animation: osCardIn .26s cubic-bezier(.2, .9, .3, 1.1);
  font-family: zpix, "PingFang SC", sans-serif;
}
@keyframes osCardIn { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.os-card-head {
  padding: 16px 20px 12px; font-size: 15.5px; color: #ffe0a8;
  letter-spacing: 1.2px;
  border-bottom: 1px solid rgba(255, 226, 176, .12);
}
.os-card-body {
  padding: 16px 20px 18px; font-size: 13.5px; line-height: 1.95; color: #e6dcc8;
}
.os-card-body small { display: block; margin-top: 8px; font-size: 12px; color: #a89db4; line-height: 1.8; }
.os-card-foot {
  display: flex; gap: 10px; padding: 0 20px 18px;
}
.os-btn {
  flex: 1; padding: 11px 8px; border-radius: 11px;
  border: 1px solid rgba(255, 236, 206, .22);
  background: rgba(255, 240, 214, .06);
  color: #e8dcc6; font-size: 13.5px; cursor: pointer;
  font-family: inherit; transition: background .18s, transform .12s;
}
.os-btn:hover { background: rgba(255, 240, 214, .13); }
.os-btn:active { transform: scale(.97); }
.os-btn.gold {
  background: linear-gradient(180deg, #e8b76a, #c9924a);
  border-color: #f0cd90; color: #2b1c0c; font-weight: bold;
  box-shadow: 0 5px 16px rgba(200, 145, 65, .32);
}
.os-btn.gold:hover { background: linear-gradient(180deg, #f0c37c, #d29c52); }

/* ============================
   夜里的氛围（飞机 / 萤火虫的小字）
   ============================ */

@keyframes osNightPop {
  0%   { opacity: 0; transform: translateY(5px); }
  18%  { opacity: 1; }
  68%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-11px); }
}
.os-night-pop {
  animation: osNightPop 2.5s ease-out forwards;
  paint-order: stroke;
  stroke: rgba(22, 18, 30, .55);
  stroke-width: 2.2px;
  pointer-events: none;
}

/* 手机上 */
@media (max-width: 620px) {
  .os-hud-in { font-size: 11.5px; padding: 6px 13px; }
  .os-tip { font-size: 11.5px; padding: 7px 14px; }
  .os-back { font-size: 12px; padding: 7px 13px 7px 10px; }
  .os-card-body { font-size: 13px; line-height: 1.9; }
}

@media (prefers-reduced-motion: reduce) {
  /* 秋千不在这条里：它只在用户主动点的时候才动 */
  .os-art, .os-star, .os-fly, .os-bird, .os-mote, .os-meteor, .os-lamps,
  .os-leaf { animation: none !important; }
}
