* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.02) 0, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.02) 0, transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.01) 0, transparent 30%);
  background-attachment: fixed;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.6);
}
::-webkit-scrollbar-corner {
  background: 0 0;
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
}
.sortable-th:hover {
  background-color: var(--bg-readonly);
}
.sort-icons {
  display: inline-flex;
  flex-direction: column;
  margin-left: 4px;
  vertical-align: middle;
  gap: 1px;
}
.sort-icon-down,
.sort-icon-up {
  width: 10px;
  height: 6px;
  display: inline-block;
  transition: opacity 0.2s;
  opacity: 0.3;
  color: var(--text-secondary);
}
.sort-icon-down.active,
.sort-icon-up.active {
  opacity: 1;
  color: var(--primary);
}
.sort-icon-up::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid currentColor;
}
.sort-icon-down::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}

/* 长文本缩略显示样式 */
.truncate-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  max-width: 100%;
}

.truncate-toggle {
  padding: 2px 8px;
  font-size: 12px;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.truncate-toggle:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
}

/* 移动端通用优化 */
@media (max-width: 768px) {
  /* 禁止横向滚动 */
  body {
    overflow-x: hidden;
  }

  /* 触摸优化：增大点击区域 */
  button,
  .btn,
  a,
  input,
  select,
  textarea {
    min-height: 44px; /* iOS推荐的最小触摸目标尺寸 */
  }

  /* 防止文本选择干扰触摸操作 */
  .btn,
  button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  /* 优化表单元素在移动端的显示 */
  input,
  select,
  textarea {
    font-size: 16px; /* 防止iOS自动缩放 */
  }

  /* 优化图片响应式 */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* 小屏幕手机进一步优化 */
@media (max-width: 480px) {
  /* 减小内边距 */
  .card-body,
  .page-content {
    padding: 12px;
  }

  /* 优化长文本显示 */
  .truncate-text {
    max-width: 200px;
  }
}
