/* Flux Krea 小方格对称结构布局样式 */

/* 基础网格容器 */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  padding: var(--spacing-xl) 0;
}

/* 对称网格布局 */
.symmetric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-xl);
  align-items: center;
  margin: var(--spacing-2xl) 0;
}

.symmetric-grid.reverse {
  direction: rtl;
}

.symmetric-grid.reverse > * {
  direction: ltr;
}

/* 四方格布局 */
.quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--spacing-lg);
  min-height: 400px;
}

.quad-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* 快速开始区域特殊优化 - 水平并列布局 */
.quick-start .quad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: stretch;
  justify-items: stretch;
}

.quick-start .quad-grid-item {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(14, 165, 233, 0.15);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  min-height: 380px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.quick-start .quad-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0EA5E9, #38BDF8, #8B5CF6);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.quick-start .quad-grid-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.12),
    0 10px 10px -5px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(14, 165, 233, 0.3);
}

.quick-start .quad-grid-item:hover::before {
  opacity: 1;
}

/* 快速开始区域图标和数字优化 */
.quick-start .grid-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  transition: all 0.3s ease;
}

.quick-start .quad-grid-item:hover .grid-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.quick-start .grid-number {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 50%, #8B5CF6 100%);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.quick-start .quad-grid-item:hover .grid-number {
  transform: scale(1.1);
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.15);
}

.quad-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.quad-grid-item:hover::before {
  opacity: 1;
}

.quad-grid-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

/* 六方格布局 */
.hex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--spacing-lg);
  min-height: 500px;
}

.hex-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
}

.hex-grid-item:nth-child(odd) {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.hex-grid-item:nth-child(even) {
  background: linear-gradient(225deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

/* 棋盘格布局 */
.checkerboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

.checkerboard-item {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
}

.checkerboard-item:nth-child(odd) {
  background: var(--bg-primary);
}

.checkerboard-item:nth-child(even) {
  background: var(--bg-secondary);
}

.checkerboard-item:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

/* 蜂窝网格布局 */
.honeycomb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  padding: var(--spacing-xl) 0;
}

.honeycomb-item {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  position: relative;
  transition: all var(--transition-normal);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  margin: var(--spacing-lg) 0;
}

.honeycomb-item:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  transform: scale(1.1);
}

/* 砖块布局 */
.brick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  padding: var(--spacing-xl) 0;
}

.brick-row:nth-child(even) {
  transform: translateX(calc(33.333% + var(--spacing-md) / 2));
}

.brick-item {
  aspect-ratio: 2/1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-normal);
}

.brick-item:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  transform: translateY(-2px);
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
  padding: var(--spacing-2xl) 0;
}

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
}

.card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.card-item:hover::before {
  transform: scaleX(1);
}

.card-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

/* 瀑布流布局 */
.masonry-grid {
  column-count: 3;
  column-gap: var(--spacing-lg);
  padding: var(--spacing-xl) 0;
}

.masonry-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  break-inside: avoid;
  transition: all var(--transition-normal);
}

.masonry-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* 等高网格 */
.equal-height-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  align-items: stretch;
}

.equal-height-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.equal-height-item .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 网格动画效果 */
@keyframes gridFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid-animate .grid-item {
  animation: gridFadeIn 0.6s ease-out forwards;
}

.grid-animate .grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-animate .grid-item:nth-child(2) { animation-delay: 0.2s; }
.grid-animate .grid-item:nth-child(3) { animation-delay: 0.3s; }
.grid-animate .grid-item:nth-child(4) { animation-delay: 0.4s; }
.grid-animate .grid-item:nth-child(5) { animation-delay: 0.5s; }
.grid-animate .grid-item:nth-child(6) { animation-delay: 0.6s; }

/* 响应式网格调整 */
@media (max-width: 768px) {
  .symmetric-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .quad-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    min-height: auto;
  }
  
  .hex-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, auto);
    min-height: auto;
  }
  
  .checkerboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .masonry-grid {
    column-count: 1;
  }
  
  .brick-grid {
    grid-template-columns: 1fr;
  }
  
  .brick-row:nth-child(even) {
    transform: none;
  }
}

@media (max-width: 480px) {
  .checkerboard-grid {
    grid-template-columns: 1fr;
  }
  
  .honeycomb-item {
    clip-path: none;
    border-radius: var(--border-radius-lg);
  }
}

/* 特殊效果 */
.grid-glow {
  position: relative;
}

.grid-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-light), var(--primary-color));
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.grid-glow:hover::before {
  opacity: 0.7;
}

/* 网格分割线 */
.grid-divider {
  position: relative;
}

.grid-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--primary-color);
}

/* 网格标题样式 */
.grid-title {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  position: relative;
}

.grid-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
}

/* 网格编号 */
.grid-number {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  color: var(--text-inverse);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* 网格图标 */
.grid-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--spacing-md);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 24px;
}

/* 网格状态指示器 */
.grid-status {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--success-color);
  color: var(--text-inverse);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.grid-status.warning {
  background: var(--warning-color);
}

.grid-status.error {
  background: var(--error-color);
}

/* 网格加载状态 */
.grid-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.grid-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 网格空状态 */
.grid-empty {
  text-align: center;
  padding: var(--spacing-3xl);
  color: var(--text-secondary);
}

.grid-empty-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

/* 网格搜索和过滤 */
.grid-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  gap: var(--spacing-md);
}

.grid-search {
  flex: 1;
  max-width: 300px;
}

.grid-filter {
  display: flex;
  gap: var(--spacing-sm);
}

.filter-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
}

.filter-tag:hover,
.filter-tag.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}