/* 自定义样式 */

/* 变量定义 */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --light-color: #f3f4f6;
  --dark-color: #1f2937;
  --transition: all 0.3s ease;
  --star-color: #ffffff;
  --star-color-alt: #a5b4fc;
}

/* 引入自定义字体 */
@font-face {
  font-family: 'Ziti2';
  src: url('../sources/ziti2.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* 全局深空渐变背景 */
.dark-space-bg {
  background: linear-gradient(to bottom, #0a0a0a 0%, #1a1429 40%, #2a1b3d 70%, #0f172a 100%);
  background-attachment: fixed;
  min-height: 100vh;
}



/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* 深色模式滚动条 */
.dark ::-webkit-scrollbar-track {
  background: var(--dark-color);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 淡入动画 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 导航栏滚动效果 */
header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dark header.scrolled {
  background-color: rgba(31, 41, 55, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 卡片悬停效果增强 */
.card-hover {
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮动画 */
.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 100%;
}

/* 表单输入焦点效果 */
.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 404页面样式 */
.error-404 {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.error-404 h1 {
  font-size: 6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-404 h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}