/* 页面稳定性与键盘守卫样式：从 index.html 内联 style 抽离 */
body.keyboard-open .background,
body.keyboard-open .container,
body.keyboard-open .glass-container,
body.keyboard-open .modal-overlay,
body.keyboard-open .modal-content,
body.keyboard-open .video-modal,
body.keyboard-open .video-modal-content,
body.keyboard-open iframe {
  animation: none !important;
  transition: none !important;
}

body.keyboard-open .background {
  will-change: auto !important;
  transform: none !important;
}

body.keyboard-open * {
  scroll-behavior: auto !important;
}

/* 防止键盘回弹时出现白底 */
html,
body {
  min-height: 100%;
  background: #0b1020 !important;
}

.background {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  background-image: url("../img/f33216.png") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #0b1020 !important;
  image-rendering: auto !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  transform: none !important;
  filter: none !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/f33217.png");
  background-size: auto 92%;
  background-position: right 4% bottom;
  background-repeat: no-repeat;
  opacity: 1;
}

.container {
  position: relative;
  z-index: 1;
}

/* 可读性增强：按钮文字更清楚 */
.glass-button {
  background: rgba(255, 255, 255, 0.10) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  color: #7c8392 !important;
  text-shadow: none !important;
  font-weight: 700 !important;
}

.glass-button i {
  color: #7c8392 !important;
  text-shadow: none !important;
}

/* 标题与正文轻增强，避免背景干扰 */
.top-left,
.username,
.qq-number,
.random-quote,
.record-info,
.site-stats {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(31, 42, 68, 0.45) !important;
}

/* 键盘期间仅做轻量降载（不再模糊背景） */
body.keyboard-open .background {
  filter: none !important;
  height: 100vh !important;
  background-position: center center !important;
}

/* 强制稳定：键盘期间关闭人物叠层，避免缩放/位移跳动 */
body.keyboard-open .background::after {
  opacity: 0 !important;
  background-image: none !important;
}

/* 键盘期间锁住页面，防止整体被顶起 */
html.keyboard-open,
body.keyboard-open {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* 冻结主容器，避免跟随视口变化产生位移 */
body.keyboard-open .container {
  transform: none !important;
  margin-top: 0 !important;
  top: 0 !important;
}

/* 针对移动设备优化滚动性能 */
@media (max-width: 768px) {
  body {
    -webkit-overflow-scrolling: touch;
  }
  .container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
  
  .glass-container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
}

.tips-modal,
.zoom-warning-modal,
body.modal-open,
body.keyboard-open,
body.keyboard-open * {
    scroll-behavior: auto !important;
}

html,
body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}
.scroll-lock {
    overflow-y: hidden !important;
    overscroll-behavior: none !important;
}