/* ==========================================================================
   蓝白色调主题样式系统
   ========================================================================== */

/* CSS自定义属性 - 颜色方案定义 */
:root {
  /* 主要蓝色系 */
  --primary-blue: #4169E1;        /* 主蓝色 (RoyalBlue) */
  --sky-blue: #87CEEB;            /* 天蓝色 (SkyBlue) */
  --deep-blue: #1E90FF;           /* 深蓝色 (DodgerBlue) */
  
  /* 白色系 */
  --pure-white: #FFFFFF;          /* 纯白色 */
  --background-white: #FAFBFC;    /* 背景白 */
  
  /* 文字颜色 */
  --text-dark: #2C3E50;           /* 深色文字 */
  --text-light: #7F8C8D;         /* 浅色文字 */
  
  /* 边框和阴影 */
  --border-color: rgba(135, 206, 235, 0.2);  /* 边框色 */
  --shadow-light: rgba(65, 105, 225, 0.1);   /* 轻阴影 */
  --shadow-medium: rgba(65, 105, 225, 0.2);  /* 中阴影 */
  
  /* 渐变色 */
  --gradient-blue: linear-gradient(45deg, var(--primary-blue), var(--sky-blue));
  --gradient-blue-reverse: linear-gradient(135deg, var(--sky-blue), var(--primary-blue));
  --gradient-deep: linear-gradient(135deg, var(--primary-blue), var(--deep-blue));
  
  /* 间距系统 */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 40px;
  
  /* 圆角系统 */
  --radius-sm: 8px;
  --radius-md: 16px;
  
  /* 字体系统 */
  --font-primary: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* HTML和Body基础设置 */
html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-system);
  background-color: var(--background-white);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 链接重置 */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* 按钮重置 */
button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* 图片和媒体 */
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 列表重置 */
ul,
ol {
  list-style: none;
}

/* 表单元素重置 */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   基础样式
   ========================================================================== */

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

/* 响应式容器边距 */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
}

/* 主要内容区域 */
main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 科技感文字效果 */
.tech-text {
  font-family: var(--font-primary);
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(135, 206, 235, 0.3);
}

/* 发光效果 */
.glow-effect {
  filter: drop-shadow(0 0 10px rgba(135, 206, 235, 0.4));
}

/* 卡片基础样式 */
.card {
  background: var(--pure-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 渐变背景工具类 */
.bg-gradient-blue {
  background: var(--gradient-blue);
}

.bg-gradient-blue-reverse {
  background: var(--gradient-blue-reverse);
}

.bg-gradient-deep {
  background: var(--gradient-deep);
}

/* 文字颜色工具类 */
.text-primary {
  color: var(--primary-blue);
}

.text-sky {
  color: var(--sky-blue);
}

.text-dark {
  color: var(--text-dark);
}

.text-light {
  color: var(--text-light);
}

/* 背景颜色工具类 */
.bg-white {
  background-color: var(--pure-white);
}

.bg-light {
  background-color: var(--background-white);
}

/* ==========================================================================
   页面布局和组件样式
   ========================================================================== */

/* 主容器 */
.main-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xl) 0;
}

/* 网站头部 */
.site-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

/* 科技感主标题 */
.main-title {
  font-family: var(--font-primary);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  position: relative;
  animation: titleSlideIn 1.2s ease-out, titleGlow 3s ease-in-out infinite alternate 1.2s;
}

/* 标题入场动画 */
@keyframes titleSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 标题发光动画 */
@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 10px rgba(135, 206, 235, 0.3));
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.2);
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(65, 105, 225, 0.5));
    text-shadow: 0 0 30px rgba(65, 105, 225, 0.4);
  }
}

/* 标题背景脉动效果 */
.main-title::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(135, 206, 235, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: titlePulse 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes titlePulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
}

/* 标题响应式设计 */
@media (max-width: 768px) {
  .main-title {
    font-size: 36px;
  }
  
  .main-container {
    padding: var(--spacing-md) 0;
  }
  
  .site-header {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 28px;
  }
}

/* 工具展示区域 */
.tools-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--spacing-xl);
}

@media (max-width: 768px) {
  .tools-section {
    padding: 0 var(--spacing-sm);
  }
}

/* 网站底部 */
.site-footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  margin-top: auto;
}

/* 作者信息 */
.author-info {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 400;
  color: var(--sky-blue);
  margin: 0;
  text-shadow: 0 0 10px rgba(135, 206, 235, 0.3);
}

/* ==========================================================================
   动画性能优化
   ========================================================================== */

/* GPU加速 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

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

/* ==========================================================================
   可访问性增强
   ========================================================================== */

/* 焦点样式 */
:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --border-color: rgba(65, 105, 225, 0.5);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
  }
}

/* 屏幕阅读器专用内容 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* ===
=======================================================================
   工具卡片样式
   ========================================================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.tool-card {
  --tool-color: var(--primary-blue);
  
  background: var(--pure-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  
  /* 悬浮效果 */
  box-shadow: 0 2px 8px var(--shadow-light);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-medium);
  border-color: var(--tool-color);
}

.tool-card:focus {
  outline: 2px solid var(--tool-color);
  outline-offset: 2px;
}

.tool-card.clicking {
  transform: translateY(-2px) scale(0.98);
}

/* 工具卡片图标区域 */
.icon-area {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
}

.tool-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tool-color);
  font-size: 32px;
}

.tool-icon svg {
  width: 100%;
  height: 100%;
  color: var(--tool-color);
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.tool-icon .default-icon {
  width: 100%;
  height: 100%;
  background: var(--tool-color);
  color: var(--pure-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
}

/* 工具卡片内容 */
.card-content {
  text-align: center;
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 var(--spacing-xs) 0;
  line-height: 1.3;
}

.tool-description {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0 0 var(--spacing-sm) 0;
}

.tool-category {
  display: inline-block;
  background: rgba(var(--tool-color), 0.1);
  color: var(--tool-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.featured-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--gradient-blue);
  color: var(--pure-white);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 空状态和错误状态 */
.empty-state,
.error-state,
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-light);
}

.empty-icon,
.error-icon,
.no-results-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

.empty-state h3,
.error-state h3,
.no-results h3 {
  color: var(--text-dark);
  margin: 0 0 var(--spacing-xs) 0;
}

.retry-button {
  background: var(--gradient-blue);
  color: var(--pure-white);
  border: none;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  margin-top: var(--spacing-sm);
  transition: transform 0.2s ease;
}

.retry-button:hover {
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: 1fr;
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }
  
  .tool-card {
    padding: var(--spacing-sm);
  }
  
  .tool-icon {
    width: 48px;
    height: 48px;
  }
  
  .tool-title {
    font-size: 1.1rem;
  }
  
  .tool-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    padding: var(--spacing-xs);
  }
  
  .featured-badge {
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    padding: 2px 6px;
    font-size: 0.6rem;
  }
}