/* ====================================================
   🌟 当人类群星闪耀时 - 优化版主页CSS
   专为提升转化率与用户体验设计
   版本: 3.0 | 日期: 2025-12-18
==================================================== */


/* ====================
   1. 基础重置与全局设置
==================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
  background: var(--primary);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* 为固定导航栏留出空间 */
}

/* 滚动时的透明度变化 */
.fade-on-scroll {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-on-scroll.scrolled {
  opacity: 0.8;
  transform: translateY(10px);
}

/* 滚动时显示元素的动画 */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 通知动画 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideInRight 0.4s ease, fadeOut 0.4s ease 3s forwards;
  transform-origin: top right;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* 通知类型变体 */
.notification.success {
  background-color: #10b981;
  color: white;
}

.notification.error {
  background-color: #ef4444;
  color: white;
}

.notification.warning {
  background-color: #f59e0b;
  color: white;
}

.notification.info {
  background-color: var(--primary);
  color: white;
}

/* 骨架屏动画增强 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 点击反馈效果 */
.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable:active {
  transform: scale(0.97);
}

/* 切换按钮动画 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  transform: scale(0.8);
}

input:checked + .toggle-slider {
  background-color: var(--primary);
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px) scale(1);
}

/* 复选框和单选按钮样式 */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-sm);
  margin-right: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  vertical-align: middle;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background-color: white;
  border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 进度条样式 */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary);
}

/* 保持白色文字按钮链接hover时不被全局a:hover覆盖 */
a.text-white:hover {
  color: white;
}

a:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

nav a:hover {
  color: var(--primary);
}

/* 移动端菜单容器 */
#mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  z-index: 50;
}

#mobile-menu:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 移动端菜单链接 */
#mobile-menu a {
  display: block;
  padding: 1rem 1.5rem;
  margin: 0.25rem 0.5rem;
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1rem;
  line-height: 1.5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#mobile-menu a:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* 移动端按钮样式 */
#mobile-menu button {
  margin: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 移动端优化 */
@media (max-width: 768px) {
  /* 增大触摸目标 */
  button,
  a,
  .btn,
  .clickable,
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* 优化滚动体验 */
  body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 优化表单元素 */
  input,
  select,
  textarea {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    touch-action: manipulation;
  }
  
  /* 优化搜索框 */
  .bg-white.rounded-full.shadow-xl {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
    border-radius: 1rem;
  }
  
  .bg-white.rounded-full.shadow-xl input {
    width: 100%;
  }
  
  .bg-white.rounded-full.shadow-xl button {
    width: 100%;
    margin: 0;
  }
  
  /* 移动端卡片 */
  .card-hover:hover {
    box-shadow: var(--shadow-lg);
  }
  
  /* 优化标签交互 */
  .tag-hover {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }
  
  /* 优化导航栏 */
  header {
    padding: 0.75rem 1rem;
  }
  
  /* 优化移动端菜单按钮 */
  #mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
  }
  
  #mobile-menu-btn:hover {
    background-color: var(--primary-light);
  }
  
  #mobile-menu-btn:active {
    transform: scale(0.95);
  }
}

/* 极小屏幕优化 */
@media (max-width: 360px) {
  /* 进一步简化布局 */
  .hero {
    padding-top: 80px;
    padding-bottom: 40px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* 简化导航 */
  #mobile-menu a {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
}

/* JavaScript 禁用时的警告样式 */
.noscript-warning {
  background-color: #fffbeb;
  border-left-color: #f59e0b;
  color: #92400e;
  font-family: inherit;
}

.noscript-warning button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  width: auto;
  min-width: auto;
}

/* 确保noscript警告不会被其他样式覆盖 */
.noscript-warning {
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
}

/* 渐进式增强：无JavaScript时的表单样式 */
.no-js form {
  max-width: 100%;
}

.no-js button {
  cursor: pointer;
}

/* 确保关键内容在无JS时正常显示 */
.no-js .scroll-reveal {
  opacity: 1 !important;
  transform: none !important;
  display: block !important;
}

/* 无JS时的导航菜单样式 */
.no-js #mobile-menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  display: none;
}

.no-js #mobile-menu:not(.hidden) {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ====================
   2. 设计变量（CSS Variables）
==================== */

:root {
  /* 颜色变量 - 与Tailwind配置同步 */
  --primary: #165DFF;
  --secondary: #FF7D00;
  --dark: #1D2939;
  --light: #F9FAFB;
  --primary-dark: #0D4FD6;
  --primary-light: #E8F3FF;
  --secondary-light: #FFF3E0;
  --gray: #6B7280;
  
  /* 渐变背景变量 */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, #0A2463 100%);
  --gradient-secondary: linear-gradient(90deg, var(--primary), var(--secondary));
  --gradient-hero: linear-gradient(135deg, rgba(44, 62, 80, 0.85), rgba(142, 68, 173, 0.85));
  --gradient-btn-hover: linear-gradient(135deg, #1a2530, #6a3085);
  
  /* 过渡变量 */
  --transition: all 0.3s ease;
  
  /* 边框半径变量 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* 阴影变量 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* 交互反馈变量 */
  --hover-scale: 1.03;
  --hover-y: -5px;
  --focus-ring: none;
  --focus-ring-dark: none;
  --ripple-speed: 0.6s;
  --ripple-color: rgba(255, 255, 255, 0.5);
}

/* 卡片悬停效果已在上方定义 */



/* 按钮悬停效果 */
.btn-hover {
  transition: box-shadow 0.3s ease;
}
.btn-hover:hover {
  box-shadow: var(--shadow-md);
}

/* 实心蓝色按钮hover：深蓝底白字 */
a.bg-primary:hover,
button.bg-primary:hover,
.hover\:bg-primary\/90:hover {
  background-color: var(--primary-dark) !important;
}

/* 描边蓝色按钮hover：反色为蓝底白字 */
.hover\:bg-primary-light:hover {
  background-color: var(--primary) !important;
  color: white !important;
}

/* 波纹效果 */
.ripple-effect {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--ripple-color);
  transform: translate(-50%, -50%);
  transition: width var(--ripple-speed), height var(--ripple-speed);
  pointer-events: none;
}

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

/* 主要按钮样式 */
button {
  transition: all 0.3s ease;
}

button:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 表单元素增强 */
input, select, textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--primary);
}

/* 星空背景 */
.star-pattern {
  background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* 输入框聚焦效果 */
.input-focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.25);
}
.input-focus:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.3);
  border-color: var(--primary);
}

/* 卡片悬停效果 */
.card-hover {
  transition: box-shadow 0.3s ease;
}
.card-hover:hover {
  box-shadow: var(--shadow-lg);
}

/* 标签悬停效果 */
.badge-hover {
  transition: all 0.3s ease;
}
.badge-hover:hover {
  background-color: var(--primary);
  color: white;
}

/* 标签悬停效果 */
.tag-hover {
  transition: all 0.3s ease;
}
.tag-hover:hover {
  box-shadow: var(--shadow-md);
}

/* 星级评分动画 */
.star-rating .fa-star,
.star-rating .fa-star-half-o,
.star-rating .fa-star-o {
  transition: transform 0.2s ease;
}

.star-rating:hover .fa-star,
.star-rating:hover .fa-star-half-o,
.star-rating:hover .fa-star-o {
  transform: scale(1.1);
}



/* 基础动画 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* 加载动画样式 */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误消息样式 */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid #f5c6cb;
}

/* 基础淡入动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 滚动渐显动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* 响应式标题 */
.responsive-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

/* 文字阴影 */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 卡片分隔线 */
.card-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin: 1rem 0;
}

/* 渐变背景 */
.gradient-bg {
  background: var(--gradient-primary);
}



/* 任务卡片的行限制 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ====================
   3. 字体与排版系统
==================== */

h1 {
  font-size: 3.2rem;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 2.2rem;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--dark);
}

h3 {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--dark);
}

p {
  margin-bottom: 1.2rem;
  color: var(--gray);
  font-size: 1.05rem;
}

.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.pt-2 { padding-top: 2rem; }
.pt-3 { padding-top: 3rem; }
.pt-4 { padding-top: 4rem; }
.pb-2 { padding-bottom: 2rem; }
.pb-3 { padding-bottom: 3rem; }
.pb-4 { padding-bottom: 4rem; }

/* ====================
   4. 头部导航栏 (优化版)
==================== */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  padding: 0.8rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#navbar a:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 移除固定颜色，允许HTML中的渐变效果 */
}

/* 修复logo动画 */
@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

#navbar .fa-star-o {
  animation: twinkle 3s infinite ease-in-out;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--dark);
  padding-bottom: 4px;
  font-size: 1.05rem;
}

.nav-links a:hover {
  color: var(--secondary);
}

.auth-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ====================
   5. 首页 Banner 区域 (全面优化)
==================== */

.hero {
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  text-align: center;
  padding-top: 80px;
  background: var(--gradient-hero), 
              url('https://picsum.photos/id/1036/1600/1000') no-repeat center center;
  background-size: cover;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero h1 {
  color: white;
  max-width: 800px;
  margin: 0 auto 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.4rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  opacity: 0.9;
  font-weight: 300;
}

.search-container {
  max-width: 700px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 1.3rem 1.8rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
  font-weight: 500;
}

.search-bar:focus {
  outline: none;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
}

.tags {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.tags span {
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 1.05rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  cursor: pointer;
  font-weight: 500;
}

.tags span:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ====================
   6. 数据统计模块 (全新设计)
==================== */

.stats {
  padding: 4rem 0;
  background: white;
  position: relative;
  z-index: 5;
  margin-top: -50px;
}

.stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-secondary);
}

.stats h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-secondary);
}

.stat-card strong {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.8rem;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  line-height: 1.1;
}

.stat-card p {
  font-size: 1.25rem;
  color: var(--gray);
  font-weight: 500;
  margin: 0;
}

/* ====================
   7. 推荐任务卡片 (全面重构)
==================== */

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.3rem;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-secondary);
  border-radius: 2px;
}

.section-header p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--gray);
  font-size: 1.15rem;
}

.recommended-tasks {
  padding: 4.5rem 0;
  background: #fafbfc;
}

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.filters select {
  padding: 0.9rem 1.3rem;
  border: 1px solid #e0e6ed;
  border-radius: var(--radius-md);
  min-width: 180px;
  font-size: 1rem;
  background-color: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.filters select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.filter-button {
  background: var(--gradient-secondary);
  color: white;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.05rem;
}

.filter-button:hover {
  box-shadow: var(--shadow-md);
}

.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.task-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.task-card:hover {
  box-shadow: var(--shadow-lg);
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-secondary);
}

.task-card:hover::before {
  opacity: 1;
}

.category {
  background: var(--accent);
  color: white;
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  margin: 1.5rem 1.5rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-card h3 {
  margin: 0.8rem 1.5rem 0.5rem;
  font-size: 1.35rem;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card p {
  padding: 0 1.5rem;
  color: #666;
  font-size: 0.98rem;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.6em;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 1.5rem 0.8rem;
  font-size: 0.92rem;
  color: var(--gray);
}

.meta img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--light);
}

.price {
  font-weight: 700;
  color: var(--primary);
  margin: 0.5rem 1.5rem;
  font-size: 1.25rem;
  font-size: 1.3rem;
}

.apply-btn {
  display: block;
  width: 92%;
  margin: 0.8rem auto 1.5rem;
  text-align: center;
  background: var(--gradient-secondary);
  color: white;
  padding: 0.95rem 0;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  font-size: 1.05rem;
  box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2);
  border: none;
  cursor: pointer;
}

.apply-btn:hover {
  background: var(--gradient-btn-hover);
  box-shadow: 0 8px 20px rgba(44, 62, 80, 0.25);
}

/* ====================
   8. 平台介绍区域 (全新设计)
==================== */

.platform-intro {
  padding: 5rem 0;
  background: white;
}

.platform-intro .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.platform-intro h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.platform-intro p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  color: var(--gray);
}

.platform-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
  height: 400px;
}

.platform-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.platform-image:hover img {
  transform: scale(1.05);
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
}

.cta-buttons a {
  flex: 1;
  padding: 1.2rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.cta-buttons a:first-child {
  background: var(--gradient-secondary);
  color: white;
}

.cta-buttons a:last-child {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: white;
}

.cta-buttons a:hover {
  box-shadow: var(--shadow-md);
}

/* ====================
   9. 页脚 Footer (优化版)
==================== */

.footer {
  text-align: center;
  padding: 4rem 1rem 2rem;
  background-color: var(--dark);
  color: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4rem;
}

.footer .container {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
}

.footer-logo {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 2rem;
}

.footer-logo h3 {
  font-size: 1.8rem;
  color: white;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-logo h3::after {
  content: '✨';
  animation: twinkle 3s infinite ease-in-out;
}

.footer-links h4 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.8rem;
}

.footer-links ul li a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links ul li a:hover {
  color: white;
}

.footer .links {
  font-size: 0.95rem;
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer .links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer .links a:hover {
  color: white;
}

.footer address {
  font-style: normal;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1.5rem;
  line-height: 1.7;
}

.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* ====================
   10. 表单页面通用样式（登录 / 注册）
==================== */

.auth-page {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  min-height: 100vh;
  color: white;
  text-align: center;
  padding: 4rem 1rem;
}

.auth-container {
  background: white;
  color: #333;
  border-radius: var(--radius-xl);
  padding: 3rem;
  max-width: 450px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container h1 {
  margin-bottom: 2rem;
  color: var(--dark);
  font-size: 1.9rem;
  font-weight: 700;
}

.auth-container label {
  display: block;
  text-align: left;
  margin: 1.2rem 0 0.5rem;
  font-weight: 600;
  color: var(--dark);
  font-size: 1.05rem;
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container select {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.auth-container input[type="text"]:focus,
.auth-container input[type="email"]:focus,
.auth-container input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.auth-container button[type="submit"] {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.95rem;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
}

.forgot-link {
  float: right;
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: -0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

.forgot-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

.third-party {
  margin: 2.2rem 0;
}

.third-party p {
  margin-bottom: 1.2rem;
  color: var(--gray);
  font-size: 1.05rem;
}

.social-login {
  display: flex;
  gap: 1.2rem;
  margin-top: 1rem;
}

.social-login button {
  flex: 1;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wechat {
  background: #2ecc71;
  color: white;
}

.qq {
  background: #3498db;
  color: white;
}

.wechat:hover, .qq:hover {
  box-shadow: var(--shadow-sm);
}

.switch {
  margin-top: 1.8rem;
  color: var(--gray);
  font-size: 1.05rem;
}

.switch a {
  color: var(--accent);
  font-weight: 600;
  transition: var(--transition);
}

.switch a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ====================
   11. 响应式设计（移动端适配）
==================== */

@media (max-width: 1024px) {
  h1 {
    font-size: 2.8rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .platform-intro .container {
    grid-template-columns: 1fr;
  }
  
  .platform-image {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 1rem 0;
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero {
    min-height: 600px;
    padding-top: 100px;
  }
  
  .hero h1 {
    font-size: 2.4rem;
  }
  
  .hero p {
    font-size: 1.2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filters select, .filter-button {
    width: 100%;
  }
  
  .task-cards {
    grid-template-columns: 1fr;
  }
  
  .footer .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.7rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .search-bar {
    padding: 1rem 1.2rem;
    font-size: 1rem;
  }
  
  .tags span {
    padding: 8px 14px;
    font-size: 0.95rem;
  }
  
  .auth-container {
    padding: 2rem 1.5rem;
  }
  
  .auth-container h1 {
    font-size: 1.7rem;
  }
  
  .apply-btn, .btn-primary {
    font-size: 1rem;
    padding: 0.8rem 0;
  }
  
  /* 移动端优化 */
  button, a {
    touch-action: manipulation;
  }
  
  /* 增大按钮点击区域 */
  button, a.btn, .apply-btn, .filter-button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 优化表单元素 */
  input, select, textarea {
    min-height: 44px;
    padding: 0.75rem;
  }
  
  /* 优化移动端菜单 */
  #mobile-menu a {
    display: block;
    padding: 0.75rem 0;
  }
  
  /* 优化任务卡片在移动端的显示 */
  .task-card, .card-hover {
    margin-bottom: 1rem;
  }
  
  /* 优化导航栏按钮 */
  #navbar .flex.items-center.space-x-4 button, 
  #navbar .flex.items-center.space-x-4 a {
    padding: 0.5rem 1rem;
  }
  
  /* 优化页脚 */
  .footer .container {
    text-align: center;
  }
  
  /* 优化统计卡片 */
  .stat-card {
    padding: 1.5rem;
  }
  
  /* 优化CTA按钮 */
  .cta-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  /* 优化搜索框 */
  .search-container {
    padding: 0 1rem;
  }
  
  /* 优化社交登录按钮 */
  .social-login {
    flex-direction: column;
  }
  
  /* 优化星星评分 */
  .star-rating {
    font-size: 0.9rem;
  }
}

/* ====================
   12. 无障碍支持
==================== */

/* 键盘焦点样式 */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 跳过链接样式 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --primary: #0033cc;
    --secondary: #cc6600;
    --dark: #000000;
    --light: #ffffff;
    --primary-light: #e6f0ff;
    --secondary-light: #fff5e6;
  }
  
  .card-hover {
    border: 1px solid var(--dark);
  }
  
  button, a {
    border: 2px solid transparent;
  }
  
  button:focus, a:focus {
    border-color: var(--primary);
  }
}

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

/* 图片替代文本优化 */
img {
  object-fit: cover;
}

/* 表单标签关联 */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* 错误信息样式 */
.error-message, #login-error, #register-error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid #f5c6cb;
}

/* ====================
   13. 小动效与点缀
==================== */

@keyframes twinkle {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.twinkle {
  animation: twinkle 3s infinite ease-in-out;
  display: inline-block;
}

/* 添加页面加载动画 */
body {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

/* 添加滚动渐显效果 */
.scroll-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====================
   14. 用户下拉菜单组件
==================== */

.user-dropdown {
  position: relative;
}

.user-dropdown > button {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.user-dropdown > button:hover {
  background-color: rgba(22, 93, 255, 0.05);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  z-index: 1000;
}

/* 显示状态：通过 .show 类控制 */
.dropdown-menu.show {
  display: block;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s, color 0.15s;
}

.dropdown-menu a:hover {
  background-color: rgba(22, 93, 255, 0.05);
  color: #165DFF;
}

.dropdown-menu a i {
  width: 18px;
  text-align: center;
  color: #666;
}

.dropdown-menu a:hover i {
  color: #165DFF;
}

.dropdown-menu .border-t {
  border-top: 1px solid #eee;
  margin: 4px 0;
}
