*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f7;
  overflow-x: hidden; /* 防止横向滚动 */
  /* 移动端触摸优化 */
  -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
  -webkit-touch-callout: none; /* 禁用长按菜单 */
  touch-action: manipulation; /* 优化触摸响应 */
}

/* PC端保持hover效果，移动端禁用 */
@media (hover: hover) and (pointer: fine) {
  /* PC端样式 - hover效果正常显示 */
  header .CS2CT:hover {
    opacity: 0.8;
  }
  
  /* PC端其他hover效果保持原样，不需要额外定义 */
}

/* 移动端特定样式 - 使用触摸设备检测 */
@media (max-width: 768px), (hover: none) {
  /* 禁用文本选择（移动端） */
  body,
  * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 允许输入框和文本区域选择 */
  }
  
  input,
  textarea,
  [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* 禁用hover效果（移动端/触摸设备） */
  *:hover {
    /* 移动端不应用hover样式 - 通过媒体查询限制，PC端的hover效果不受影响 */
  }
  
  /* 优化滚动性能 */
  * {
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
  }
  
  /* 优化触摸响应 */
  button,
  a,
  .card,
  .substrate-item,
  .product-item,
  .weaponbox-multiselect-trigger,
  .quality-multiselect-trigger,
  .type-multiselect-trigger,
  .material-ratio-multiselect-trigger,
  .sort-select-trigger,
  .reset-btn,
  .back-btn,
  .alter-links-toggle,
  .detail-toggle-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* 触摸激活状态（移动端） */
  .touch-active {
    opacity: 0.7;
    transform: scale(0.98);
    transition: opacity 0.1s ease, transform 0.1s ease;
  }
}
