/* ============================================================
   豆豆浆糊了 · 中转站   ——   assets/style.css
   ============================================================ */

/* ---------- 0. 让 [hidden] 真正生效 ---------- */
[hidden] { display: none !important; }

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #070a15;
  --text: #eef2ff;
  --text-soft: #a8b0cc;
  --text-dim: #6b7396;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --card-bg: rgba(255, 255, 255, 0.045);
  --card-bg-hover: rgba(255, 255, 255, 0.08);

  --brand: #8b5cf6;

  --radius-lg: 22px;
  --radius-md: 14px;

  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

/* ---------- 3. 背景装饰 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.blob-1 { width: min(62vw, 620px); aspect-ratio: 1; background: #6d28d9; top: -18%; left: -12%; animation: float1 20s ease-in-out infinite; }
.blob-2 { width: min(52vw, 520px); aspect-ratio: 1; background: #0891b2; top: 10%; right: -16%; animation: float2 24s ease-in-out infinite; }
.blob-3 { width: min(46vw, 460px); aspect-ratio: 1; background: #be185d; bottom: -20%; left: 30%; animation: float3 28s ease-in-out infinite; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 58% at 50% 0%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 58% at 50% 0%, #000 18%, transparent 78%);
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- 4. 容器 ---------- */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 84px) clamp(20px, 4vw, 32px) 48px;
}

/* ---------- 5. 头部 ---------- */
.hero {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 46px);
}

/* 药丸形 logo，可容纳多字 */
.logo {
  position: relative;
  display: inline-block;
  padding: 5px;
  margin: 0 auto 22px;
}

.logo-inner {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 26px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 14px 34px -12px rgba(139, 92, 246, 0.9);
  animation: logoIn 0.8s var(--ease) both;
  white-space: nowrap;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  animation: ringPulse 3s ease-in-out infinite;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff 25%, #b6bddb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(14px, 2.2vw, 16px);
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-meta span {
  padding: 5px 13px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

/* ---------- 6. 搜索框 ---------- */
.toolbar {
  max-width: 520px;
  margin: 0 auto clamp(24px, 4vw, 36px);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.search:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.search-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke 0.25s var(--ease);
}

.search:focus-within .search-icon { stroke: var(--brand); }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.search input::placeholder { color: var(--text-dim); }
.search input::-webkit-search-cancel-button { display: none; }

.clear-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.clear-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ---------- 7. 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: clamp(14px, 2vw, 20px);
}

/* ---------- 8. 卡片 ---------- */
.card {
  --card-color: #8b5cf6;

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  animation: cardIn 0.55s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: radial-gradient(420px circle at 50% 0%, var(--card-color), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card-color) 70%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease), left 0.35s var(--ease), right 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-bg-hover);
  border-color: color-mix(in srgb, var(--card-color) 45%, transparent);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--card-color) 22%, transparent);
}

.card:hover::before { opacity: 0.18; }
.card:hover::after  { opacity: 1; left: 8%; right: 8%; }

.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 22px;
  line-height: 1;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card-color) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, transparent);
  transition: transform 0.35s var(--ease);
}

.card:hover .card-icon { transform: scale(1.07) rotate(-4deg); }

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 6px 18px -8px rgba(139, 92, 246, 0.95);
}

.card-title {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  padding-right: 28px;
}

.tag {
  padding: 3px 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.25s, border-color 0.25s;
}

.card:hover .tag { color: var(--text-soft); border-color: rgba(255, 255, 255, 0.18); }

.card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--card-color);
}

.card.is-pinned {
  border-color: color-mix(in srgb, var(--card-color) 35%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-color) 10%, transparent), transparent 60%);
}

/* ---------- 9. 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 60px 0;
  text-align: center;
}

.empty-icon { font-size: 40px; line-height: 1; }
.empty-text { margin: 0; font-size: 15px; color: var(--text-dim); }

.empty-btn {
  margin-top: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.empty-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.6);
}

/* ---------- 10. 页脚 ---------- */
.footer {
  margin-top: clamp(44px, 7vw, 76px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
}

.footer a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  transition: color 0.2s, border-color 0.2s;
}

.footer a:hover { color: #fff; border-color: var(--brand); }

.footer-sep { margin: 0 8px; opacity: 0.45; }

/* ---------- 11. 动画 ---------- */
@keyframes float1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 50px) scale(1.12); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-70px, 40px) scale(1.08); } }
@keyframes float3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -60px) scale(1.15); } }

@keyframes logoIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1);    opacity: 0.55; }
  50%      { transform: scale(1.08); opacity: 0; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 600px) {
  .wrap { padding-top: 44px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .card-icon { width: 42px; height: 42px; font-size: 20px; }
  .logo-inner { height: 48px; padding: 0 20px; font-size: 16px; }
}

/* ---------- 13. 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}