/* CSS变量定义 - 亮色主题 */
:root {
  /* 主色调 - 暖色系 */
  --primary-orange: #ff6b35;
  --primary-pink: #ff8cc8;
  --primary-yellow: #ffd23f;
  --primary-purple: #8b5cf6;
  
  /* 背景色 */
  --bg-primary: #fefefe;
  --bg-secondary: #f8f9fa;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  
  /* 文字颜色 */
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  
  /* 边框和阴影 */
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.16);
  
  /* 渐变背景 */
  --gradient-bg: linear-gradient(135deg, #ff6b35 0%, #ff8cc8 25%, #ffd23f 50%, #8b5cf6 75%, #ff6b35 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 200, 0.1) 100%);
}

/* 暗色主题 */
[data-theme="dark"] {
  /* 背景色 */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: rgba(30, 30, 30, 0.8);
  --bg-card-hover: rgba(40, 40, 40, 0.95);
  
  /* 文字颜色 */
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  
  /* 边框和阴影 */
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  /* 渐变背景 - 暗色版本 */
  --gradient-bg: linear-gradient(135deg, #ff6b35 0%, #ff8cc8 25%, #ffd23f 50%, #8b5cf6 75%, #ff6b35 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(255, 140, 200, 0.05) 100%);
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  background-image: var(--gradient-bg);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  border: none;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-medium);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-heavy);
}

.theme-icon {
  font-size: 24px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(180deg);
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* 头部区域 */
.header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px 20px;
}

.hero-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 20px 40px;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-card);
  opacity: 0.5;
  z-index: -1;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 20px;
}

.avatar-container {
  flex-shrink: 0;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--gradient-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-medium);
  animation: float 3s ease-in-out infinite;
}

.hero-text {
  flex: 1;
  text-align: left;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.site-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.site-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-weight: 400;
}

.personal-info {
  margin-top: 24px;
  padding: 0;
  background: transparent;
  border: none;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* 分类导航 */
.category-nav {
  display: none; /* 隐藏分类导航，但保留代码 */
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 20px;
}

.category-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.category-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  color: var(--text-primary);
}

.category-btn.active {
  background: var(--primary-orange);
  color: white;
  box-shadow: var(--shadow-medium);
}

/* 工具网格 */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0 20px;
  justify-content: flex-start;
}

/* 工具卡片 */
.tool-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  flex: 0 0 calc(33.333% - 16px);
  min-width: 280px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
  background: var(--bg-card-hover);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin-right: 16px;
  box-shadow: var(--shadow-light);
}

.tool-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.tool-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-tag {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.tool-tag.free {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

.tool-tag.paid {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.2);
}

.tool-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.click-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.click-count::before {
  content: '👆';
}

/* 页脚 */
.footer {
  text-align: center;
  margin-top: 80px;
  padding: 40px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--primary-orange);
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .hero-section {
    padding: 30px 20px;
    margin: 20px 0;
  }
  
  .hero-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .hero-text {
    text-align: center;
  }
  
  .site-title {
    font-size: 2.5rem;
  }
  
  .tools-grid {
    flex-direction: column;
    padding: 0 10px;
  }
  
  .tool-card {
    flex: 1 1 100%;
    min-width: auto;
  }
  
  .category-nav {
    padding: 0 10px;
  }
  
  .category-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 2rem;
  }
  
  .tools-grid {
    flex-direction: column;
  }
  
  .tool-card {
    flex: 1 1 100%;
    min-width: auto;
  }
  
  .category-nav {
    gap: 8px;
  }
  
  .category-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* 工具卡片动画效果 */
.tool-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}