/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 导航栏滚动效果 */
#navbar {
  transition: all 0.3s ease;
}

#navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

/* 卡片悬停效果 */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 渐变背景动画 */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* 数字滚动效果 */
.counter {
  display: inline-block;
  transition: all 0.3s ease;
}

/* 表单样式优化 */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.1);
}

/* 按钮波纹效果 */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

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

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #0A4D8C;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #003366;
}

/* 加载动画 */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading {
  animation: spin 1s linear infinite;
}

/* 成功/错误消息样式 */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .text-responsive {
    font-size: 0.9rem;
  }
  
  .padding-responsive {
    padding: 1rem;
  }
}

/* 打印样式 */
@media print {
  nav,
  footer,
  #back-to-top,
  .no-print {
    display: none !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  body {
    font-weight: 500;
  }
}

/* 深色模式准备（可选） */
@media (prefers-color-scheme: dark) {
  /* 深色模式样式可以在这里添加 */
}

/* 焦点可见性优化（无障碍） */
:focus-visible {
  outline: 3px solid #E63946;
  outline-offset: 2px;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hero区波浪效果优化 */
#hero svg {
  display: block;
}

/* 卡片阴影层次 */
.shadow-layered {
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-layered:hover {
  box-shadow: 
    0 14px 28px rgba(0, 0, 0, 0.15),
    0 10px 10px rgba(0, 0, 0, 0.12);
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, #0A4D8C 0%, #E63946 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 数据卡片脉冲效果 */
@keyframes dataPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.data-card:hover {
  animation: dataPulse 2s ease-in-out infinite;
}

/* 表单提交加载状态 */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* 固定定位元素的平滑过渡 */
.fixed-element {
  will-change: transform;
  backface-visibility: hidden;
}

/* 优化长文本显示 */
.text-balance {
  text-wrap: balance;
}

/* 图标旋转动画 */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-rotate:hover {
  animation: rotate 0.6s ease-in-out;
}

/* 链接下划线动画 */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #E63946;
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}
