/* ============================================================================
 * 🎨 iOS 原生毛玻璃质感 + 3D 拍立得翻转 + 灵动岛沉浸式适配样式表
 * ============================================================================ */

:root {
  --safe-top: env(safe-area-inset-top, 16px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: radial-gradient(circle at 20% 15%, #2a183d 0%, #151026 48%, #0b0914 100%);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* 允许输入框与留言正常选中文本 */
input,
textarea,
pre,
.selectable-text {
  user-select: text;
}

/* 隐藏滚动条但保留丝滑滚动 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* iOS 原生级高饱和毛玻璃卡片 */
.ios-glass {
  background: rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
}

.ios-glass-strong {
  background: rgba(30, 22, 48, 0.72);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ios-glass-pill {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 仿 iOS 锁屏数字按键 */
.ios-keypad-btn {
  width: 74px;
  height: 74px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease;
  cursor: pointer;
}

.ios-keypad-btn:active {
  transform: scale(0.91);
  background: rgba(255, 255, 255, 0.32);
}

/* 密码错误时的 iOS 经典水平抖动动画 */
@keyframes iosShake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-14px); }
  35%, 75% { transform: translateX(14px); }
}

.animate-ios-shake {
  animation: iosShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* 拍立得相纸 3D 180° 翻转容器 */
.polaroid-perspective {
  perspective: 1200px;
}

.polaroid-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.72s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.polaroid-inner.is-flipped {
  transform: rotateY(180deg);
}

.polaroid-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
}

.polaroid-front {
  background: linear-gradient(180deg, #ffffff 0%, #fdf8f5 100%);
  color: #1e293b;
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.polaroid-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #fff9f5 0%, #fceef2 100%);
  color: #334155;
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 192, 203, 0.5);
  background-image:
    radial-gradient(#f472b622 1px, transparent 1px),
    linear-gradient(to bottom, transparent 27px, rgba(244, 114, 182, 0.14) 28px);
  background-size: 16px 16px, 100% 28px;
}

/* 心跳呼吸特效 */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(1.22); }
  36% { transform: scale(0.95); }
  54% { transform: scale(1.14); }
}

.animate-heartbeat {
  animation: heartbeat 1.8s infinite ease-in-out;
}

/* 扭蛋机摇晃动画 */
@keyframes gachaWobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-8deg) scale(1.04); }
  40% { transform: rotate(8deg) scale(1.06); }
  60% { transform: rotate(-6deg) scale(1.04); }
  80% { transform: rotate(6deg) scale(1.02); }
}

.animate-gacha {
  animation: gachaWobble 0.65s ease-in-out infinite;
}

/* 页面切换淡入上浮过渡 */
.tab-fade-enter-active,
.tab-fade-leave-active {
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.tab-fade-enter-from {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}
.tab-fade-leave-to {
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
}

/* 锁屏解锁滑出过渡 */
.lock-slide-leave-active {
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.55s ease;
}
.lock-slide-leave-to {
  opacity: 0;
  transform: scale(1.12) translateY(-30px);
  filter: blur(14px);
}
