/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  color: rgba(0, 0, 0, 0.87);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 防止溢出 */
.ant-layout {
  overflow-x: hidden;
}

/* 视频相关 */
video {
  max-width: 100%;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(24, 144, 255, 0.2);
  border-radius: 6px;
  transition: background-color 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(24, 144, 255, 0.4);
}

/* 暗色模式滚动条 */
body.dark-mode ::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode ::-webkit-scrollbar-track {
  background-color: rgba(255, 255, 255, 0.03);
}

/* 公共动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 加载动画 */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

body.dark-mode .page-loading {
  background-color: rgba(0, 0, 0, 0.7);
}

/* 丝滑动画效果 */
.ant-card, 
.ant-btn, 
.ant-input, 
.ant-select, 
.ant-dropdown, 
.ant-modal,
.ant-notification,
.ant-message {
  animation: fadeIn 0.3s;
}

.ant-list-item, 
.ant-table-row, 
.ant-collapse-item, 
.ant-menu-item {
  animation: slideUp 0.3s;
}

/* 卡片悬浮效果 */
.ant-card-hoverable {
  transition: transform 0.3s, box-shadow 0.3s;
}

.ant-card-hoverable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.dark-mode .ant-card-hoverable:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* 页面内容淡入效果 */
.ant-layout-content > div {
  animation: fadeIn 0.5s;
}

/* 按钮点击波纹效果增强 */
.ant-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 0 6px currentColor;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ant-btn:active::after {
  opacity: 0.2;
  box-shadow: 0 0 0 0 currentColor;
  transition: 0s;
}

/* 文字选中效果 */
::selection {
  background-color: rgba(30, 136, 229, 0.2);
  color: #1E88E5;
}

body.dark-mode ::selection {
  background-color: rgba(30, 136, 229, 0.4);
  color: #90CAF9;
}

/* 暗色模式适配 */
body.dark-mode {
  background-color: #121212;
  color: rgba(255, 255, 255, 0.87);
}