@tailwind base;
@tailwind components;
@tailwind utilities;

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* 字体默认阿里字体 */
  font-family: 'Alibaba';
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

@font-face {
  font-family: "Alibaba";
  src: url("http://oss.boxnova.net/webSource/fonts/AlibabaPuHuiTi-3-55-RegularL3.ttf") format("truetype");
}

.page-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(148, 144, 220, 0.25);
  border-top-color: #9490dc;
  border-radius: 50%;
  animation: page-loading-spin 0.8s linear infinite;
}

@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}

/* 项目级加载鼠标：紫色品牌环 + 保留指针热点，统一替代系统 wait/progress。 */
.app-loading-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483647;
  width: 31px;
  height: 31px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 80ms ease;
  will-change: transform, opacity;
}

.app-loading-cursor__pointer {
  position: absolute;
  top: 0;
  left: 0;
  filter: drop-shadow(0 1px 2px rgba(49, 39, 102, 0.24));
}

.app-loading-cursor__spinner {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 2px solid rgba(159, 155, 231, 0.34);
  border-top-color: #6f5bd3;
  border-right-color: #9f9be7;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.82),
    0 2px 7px rgba(111, 91, 211, 0.32);
  animation: app-loading-cursor-spin 680ms linear infinite;
}

[data-loading-cursor='true'] {
  cursor: wait !important;
}

/* 指针尚未移动定位时保留系统 progress，避免键盘触发任务后鼠标消失。 */
html[data-app-loading='true'],
html[data-app-loading='true'] * {
  cursor: progress !important;
}

html.app-loading-cursor-positioned[data-app-loading='true'],
html.app-loading-cursor-positioned[data-app-loading='true'] *,
html.app-loading-cursor-hover,
html.app-loading-cursor-hover * {
  cursor: none !important;
}

html.app-loading-cursor-positioned[data-app-loading='true'] .app-loading-cursor,
html.app-loading-cursor-hover .app-loading-cursor {
  opacity: 1;
}

@keyframes app-loading-cursor-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-cursor {
    transition: none;
  }

  .app-loading-cursor__spinner {
    animation: none;
    border-color: #9f9be7;
    border-top-color: #6f5bd3;
  }
}


/* 全局滚动条样式（Webkit 浏览器） */
::-webkit-scrollbar {
  flex-shrink: 1;
  width: 6px; /* 垂直滚动条宽度 */
  height: 6px; /* 水平滚动条高度 */
}
::-webkit-scrollbar-track {
  background: #EBEBEB; /* 轨道颜色 */
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #D8DDFA; /* 滑块颜色 */
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9F9BE7; /* 鼠标悬停时的滑块颜色 */
}

