:root {
  /* 补回丢失的基础颜色，防止网页瞬间变透明 */
  --white: #ffffff;
  --pink-bg: #ffe8ef; 

  /* 高级莫兰迪色系 & 苹果 iOS 质感变量 */
  --primary-bg: #f2f2f7; 
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.8);
  --text-main: #1d1d1f; 
  --text-light: #8e8e93; 
  --accent: #ff4d6d; 
  --coin-gold: #f39c12;
  --shadow-sm: 0 8px 24px rgba(149, 157, 165, 0.1); 
  --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.08);
}

html, body { margin: 0; padding: 0; width: 100%; height: 100%; background-color: #e0e0e0; overflow: hidden; }
body { display: flex; justify-content: center; align-items: center; height: 100dvh; }

* { box-sizing: border-box; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; -webkit-tap-highlight-color: transparent; }
button { border: none; outline: none; cursor: pointer; transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1); }
button:active { transform: scale(0.92); }
::-webkit-scrollbar { width: 0px; }

#splash-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--primary-bg); z-index: 9999; display: flex; flex-direction: column;
  justify-content: center; align-items: center; transition: opacity 0.5s ease;
}
.loader-bird { font-size: 80px; animation: bounce 0.8s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-30px); } }

.app-container {
  width: 100%; max-width: 420px; height: 100%; height: 100dvh; 
  background: var(--primary-bg); position: relative; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md); transition: all 0.3s ease;
}
@supports (-webkit-touch-callout: none) { body, .app-container { height: -webkit-fill-available; } }
@media (min-width: 900px) {
  body { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
  .app-container { height: 90vh; border-radius: 40px; border: 8px solid #fff; box-shadow: 0 25px 70px rgba(0,0,0,0.15); transform: translateZ(0); }
}

#auth-screen {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--pink-bg) 0%, var(--primary-bg) 100%);
  z-index: 500; display: flex; flex-direction: column; justify-content: space-around; align-items: center; padding: 30px 15px; transition: opacity 0.4s; overflow-y: auto;
}
.product-showcase { width: 100%; max-width: 380px; margin-bottom: 20px; display: none; }
.product-header { text-align: center; color: var(--text-main); font-weight: bold; font-size: 16px; margin-bottom: 15px; }
.product-grid { display: flex; justify-content: center; gap: 15px; }
.product-card { background: rgba(255,255,255,0.7); border-radius: 20px; width: 33%; overflow: hidden; text-align: center; border: 3px solid transparent; box-shadow: var(--shadow-sm); transition: 0.2s; cursor: pointer;}
.product-card img, .product-card svg { width: 100%; height: 100px; display: block; object-fit: cover; border-bottom: 1px solid #f0f0f0; background: #fff;}
.product-name { font-size: 11px; font-weight: bold; color: var(--text-main); padding: 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.product-card.selected { border-color: var(--accent); background: #fff; box-shadow: 0 6px 15px rgba(255,143,171,0.2); transform: scale(1.05);}

.auth-card { background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); width: 100%; max-width: 360px; border-radius: 30px; padding: 25px; box-shadow: var(--shadow-md); text-align: center; }
.auth-tabs { display: flex; margin-bottom: 20px; background: rgba(0,0,0,0.05); border-radius: 15px; padding: 5px; }
.auth-tab { flex: 1; padding: 10px; font-size: 14px; font-weight: bold; color: var(--text-light); border-radius: 12px; cursor: pointer; transition: 0.3s; }
.auth-tab.active { background: var(--white); color: var(--accent); box-shadow: var(--shadow-sm); }
.styled-input { width: 100%; padding: 14px 15px; border-radius: 15px; border: 1px solid transparent; background: #f0f0f0; margin-bottom: 12px; font-size: 16px; outline: none; transition: 0.3s; font-weight: bold; color: var(--text-main);}
.styled-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(255,143,171,0.2);}
.full-btn { width: 100%; padding: 15px; border-radius: 15px; background: linear-gradient(135deg, var(--accent) 0%, #ff7597 100%); color: white; font-size: 16px; font-weight: bold; box-shadow: 0 6px 15px rgba(255,143,171,0.3);}
.sec-btn { width: 100%; padding: 15px; border-radius: 15px; background: #fff; color: var(--accent); font-size: 16px; font-weight: bold; border: 2px solid var(--accent); box-shadow: 0 4px 10px rgba(255,143,171,0.1); margin-top: 10px;}

#main-app { display: none; width: 100%; height: 100%; flex-direction: column; }
.page { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; padding-bottom: calc(105px + env(safe-area-inset-bottom, 0px)); display: none; width: 100%; will-change: opacity, transform; position: relative;}
.page.active { display: block; animation: pageFadeIn 0.4s ease forwards; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.home-bg { background: linear-gradient(180deg, #e6d8c3 0%, var(--primary-bg) 50%); min-height: 100%; position: relative; display: flex; flex-direction: column;}
.top-bar { display: flex; justify-content: space-between; padding: 25px 20px 10px; align-items: flex-start; z-index: 5;}
.pet-info { display: flex; align-items: center; background: rgba(255,255,255,0.6); padding: 5px 15px 5px 5px; border-radius: 30px; backdrop-filter: blur(10px); box-shadow: var(--shadow-sm);}
.pet-avatar { width: 44px; height: 44px; background: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 26px; margin-right: 12px; }
.pet-status { font-size: 12px; color: #2ecc71; font-weight: bold; margin-top: 2px;}
.stats-container { padding: 0 20px; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; z-index: 5;}
.stat-badge { background: rgba(214, 198, 178, 0.35); padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--text-main); font-weight: bold; display: flex; align-items: center; gap: 4px; backdrop-filter: blur(5px);}

.marquee-wrap { background: rgba(255, 255, 255, 0.75); padding: 8px 15px; margin: 15px 20px 0; border-radius: 20px; box-shadow: var(--shadow-sm); display: none; align-items: center; gap: 8px; font-size: 13px; font-weight: bold; color: #d35400; backdrop-filter: blur(5px); z-index: 5;}

.bird-container { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; margin-top: -20px; z-index: 1; min-height: 250px;}
.bird-display { position: relative; cursor: pointer; user-select: none; transition: 0.2s; }
.bird-display:active { transform: scale(0.95); }

#main-bird { width: 220px; height: 220px; display: flex; justify-content: center; align-items: center; } 
.bird-svg { width: 100%; height: 100%; filter: drop-shadow(0 15px 20px rgba(0,0,0,0.08)); overflow: visible; }

.bird-body { animation: breathe 3s infinite ease-in-out; transform-origin: center 80px; }
@keyframes breathe {
    0%, 100% { transform: scaleX(1) scaleY(1); }
    50% { transform: scaleX(1.02) scaleY(0.96); }
}

.eye { animation: blink 4.5s infinite; }
@keyframes blink {
    0%, 95%, 98%, 100% { transform: scaleY(1); }
    96%, 99% { transform: scaleY(0.1); }
}

.poked-anim .bird-body { animation: happyBounce 0.5s cubic-bezier(0.28, 0.84, 0.42, 1) both !important; }
@keyframes happyBounce {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(0.85, 1.15) translateY(-25px); }
    50% { transform: scale(1.08, 0.92) translateY(5px); }
    70% { transform: scale(0.96, 1.04) translateY(-3px); }
    100% { transform: scale(1) translateY(0); }
}

/* 互动动作2：开心转圈圈 (通过左右翻转压缩模拟) */
  .spin-anim .bird-body { animation: spinAround 0.6s ease-in-out both !important; }
  @keyframes spinAround {
      0% { transform: scaleX(1) scaleY(1); }
      50% { transform: scaleX(-1) scaleY(0.9); }
      100% { transform: scaleX(1) scaleY(1); }
  }

  /* 互动动作3：摇头晃脑 */
  .shake-anim .bird-body { animation: shakeHead 0.5s ease-in-out both !important; }
  @keyframes shakeHead {
      0%, 100% { transform: rotate(0deg); }
      25% { transform: rotate(-15deg); }
      75% { transform: rotate(15deg); }
  }

.equip-layer { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; line-height: 1;}
#equip-head { top: -5px; z-index: 2; font-size: 65px; }
#equip-face { top: 75px; z-index: 3; font-size: 60px;}

.speech-bubble { position: absolute; top: -50px; background: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; color: var(--text-main); font-weight: bold; box-shadow: 0 8px 20px rgba(0,0,0,0.1); opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none; z-index: 10; white-space: nowrap;}
.speech-bubble.show { opacity: 1; transform: translateY(0); }
.speech-bubble::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border-width: 8px 8px 0; border-style: solid; border-color: #fff transparent transparent transparent; }

.fab-interact {
  position: relative;
  margin: 0 auto 40px auto; 
  width: max-content;
  background: linear-gradient(135deg, var(--accent) 0%, #ff7597 100%);
  color: white; padding: 15px 40px; border-radius: 30px; font-size: 18px; font-weight: bold;
  box-shadow: 0 10px 25px rgba(255,143,171,0.4); z-index: 10; display: flex; align-items: center; gap: 10px; letter-spacing: 2px;
}

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px 10px; padding: 10px; }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; font-weight: bold; color: var(--text-main); cursor: pointer;}
.action-icon { width: 50px; height: 50px; background: #fdfaf7; border-radius: 16px; display: flex; justify-content: center; align-items: center; font-size: 24px; transition: transform 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.05);}
.action-btn:active .action-icon { transform: scale(0.9); background: #f0e9e4; }

.diary-bg, .friends-bg, .profile-bg { padding: 25px 20px; min-height: 100%; background-color: var(--pink-bg);}
.friends-bg { background-color: #fdf5f7; }
.date-header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: bold; color: var(--text-main); margin-bottom: 20px; background: rgba(255,255,255,0.7); padding: 12px 18px; border-radius: 20px; backdrop-filter: blur(10px); box-shadow: var(--shadow-sm);}
.card-box { background: var(--white); padding: 20px; border-radius: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px;}
.menu-list { background: var(--white); border-radius: 24px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-sm);}
.menu-item { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f9f9f9; color: var(--text-main); font-size: 15px; font-weight: bold; cursor: pointer; transition: background 0.2s;}
.menu-item:active { background: #f5f5f5; }
.menu-item:last-child { border-bottom: none; }
.logout-btn { justify-content: center; color: #ff6b81; border-bottom: none; background: #fff4f6;}
.user-header { display: flex; flex-direction: row; align-items: center; background: rgba(255,255,255,0.5); padding: 20px; border-radius: 24px; backdrop-filter: blur(5px); box-shadow: var(--shadow-sm); margin-bottom: 25px;}
.user-avatar { width: 65px; height: 65px; min-width: 65px; background: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 32px; margin-right: 18px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);}
.user-info { display: flex; flex-direction: column; align-items: flex-start; justify-content: center;}

.bottom-nav { position: absolute; bottom: 0; width: 100%; height: calc(85px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); display: flex; justify-content: space-around; align-items: flex-start; padding-top: 10px; border-radius: 35px 35px 0 0; box-shadow: 0 -5px 25px rgba(0,0,0,0.05); z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-light); font-size: 11px; font-weight: bold; cursor: pointer; padding: 5px 12px; transition: 0.3s; position: relative; }
.nav-icon { font-size: 24px; margin-bottom: 4px; filter: grayscale(100%); opacity: 0.4; transition: 0.3s; transform: scale(0.9); position: relative;}
.nav-item.active { color: var(--text-main); }
.nav-item.active .nav-icon { filter: grayscale(0%); opacity: 1; transform: scale(1.15) translateY(-2px); }

.badge-dot { display: none; position: absolute; top: -5px; right: -10px; background: #ff4757; color: white; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 10px; line-height: 1; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(255,71,87,0.4); z-index: 10;}

.toast { position: absolute; top: 20%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: rgba(0,0,0,0.85); color: white; padding: 12px 25px; border-radius: 30px; font-size: 14px; font-weight: bold; opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 999; white-space: nowrap; box-shadow: 0 10px 20px rgba(0,0,0,0.15); backdrop-filter: blur(5px);}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.45); backdrop-filter: blur(5px); z-index: 200; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.show { display: flex; opacity: 1; }
.modal-box { background: var(--white); width: 92%; max-width: 360px; border-radius: 32px; padding: 25px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); transform: translateY(30px) scale(0.95); transition: all 0.3s; max-height: 85dvh; overflow-y: auto; display: flex; flex-direction: column;}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 18px; font-weight: bold; color: var(--text-main); flex-shrink: 0;}
.close-btn { background: #f5f5f5; width: 34px; height: 34px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #888; font-weight: bold; cursor: pointer; transition: 0.2s;}
#modal-content-area { display: flex; flex-direction: column; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; } 

.checkin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }
.checkin-day { background: #f9f9f9; border-radius: 16px; padding: 12px 0; text-align: center; color: var(--text-light); font-size: 13px; font-weight: bold; transition: 0.2s; border: 2px solid transparent;}
.checkin-day.claimed { background: #fff4f6; color: var(--accent); }
.checkin-day.today { background: linear-gradient(135deg, var(--accent) 0%, #ff7597 100%); color: white; box-shadow: 0 6px 15px rgba(255,143,171,0.4); transform: scale(1.05);}
.store-item { display: flex; align-items: center; justify-content: space-between; padding: 15px; background: #fafafa; border-radius: 20px; margin-bottom: 12px; border: 1px solid #f0f0f0; transition: 0.2s;}
.buy-btn { background: var(--text-main); color: white; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: bold;}
.gacha-box { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); border-radius: 24px; padding: 30px; text-align: center; color: white; margin-bottom: 20px; box-shadow: 0 10px 20px rgba(161,140,209,0.3);}
.wardrobe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 15px;}
.wardrobe-item { background: #f9f9f9; border-radius: 16px; padding: 15px 0; text-align: center; font-size: 26px; cursor: pointer; transition: 0.2s;}
.wardrobe-item.equipped { border: 2px solid var(--accent); background: #fff4f6; box-shadow: 0 4px 10px rgba(255,143,171,0.2);}
.cert-card { background: linear-gradient(180deg, #fdfbfb 0%, #ebedee 100%); border: 4px solid #ebd4a8; border-radius: 24px; padding: 25px; text-align: center; box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 10px 20px rgba(0,0,0,0.1);}
.rps-btn { font-size: 45px; background: #f9f9f9; border-radius: 50%; width: 70px; height: 70px; display: inline-flex; justify-content: center; align-items: center; margin: 0 5px; box-shadow: var(--shadow-sm);}

.admin-dashboard { background: #fff; padding: 15px; border-radius: 15px; box-shadow: var(--shadow-sm); margin-bottom: 15px; }
.admin-stat { display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding: 8px 0; font-size: 14px;}
.admin-list { max-height: 250px; overflow-y: auto; background: #fafafa; border-radius: 10px; padding: 10px; font-size: 13px;}

.chat-box { flex: 1 1 auto; background: #f5f5f5; border-radius: 20px; padding: 15px; min-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);}
.chat-row { display: flex; flex-direction: column; }
.chat-row.me { align-items: flex-end; }
.chat-row.them { align-items: flex-start; }
.chat-bubble { max-width: 85%; padding: 10px 14px; font-size: 14px; font-weight: bold; line-height: 1.5; word-break: break-all; }
.chat-row.me .chat-bubble { background: linear-gradient(135deg, var(--accent) 0%, #ff7597 100%); color: white; border-radius: 16px 16px 2px 16px; box-shadow: 0 4px 10px rgba(255,143,171,0.2);}
.chat-row.them .chat-bubble { background: white; color: var(--text-main); border-radius: 16px 16px 16px 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.chat-time { font-size: 10px; color: #aaa; margin-bottom: 4px; }
.chat-input-wrapper { display:flex; gap:10px; margin-top:5px; align-items:stretch; flex-shrink:0; padding-bottom: 5px;}

/* ✨ 新增：沉浸式陪伴模式样式 */
.immersive-active .top-bar,
.immersive-active .stats-container,
.immersive-active .marquee-wrap,
.immersive-active .bottom-nav,
.immersive-active .fab-interact,
.immersive-active .speech-bubble {
    opacity: 0 !important; pointer-events: none !important; transition: opacity 0.5s ease;
}
.exit-immersive-btn {
    position: absolute; top: env(safe-area-inset-top, 25px); right: 20px; z-index: 100;
    background: rgba(0,0,0,0.3); color: white; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: bold;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease; cursor: pointer; backdrop-filter: blur(5px);
}
.immersive-active .exit-immersive-btn { opacity: 1; pointer-events: auto; }

/* ✨ 新增：明信片样式 */
.postcard-box { background: #fff9e6; border: 2px dashed #f39c12; border-radius: 15px; padding: 20px; margin-top: 15px; position: relative; }
.postcard-box::before { content: '📮'; position: absolute; top: -15px; right: -10px; font-size: 30px; transform: rotate(15deg); }

/* ✨ 全局高级质感覆写 ✨ */

/* 1. 毛玻璃卡片 */
.card-box, .menu-list, .admin-dashboard {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: 24px;
}

/* 2. 菜单栏优化：去掉生硬的分割线，增加留白 */
.menu-item { border-bottom: 1px solid rgba(0,0,0,0.03); padding: 20px 20px; font-weight: 600;}

/* 3. 按钮高级感：增加渐变光影和弹性阻尼动画 */
.full-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #ff758c 100%);
    box-shadow: 0 8px 20px rgba(255, 77, 109, 0.25);
    border-radius: 16px;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.full-btn:active { transform: scale(0.95); box-shadow: 0 4px 10px rgba(255, 77, 109, 0.15); }

/* 4. 底部导航栏和图标大小重构 */
.bottom-nav { background: rgba(255, 255, 255, 0.85); border-top: 1px solid rgba(255,255,255,0.5); }
.nav-icon { font-size: 26px; margin-bottom: 2px; }
.nav-item.active .nav-icon { color: var(--accent); transform: scale(1.1) translateY(-2px); filter: none; }
.action-icon { font-size: 26px; color: var(--text-main); background: #fff; box-shadow: var(--shadow-sm); }
.action-icon i { color: var(--text-main); }

/* 5. 弹窗极简高级排版 */
.modal-header {
    /* 强制使用高级系统原生无衬线字体 */
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif !important;
    font-size: 19px !important; 
    font-weight: 800 !important; 
    letter-spacing: 1.5px; /* 微微拉开字间距，呼吸感拉满 */
    justify-content: center !important; /* 标题居中显示 */
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* 底部加一条极细的分割线 */
    padding-bottom: 15px;
    margin-bottom: 15px;
}

/* 优化右上角的关闭按钮 */
.close-btn {
    position: absolute;
    right: 0;
    background: transparent !important; /* 去掉原本灰色的廉价圆底 */
    color: #c7c7cc !important; /* 经典的高级浅灰色 */
    font-size: 22px;
}
.close-btn:active { color: var(--accent) !important; }

/* ✨ 修复重叠：强制赋予高级毛玻璃与纯色背景 ✨ */

/* 1. 意见反馈等模态弹窗 */
.modal-box {
    background: var(--card-bg) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15) !important;
}

/* 2. 登录界面的白色卡片 */
.auth-card {
    background: var(--card-bg) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--shadow-md) !important;
    position: relative;
    z-index: 10; /* 确保它盖住底部的所有元素 */
}

/* 3. 修复变成透明字的提示气泡 (Toast) */
.toast { 
    background: rgba(0,0,0,0.85) !important; /* 强制黑色半透明背景 */
    color: #ffffff !important; 
    font-weight: bold !important;
    padding: 14px 28px !important; 
    border-radius: 30px !important; 
    z-index: 99999 !important; /* 提到最高层级，绝对不再被遮挡 */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

/* ✨ 终极修复苹果 iOS/iPad 无法滑动页面 ✨ */

/* 1. 锁死主框架，绝对不许被子元素撑大 */
#main-app {
    height: 100% !important;
    overflow: hidden !important; 
}

/* 2. 强制页面区块内部滚动 (苹果 Safari 救星代码) */
.page {
    flex: 1 1 0% !important; /* 核心魔法：告诉苹果，基础高度是0，必须在内部滚动 */
    height: 0 !important;    /* 双重保险锁死高度 */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important; /* 召唤苹果原生的丝滑橡皮筋回弹滚动 */
    overscroll-behavior-y: contain; /* 防止滚动穿透到底层 */
}

/* 3. 顺手把登录页、弹窗、聊天框的苹果丝滑滚动也开启 */
#auth-screen, .modal-box, .chat-box, .admin-list {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}