/* ============================================
   Floating Islands — 信息浮岛设计
   有机布局 × 大量留白 × 曲线连接 × 轻拟物
   ============================================ */

/* ===== 全局重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ===== Body — 浅色背景 ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e8eef5 100%);
  color: #1e293b;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== 背景装饰 ===== */
.fi-bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(147, 51, 234, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

.fi-bg-decoration::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23cbd5e1' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

/* ===== 导航栏 ===== */
.fi-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
  padding: 16px 0;
}

.fi-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fi-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  color: #1e293b;
}

.fi-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fi-logo-text {
  font-size: 20px;
  letter-spacing: -0.5px;
}

.fi-nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.fi-nav-links a {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 8px 16px;
  border-radius: 8px;
}

.fi-nav-links a:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.fi-mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.fi-mobile-menu-btn span {
  position: absolute;
  left: 6px;
  width: 20px;
  height: 2px;
  background: #475569;
  transition: 0.3s;
}

.fi-mobile-menu-btn span:nth-child(1) { top: 8px; }
.fi-mobile-menu-btn span:nth-child(2) { top: 15px; }
.fi-mobile-menu-btn span:nth-child(3) { top: 22px; }

/* ===== Hero区域 ===== */
.fi-hero {
  padding: 80px 32px 60px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.fi-hero-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 10px 40px rgba(102, 126, 234, 0.15),
    0 4px 20px rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(203, 213, 225, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.fi-hero-card:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow:
    0 20px 60px rgba(102, 126, 234, 0.2),
    0 8px 30px rgba(102, 126, 234, 0.15);
}

.fi-hero-card-img {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.fi-hero-card-img img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.4s;
}

.fi-hero-card:hover .fi-hero-card-img img {
  transform: scale(1.05);
}

.fi-hero-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fi-hero-card-tag {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.fi-hero-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.fi-hero-card-excerpt {
  color: #475569;
  font-size: 15px;
  line-height: 1.7;
}

.fi-hero-card-meta {
  color: #667eea;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fi-hero-card-meta svg {
  width: 18px;
  height: 18px;
}

/* ===== 浮岛容器 ===== */
.fi-islands-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px 100px;
  position: relative;
  z-index: 1;
}

/* ===== 分类标题 ===== */
.fi-category-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 60px 0 40px;
  padding: 0 16px;
}

.fi-category-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.fi-category-icon.emerging {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.fi-category-icon.deep {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.fi-category-icon.supernova {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
}

.fi-category-text h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.5px;
}

.fi-category-text span {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
}

/* ===== 浮岛布局 ===== */
.fi-islands-grid {
  display: grid;
  gap: 32px 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ===== 单个浮岛卡片 ===== */
.fi-island {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 6px 24px rgba(102, 126, 234, 0.08),
    0 2px 12px rgba(102, 126, 234, 0.04);
  border: 1px solid rgba(203, 213, 225, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
}

/* 随机偏移效果 - 创造有机布局 */
.fi-island:nth-child(1) { transform: translateY(0); }
.fi-island:nth-child(2) { transform: translateY(-15px); }
.fi-island:nth-child(3) { transform: translateY(10px); }
.fi-island:nth-child(4) { transform: translateY(-8px); }
.fi-island:nth-child(5) { transform: translateY(20px); }
.fi-island:nth-child(6) { transform: translateY(-12px); }
.fi-island:nth-child(7) { transform: translateY(5px); }
.fi-island:nth-child(8) { transform: translateY(-18px); }
.fi-island:nth-child(9) { transform: translateY(15px); }
.fi-island:nth-child(10) { transform: translateY(-10px); }
.fi-island:nth-child(n+11) { transform: translateY(calc(var(--n, 1) * 8px)); }

.fi-island:hover {
  transform: translateY(-12px) translateX(4px) rotate(-1deg);
  box-shadow:
    0 16px 48px rgba(102, 126, 234, 0.12),
    0 6px 24px rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.fi-island-img {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.fi-island-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s;
}

.fi-island:hover .fi-island-img img {
  transform: scale(1.1);
}

.fi-island-body {
  padding: 20px;
}

.fi-island-tag {
  display: inline-block;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.fi-island-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 8px;
}

.fi-island-excerpt {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 曲线连接 ===== */
.fi-curves {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

.fi-curve {
  fill: none;
  stroke: url(#curveGradient);
  stroke-width: 2;
  stroke-linecap: round;
  animation: curveFloat 8s ease-in-out infinite;
}

@keyframes curveFloat {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ===== 搜索 ===== */
.fi-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.fi-search-overlay.active {
  display: flex;
}

.fi-search-box {
  width: 100%;
  max-width: 600px;
  position: relative;
}

.fi-search-input {
  width: 100%;
  padding: 20px 24px 20px 60px;
  background: white;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 16px;
  font-size: 18px;
  color: #1e293b;
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
}

.fi-search-input:focus {
  border-color: #667eea;
  box-shadow: 0 8px 40px rgba(102, 126, 234, 0.15);
}

.fi-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: #667eea;
}

.fi-search-close {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 12px;
  font-size: 28px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.fi-search-close:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.fi-search-results {
  width: 100%;
  max-width: 600px;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fi-search-result-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.2);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
}

.fi-search-result-item:hover {
  border-color: rgba(102, 126, 234, 0.3);
  background: rgba(102, 126, 234, 0.05);
}

.fi-search-result-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}

.fi-search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fi-search-result-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fi-search-result-cat {
  font-size: 12px;
  color: #667eea;
  font-weight: 600;
}

.fi-search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.fi-search-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 32px;
}

/* ===== 搜索按钮 ===== */
.fi-search-btn {
  width: 40px;
  height: 40px;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.fi-search-btn:hover {
  background: rgba(102, 126, 234, 0.2);
}

.fi-search-btn svg {
  width: 20px;
  height: 20px;
  color: #667eea;
}

/* ===== Footer ===== */
.fi-footer {
  background: white;
  border-top: 1px solid rgba(203, 213, 225, 0.3);
  padding: 40px 32px;
  position: relative;
  z-index: 1;
}

.fi-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.fi-footer-text {
  color: #64748b;
  font-size: 14px;
  text-align: center;
}

.fi-footer-links {
  display: flex;
  gap: 24px;
}

.fi-footer-links a {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.fi-footer-links a:hover {
  color: #667eea;
}

/* ===== 动画效果 ===== */
.fi-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
             transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
  .fi-hero-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .fi-hero-card-img img {
    height: 280px;
  }

  .fi-islands-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .fi-nav-inner {
    padding: 0 16px;
  }

  .fi-nav-links {
    display: none;
  }

  .fi-mobile-menu-btn {
    display: block;
  }

  .fi-hero {
    padding: 60px 16px 40px;
  }

  .fi-hero-card {
    padding: 24px;
  }

  .fi-hero-card-title {
    font-size: 24px;
  }

  .fi-islands-container {
    padding: 0 16px 80px;
  }

  .fi-category-title {
    margin: 40px 0 32px;
  }

  .fi-category-text h2 {
    font-size: 28px;
  }

  .fi-islands-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .fi-island:nth-child(n) {
    transform: translateY(0);
  }

  .fi-footer {
    padding: 32px 16px;
  }
}

/* ===== 移动菜单 ===== */
.fi-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 150;
  transition: right 0.3s;
  padding: 32px;
  box-shadow: -4px 0 24px rgba(102, 126, 234, 0.1);
}

.fi-mobile-menu.active {
  right: 0;
}

.fi-mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  list-style: none;
}

.fi-mobile-menu-links a {
  color: #1e293b;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s;
}

.fi-mobile-menu-links a:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}