/* 禁止双指缩放 / 双击缩放（覆盖 iPhone Safari 对 user-scalable=no 的忽略） */
html, body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}
* {
  -webkit-touch-callout: none; /* iOS：长按不弹系统菜单 */
  -webkit-user-select: none;   /* iOS/WebKit：长按不选中文本 */
  user-select: none;           /* 现代浏览器：禁用文本选中 */
}
/* 允许输入框/文本域内选择文字（否则无法编辑复制）。
   必须同时覆盖 antd 的外层容器（.ant-input/.ant-input-number 等），
   否则容器继承 * 的 user-select:none 在部分 WebKit 内核会传染到内部输入框，
   导致光标能点进去却无法选中/删除/写入。 */
input, textarea,
.ant-input,
.ant-input-affix-wrapper,
.ant-input-number,
.ant-input-number-input,
.ant-input-number-input-wrap,
.ant-picker-input,
.ant-picker-input input,
.ant-select-selection-search-input,
.ant-select-selection-item,
.ant-select-dropdown .ant-select-item,
.ant-form-item-control-input input,
.ant-input[type='text'],
.ant-input[type='password'],
.ant-input[type='number'] {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* 启动加载屏：纯 HTML/CSS，浏览器解析 HTML 即刻绘制，
   消除 JS bundle 下载/解析前的白屏。App 启动完成后淡出移除。 */
.app-boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(160deg, #eef5ff 0%, #e3eeff 100%);
  overflow: hidden;
  z-index: 1;
}
/* #root 始终压在 loader 之上；启动完成后 React 会移除 loader，
   即使移除前 app/error 内容也已能正常显示 */
#root {
  position: relative;
  z-index: 2;
}
/* 启动完成后的淡出移除 */
.app-boot.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}
.app-boot-logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 扩散光晕 + 中心红点：CSS transform/opacity 动画（合成线程），
   首屏 JS 大包解析/编译阻塞主线程期间也持续呼吸，不会「卡住不动」。 */
.app-boot-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: app-boot-ring 2.2s ease-out infinite;
}
.app-boot-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: app-boot-core 1.6s ease-in-out infinite;
}
@keyframes app-boot-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes app-boot-core {
  0%, 100% { transform: scale(0.78); opacity: 0.75; }
  50%      { transform: scale(1.25); opacity: 1; }
}
.app-boot-title { color: #0f2942; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.app-boot-tip { color: #5b6b7f; font-size: 13px; letter-spacing: 1px; }
/* 真实进度条：宽度由 src/lib/bootProgress.ts 按「启动真实阶段」写入，
   取代原先无限循环、不反映真实进度的空转滑块。阶段之间用 rAF 缓动补间平滑收敛。 */
.app-boot-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 220px;
}
.app-boot-progress {
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(22, 119, 255, 0.16);
  overflow: hidden;
}
.app-boot-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  /* 初始值 = HTML/CSS 解析完成（10%），随后由 bootProgress 按真实阶段推进到 100% */
  width: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1677ff 0%, #409FFF 100%);
  box-shadow: 0 0 8px rgba(22, 119, 255, 0.5);
}
/* 百分比数字：等宽数字（tabular-nums）避免数值增长时左右抖动 */
.app-boot-progress-pct {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: right;
  color: #1677ff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* 背景光晕：与登录页一致的缓慢呼吸浮动，提升层次（蓝调适配启动屏底） */
.app-boot-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
}
.app-boot-orb-a {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle at 30% 30%, rgba(22, 119, 255, 0.28), rgba(22, 119, 255, 0) 70%);
  animation: app-boot-orb-a 11s ease-in-out infinite;
}
.app-boot-orb-b {
  width: 300px;
  height: 300px;
  bottom: -120px;
  right: -100px;
  background: radial-gradient(circle at 70% 70%, rgba(64, 169, 255, 0.24), rgba(64, 169, 255, 0) 70%);
  animation: app-boot-orb-b 13s ease-in-out infinite;
}
@keyframes app-boot-orb-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(26px, 22px) scale(1.12); }
}
@keyframes app-boot-orb-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-22px, -18px) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .app-boot-ring, .app-boot-core, .app-boot-orb-a, .app-boot-orb-b { animation: none; }
}
