/* ==========================================================================
   全局基础样式
   ========================================================================== */

/* 1. 基础样式重置与设置 */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1D2129;
  background-color: #F5F7FA;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 2. 容器与布局 */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 3. 自定义滚动条（Webkit浏览器） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F5F7FA;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #C9CDD4;
  border-radius: 4px;
  transition: background-color 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: #86909C;
}

/* 4. 选择文本样式 */
::selection {
  background-color: rgba(22, 93, 255, 0.2);
  color: #1D2129;
}

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

/* 6. 链接样式 */
a {
  color: #165DFF;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #0E42D4;
  text-decoration: underline;
}

/* ==========================================================================
   工具类（Utility Classes）
   ========================================================================== */

/* 内容可见性优化 */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* 文本平衡（带回退） */
.text-balance {
  text-wrap: balance;
}

/* 现代浏览器不支持时的回退 */
@supports not (text-wrap: balance) {
  .text-balance {
    text-wrap: pretty;
  }
}

/* 平滑过渡 */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隐藏滚动条但保持功能 */
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ==========================================================================
   组件样式
   ========================================================================== */

/* 卡片组件 */
.card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-hover:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* 导航栏滚动效果 */
.navbar-scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 按钮基础样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: #165DFF;
  color: white;
}

.btn-primary:hover {
  background-color: #0E42D4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

/* ==========================================================================
   动画效果
   ========================================================================== */

/* 计数动画 */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.counter {
  animation: countUp 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.2s;
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   Drupal特定样式修复
   ========================================================================== */

/* 修复Drupal管理工具栏冲突 */
.toolbar-oriented .navbar-scrolled {
  top: 39px !important;
}

/* 响应式表格 */
table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background-color: #F5F7FA;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
}

table td {
  padding: 0.75rem;
  border-top: 1px solid #E5E6EB;
}

/* 表单元素 */
input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #C9CDD4;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #165DFF;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

/* ==========================================================================
   响应式断点
   ========================================================================== */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .navbar-scrolled {
    padding: 0.5rem 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
  }
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}