/* ============================================================
   前台首页样式
   ============================================================ */

/* 星空背景画布 */
#star-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background: #000;
}
/* 渐变遮罩，提升上层文字可读性 */
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(5, 8, 22, 0.55) 0%,
    rgba(5, 8, 22, 0.10) 35%,
    rgba(5, 8, 22, 0.45) 100%);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 120px;
}

/* Header */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 30px;
  text-align: center;
}
.site-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 3px;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.site-sub {
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 2px;
}

/* 搜索框 */
.search-wrap {
  width: 100%;
  max-width: 640px;
  position: relative;
}
.search-input {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 52px;
  border-radius: 26px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 15px;
  outline: none;
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.18);
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* 分类锚点导航 */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0;
  margin: 0 -8px 30px;
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.7) 0%, rgba(5, 8, 22, 0) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.cat-pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover { color: #fff; border-color: var(--accent); }
.cat-pill.active {
  color: #fff;
  background: rgba(124, 156, 255, 0.25);
  border-color: var(--accent);
}

/* 分类区块 */
.section { margin-bottom: 44px; scroll-margin-top: 90px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}
.section-icon { font-size: 20px; }
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.section-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: auto;
}

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--glass-bg-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.card-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.card-icon .letter { line-height: 1; }
.card-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}
.card-body { min-width: 0; flex: 1; }
.card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* 热门推荐 */
.hot-section .grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .hot-section .grid { grid-template-columns: 1fr; } }
.hot-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(124, 156, 255, 0.25);
  color: #fff;
  flex-shrink: 0;
}
.hot-rank.top3 {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(124, 156, 255, 0.4);
}
.hot-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* 底部统计条 */
.stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 56px;
  padding: 18px;
  background: linear-gradient(0deg, rgba(5, 8, 22, 0.92) 0%, rgba(5, 8, 22, 0) 100%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.stat-label { font-size: 12px; color: var(--text-dim); }

/* 空状态 */
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

/* 管理入口悬浮按钮 */
.admin-entry {
  position: fixed;
  right: 24px;
  bottom: 70px;
  z-index: 11;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.admin-entry:hover { color: #fff; border-color: var(--accent); transform: rotate(45deg); }
