/* ========================================
   Base CSS - 基础全局样式
   所有魔法数字已替换为 variables.css 变量
   ======================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ---- 文字工具类 ---- */
.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-hint      { color: var(--color-text-hint); }

.text-center { text-align: center; }
.text-left   { text-align: left; }

/* ---- 通用过渡 ---- */
.transition-base {
  transition: all var(--transition-base);
}

/* ---- 隐藏滚动条但保留滚动功能 ---- */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---- 选中样式 ---- */
::selection {
  background-color: var(--color-selection);
  color: var(--color-text-primary);
}

/* ========================================
   移动端原生行为控制
   让页面表现更接近原生 APP
   ======================================== */

/* 禁止整个页面的弹性滚动（iOS bounce） */
html {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100%;
}

body {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* 禁止所有元素的默认触摸高亮 */
* {
  -webkit-tap-highlight-color: transparent;
}

/* 禁止用户选中文字（模拟原生APP不可选中） */
.phone-shell {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 允许输入框和可编辑区域选中文字 */
.phone-shell input,
.phone-shell textarea,
.phone-shell [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 禁止长按触发系统菜单（图片保存、链接预览等） */
.phone-shell img,
.phone-shell a,
.phone-shell .app-item,
.phone-shell .dock-item {
  -webkit-touch-callout: none;
}

/* 禁止拖拽图片 */
.phone-shell img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

/* 触摸操作：只允许平移（滚动），禁止双指缩放 */
.phone-shell {
  touch-action: pan-y;
}

/* 页面内滚动容器使用惯性滚动 */
.phone-screen {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
