/* ===== H5 中转页样式（渐变背景 + 毛玻璃 + 紧凑 UI + 动画）===== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 渐变背景 (PREFERENCE_11) */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-attachment: fixed;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

#app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

/* ===== 毛玻璃卡片 (PREFERENCE_12) ===== */
.glass-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

/* backdrop-filter 降级 */
@supports not (backdrop-filter: blur(12px)) {
  .glass-card { background: rgba(255, 255, 255, 0.88); color: #333; }
  .glass-card .gc-title { color: #333; }
  .glass-card .gc-desc { color: #555; }
}

/* 边缘描线动画 (PREFERENCE_11) */
.glass-card::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 18px;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.6) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: edge-flow 3s linear infinite;
  z-index: -1;
  pointer-events: none;
}
@keyframes edge-flow {
  0% { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

/* ===== 花瓣飘落动画 (PREFERENCE_11) ===== */
.petal {
  position: fixed;
  top: -20px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 100% 0 100%;
  pointer-events: none;
  z-index: 0;
  animation: petal-fall linear infinite;
}
@keyframes petal-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ===== 卡片内元素 ===== */
.gc-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.gc-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: #fff; }
.gc-desc { font-size: 12px; opacity: 0.85; margin: 0 0 16px; color: #fff; line-height: 1.5; }

/* 操作区（初始隐藏，200ms 后显示） */
.action-area { display: none; animation: fade-in 0.4s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 主按钮 */
.btn-primary {
  display: block;
  width: 100%;
  height: 36px;
  margin: 8px 0;
  padding: 0 16px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.35);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: block;
  width: 100%;
  height: 36px;
  margin: 8px 0;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-secondary:active { transform: scale(0.97); }

/* 二维码容器 */
#qrcode-box {
  display: flex; align-items: center; justify-content: center;
  width: 180px; height: 180px;
  margin: 12px auto;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}
#qrcode-box img, #qrcode-box canvas { display: block; }

/* 纯文本兜底输入框 */
.tf-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  margin: 8px 0;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

/* ===== 居中模态 (PREFERENCE_6) ===== */
#modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
}
.modal-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  max-width: 320px;
  width: 88%;
}
.modal-box .glass-card { max-width: none; }

/* 居中轻提示 toast */
.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== 底部固定操作区 (PREFERENCE_10) ===== */
#bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
@supports not (backdrop-filter: blur(12px)) {
  #bottom-bar { background: rgba(30, 30, 50, 0.92); }
}
#bottom-bar .bb-btn {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}
#bottom-bar .bb-btn:active { transform: scale(0.97); }
#bottom-bar .bb-btn.primary { background: #07c160; color: #fff; }
#bottom-bar .bb-btn.secondary { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
#bottom-bar .bb-row { display: flex; gap: 10px; }

/* SSL 安全提示条 */
.ssl-bar {
  width: 100%;
  padding: 6px 12px;
  background: rgba(7, 193, 96, 0.12);
  border-bottom: 1px solid rgba(7, 193, 96, 0.2);
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  text-align: center;
  position: relative;
  z-index: 2;
}

/* 可访问性：减少动画 */
@media (prefers-reduced-motion: reduce) {
  .petal, .glass-card::before { animation: none; }
  .action-area { animation: none; }
}