/* ==================== 全局样式重置 ==================== */

/* 引入设计系统变量 */
@import './variables.css';

/* 引入动画效果库 */
@import './animations.css';

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 
    'Helvetica Neue', 
    Helvetica, 
    'PingFang SC', 
    'Hiragino Sans GB', 
    'Microsoft YaHei', 
    '微软雅黑', 
    Arial, 
    sans-serif;
  font-size: var(--font-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  overflow-x: hidden;
}

/* ==================== 滚动条美化 ==================== */

/* Webkit 浏览器（Chrome, Safari, Edge）滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background-color: var(--border-dark);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-tertiary);
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) var(--bg-secondary);
}

/* ==================== 链接样式 ==================== */

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== 标题样式 ==================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-5xl); }
h2 { font-size: var(--font-4xl); }
h3 { font-size: var(--font-3xl); }
h4 { font-size: var(--font-2xl); }
h5 { font-size: var(--font-xl); }
h6 { font-size: var(--font-lg); }

/* ==================== 段落样式 ==================== */

p {
  margin: 0;
  padding: 0;
}

/* ==================== 列表样式 ==================== */

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==================== 图片样式 ==================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==================== 表单元素样式 ==================== */

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

/* ==================== 禁止选择样式 ==================== */

.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ==================== 通用动画 ==================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==================== 响应式工具类 ==================== */

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hidden-tablet {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hidden-desktop {
    display: none !important;
  }
}
