/* ============================================================
   layout.css — 头部 / 状态栏 / 筛选 / 网格 / 页脚 / 响应式
   ============================================================ */

/* ---------------- 头部 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border-bottom: 1px solid var(--line);
}

.header-main {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 14px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: radial-gradient(120% 120% at 20% 0%, rgba(124, 140, 255, 0.22), transparent 62%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-mark svg {
  animation: radar-spin 14s linear infinite;
}

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.brand-text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

/* ---------------- 状态栏 ---------------- */
.statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.stat b {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-mute);
  font-size: 11.5px;
}

.stat-btn {
  border-color: var(--line);
  background: var(--panel);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.stat-btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.stat-btn[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: live-pulse 2.4s var(--ease) infinite;
  align-self: center;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.provider {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 主区域 ---------------- */
.main {
  padding-top: 22px;
  padding-bottom: 8px;
  min-height: 60vh;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filter-label {
  flex-shrink: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-mute);
  min-height: 20px;
}

/* ---------------- 卡片网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  align-items: stretch;
}

@media (min-width: 900px) {
  .grid .card.is-feature {
    grid-column: span 2;
  }
}

.sentinel {
  height: 1px;
}

.load-more {
  display: block;
  margin: 26px auto 10px;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 48px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 55%, transparent);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  padding-bottom: 26px;
}

.footer-title {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 7px;
}

.footer-note {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-mute);
  max-width: 42ch;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  padding-block: 14px 22px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .header-main {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-tools {
    order: 3;
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .search {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
  }

  .status-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-text em { display: none; }
  .btn-primary span { display: none; }
  .search-kbd { display: none; }
  .stat { padding-inline: 8px; }
  .filter-group { align-items: stretch; flex-direction: column; gap: 6px; }
  .filter-label { padding-left: 2px; }
  .chip-scroll { width: 100%; }
  .footer-inner { gap: 20px; }
}
