/* =============================================================
   Sonder520 · 现代化卡片样式
   基于液态玻璃 + 星光视觉
   ============================================================= */

/* ---------- 主卡片容器 ---------- */
.main-card {
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 var(--border-hi),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}

.main-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  pointer-events: none;
}

.main-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255, 255, 255, 0.08) 0%, 
    transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.main-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 var(--border-hi),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.main-card:hover::after {
  opacity: 1;
}

/* ---------- 卡片头部 ---------- */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 卡片内容 ---------- */
.card-body {
  padding: 0 24px 24px;
}

/* ---------- 统计卡片 ---------- */
.stat-card {
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  opacity: 0.8;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border-color: var(--accent);
}

.stat-card .stat-num {
  font-size: 42px;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", serif;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 网格布局 ---------- */
.grid-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-cards.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cards.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cards.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---------- 模块卡片 ---------- */
.module-card {
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  backdrop-filter: blur(20px) saturate(1.6) brightness(1.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 var(--border-hi);
  border-color: var(--accent);
}

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

.module-card .module-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.module-card .module-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.module-card .module-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.module-card .module-stats {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.module-card .module-stat {
  display: flex;
  flex-direction: column;
}

.module-card .module-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: "STKaiti", "KaiTi", serif;
}

.module-card .module-stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .grid-cards.cols-2,
  .grid-cards.cols-3,
  .grid-cards.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .stat-card .stat-num {
    font-size: 32px;
  }
  
  .module-card .module-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
}

/* ---------- 暗色主题增强 ---------- */
[data-theme="dark"] .main-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .module-card {
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .main-card:hover,
[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .module-card:hover {
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ---------- 动画效果 ---------- */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-animate-in {
  animation: cardIn 0.4s var(--ease) both;
}

.card-animate-in:nth-child(1) { animation-delay: 0s; }
.card-animate-in:nth-child(2) { animation-delay: 0.05s; }
.card-animate-in:nth-child(3) { animation-delay: 0.1s; }
.card-animate-in:nth-child(4) { animation-delay: 0.15s; }
.card-animate-in:nth-child(5) { animation-delay: 0.2s; }
.card-animate-in:nth-child(6) { animation-delay: 0.25s; }