/* ==========================================================================
   星屑资源屋 · 设计系统
   ========================================================================== */

:root {
  --bg: #fdf6fb;
  --bg-2: #eef2ff;
  --surface: #ffffff;
  --surface-2: #fff8fc;
  --text: #2a2133;
  --text-2: #665a72;
  --muted: #9a8ea8;
  --line: rgba(140, 100, 180, 0.13);
  --line-strong: rgba(140, 100, 180, 0.24);
  --brand: #ff6fae;
  --brand-2: #a78bfa;
  --brand-3: #5eead4;
  --grad: linear-gradient(135deg, #ff8fc4 0%, #b18bff 52%, #7dd3fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 143, 196, 0.16), rgba(167, 139, 250, 0.16));
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 26px -14px rgba(168, 105, 190, 0.45);
  --shadow-lg: 0 26px 60px -26px rgba(150, 90, 200, 0.5);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
}

[data-theme='dark'] {
  --bg: #12101c;
  --bg-2: #17142a;
  --surface: #1b1829;
  --surface-2: #221d33;
  --text: #f3edff;
  --text-2: #bcb2d0;
  --muted: #8b81a3;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 26px 60px -26px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(255, 143, 196, 0.35); }

/* ---------------- 背景装饰 ---------------- */

.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(255, 176, 214, 0.35), transparent 65%),
    radial-gradient(900px 520px at 92% 0%, rgba(167, 139, 250, 0.28), transparent 62%),
    radial-gradient(800px 600px at 50% 110%, rgba(125, 211, 252, 0.22), transparent 60%),
    var(--bg);
}

[data-theme='dark'] .bg-deco {
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(255, 111, 174, 0.16), transparent 65%),
    radial-gradient(900px 520px at 92% 0%, rgba(139, 92, 246, 0.18), transparent 62%),
    radial-gradient(800px 600px at 50% 110%, rgba(56, 189, 198, 0.12), transparent 60%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: float 16s var(--ease) infinite alternate;
}
.blob-1 { width: 340px; height: 340px; background: #ffb7d5; top: 8%; left: -6%; }
.blob-2 { width: 300px; height: 300px; background: #c4b5fd; top: 42%; right: -8%; animation-delay: -5s; }
.blob-3 { width: 260px; height: 260px; background: #a5f3fc; bottom: 4%; left: 32%; animation-delay: -9s; opacity: 0.35; }

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(24px, -34px, 0) scale(1.12); }
}

.petals { position: absolute; inset: 0; }

.petal {
  position: absolute;
  top: -30px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ffd0e4, #ff9ec9);
  border-radius: 12px 0 12px 0;
  opacity: 0.55;
  animation: fall linear infinite;
}

@keyframes fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  100% { transform: translate3d(60px, 110vh, 0) rotate(320deg); opacity: 0; }
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-size: 19px;
  box-shadow: 0 8px 20px -8px rgba(255, 111, 174, 0.9);
  animation: sparkle 4.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(14deg) scale(1.06); }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 17px; letter-spacing: 0.4px; white-space: nowrap; }
.brand-text i { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.searchbar {
  flex: 1 1 auto;
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.searchbar:focus-within {
  border-color: rgba(255, 111, 174, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 143, 196, 0.15), var(--shadow);
}

.search-ico {
  position: absolute;
  left: 15px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { display: none; }

.search-btn {
  border: 0;
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px -8px rgba(255, 111, 174, 0.9);
  transition: transform 0.2s, filter 0.2s;
}
.search-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.search-clear {
  position: absolute;
  right: 84px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.top-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: all 0.22s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--brand); border-color: rgba(255, 111, 174, 0.45); transform: translateY(-2px); }

/* ---------------- 页面容器 ---------------- */

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 36px;
  margin-bottom: 22px;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.45));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

[data-theme='dark'] .hero { background: linear-gradient(120deg, rgba(40, 32, 60, 0.85), rgba(30, 25, 46, 0.6)); }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 200px at 88% 10%, rgba(255, 143, 196, 0.2), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 640px; }

.hero-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2.4px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(255, 143, 196, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.28;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #ff5fa2, #a06bff 55%, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats div { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); }
.hero-stats b { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }

.hero-art { position: relative; width: 260px; height: 150px; flex: 0 0 auto; z-index: 1; }
.art-ring {
  position: absolute; inset: 6px 40px 6px 40px;
  border: 1.5px dashed rgba(255, 111, 174, 0.4);
  border-radius: 50%;
  animation: spin 26s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.art-card {
  position: absolute;
  width: 74px; height: 96px;
  border-radius: 14px;
  background: var(--grad);
  box-shadow: 0 16px 30px -16px rgba(160, 100, 200, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.art-c1 { left: 16px; top: 32px; transform: rotate(-14deg); opacity: 0.9; }
.art-c2 { left: 92px; top: 18px; background: linear-gradient(135deg, #7dd3fc, #a78bfa); transform: rotate(4deg); z-index: 2; }
.art-c3 { right: 12px; top: 38px; background: linear-gradient(135deg, #fde68a, #fb7185); transform: rotate(16deg); opacity: 0.92; }
.art-star {
  position: absolute; right: 26px; top: 4px;
  color: var(--brand); font-size: 20px;
  animation: sparkle 3.6s ease-in-out infinite;
}

/* ---------------- 公告 ---------------- */

.announce {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--grad-soft);
  border: 1px solid rgba(255, 143, 196, 0.28);
  font-size: 13.5px;
  color: var(--text-2);
}
.announce p { margin: 0; }
.announce-ico { font-size: 15px; line-height: 1.6; }

/* ---------------- 分类 chips ---------------- */

.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.22s var(--ease);
  box-shadow: 0 4px 14px -12px rgba(120, 80, 160, 0.6);
}
.chip:hover { transform: translateY(-2px); color: var(--text); border-color: var(--line-strong); }

.chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, var(--brand));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--brand)) 22%, transparent);
}
.chip .count { font-size: 11.5px; color: var(--muted); }

.chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 10px 22px -12px rgba(255, 111, 174, 0.9);
}
.chip.active .count { color: rgba(255, 255, 255, 0.8); }
.chip.active .dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3); }

/* ---------------- 工具栏 ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}

.result-info { font-size: 13px; color: var(--muted); }
.result-info b { color: var(--brand); font-weight: 700; }

.toolbar-right { display: flex; align-items: center; gap: 12px; }

.sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
}

.sort-wrap select {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding-right: 2px;
}

.layout-switch {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.layout-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.layout-switch svg { width: 16px; height: 16px; }
.layout-switch em { font-style: normal; font-size: 12px; }
.layout-switch button:hover { color: var(--text); background: var(--surface-2); }
.layout-switch button.active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 16px -10px rgba(255, 111, 174, 0.95);
}

/* ---------------- 卡片通用 ---------------- */

.cards { display: grid; gap: 20px; }

.card { min-width: 0; animation: rise 0.45s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s;
}

.card-link:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 111, 174, 0.4);
  box-shadow: var(--shadow-lg);
}

.card-cover {
  position: relative;
  aspect-ratio: var(--ratio, 16 / 10);
  overflow: hidden;
  background: linear-gradient(135deg, #ffe0ee, #e6ddff);
}
[data-theme='dark'] .card-cover { background: linear-gradient(135deg, #2a2038, #221c35); }

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.4s;
}
.card-link:hover .card-cover img { transform: scale(1.07); }

.cover-ph {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--c, #ff6fae) 55%, #ffffff), color-mix(in srgb, var(--c, #ff6fae) 85%, #7c3aed));
}

.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 12, 30, 0.14) 0%, transparent 32%, transparent 62%, rgba(20, 12, 30, 0.42) 100%);
  opacity: 0.9;
  pointer-events: none;
}

.cat-badge, .pin-badge, .views-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cat-badge {
  left: 10px;
  top: 10px;
  color: #fff;
  background: color-mix(in srgb, var(--c, #ff6fae) 82%, transparent);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.5);
}

.pin-badge {
  right: 10px;
  top: 10px;
  color: #7c2d12;
  background: linear-gradient(135deg, #ffe08a, #ffbe55);
  box-shadow: 0 4px 12px -6px rgba(120, 70, 0, 0.6);
}

.views-badge {
  right: 10px;
  bottom: 10px;
  color: #fff;
  background: rgba(20, 12, 30, 0.45);
  font-weight: 500;
}
.pin-badge + .views-badge { right: 10px; }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s;
}
.card-link:hover .card-title { color: var(--brand); }

.card-summary {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; overflow: hidden; max-height: 25px; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 7px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 0.2s;
}
[data-theme='dark'] .tag { background: rgba(255, 255, 255, 0.05); }

.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 2px;
}
.card-meta .sep { opacity: 0.5; }
.card-meta .res-dot { color: var(--brand-3); }

/* ---------------- 布局：小卡 ---------------- */

.layout-small { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.layout-small .card-cover { --ratio: 4 / 3; }
.layout-small .card-body { padding: 11px 12px 13px; gap: 6px; }
.layout-small .card-title { font-size: 13.5px; -webkit-line-clamp: 2; }
.layout-small .card-summary { display: none; }
.layout-small .card-tags { display: none; }
.layout-small .card-meta { font-size: 11px; }

/* ---------------- 布局：中卡 ---------------- */

.layout-medium { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.layout-medium .card-cover { --ratio: 16 / 10; }

/* ---------------- 布局：大卡 ---------------- */

.layout-large { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 24px; }
.layout-large .card-cover { --ratio: 16 / 9; }
.layout-large .card-body { padding: 18px 20px 20px; gap: 10px; }
.layout-large .card-title { font-size: 18.5px; -webkit-line-clamp: 2; }
.layout-large .card-summary { font-size: 13.4px; -webkit-line-clamp: 3; }
.layout-large .tag { font-size: 11.5px; }

/* ---------------- 布局：双列 ---------------- */

.layout-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.layout-duo .card-cover { --ratio: 16 / 10; }
.layout-duo .card-title { font-size: 17px; }
.layout-duo .card-summary { -webkit-line-clamp: 2; }

/* ---------------- 布局：列表 ---------------- */

.layout-list { display: flex; flex-direction: column; gap: 14px; }
.layout-list .card-link { flex-direction: row; align-items: stretch; }
.layout-list .card-cover {
  flex: 0 0 230px;
  width: 230px;
  aspect-ratio: auto;
  min-height: 140px;
}
.layout-list .card-cover::after { background: linear-gradient(90deg, transparent 60%, rgba(20, 12, 30, 0.12)); }
.layout-list .card-body { padding: 16px 20px; justify-content: center; gap: 7px; }
.layout-list .card-title { font-size: 16.5px; -webkit-line-clamp: 1; }
.layout-list .card-summary { -webkit-line-clamp: 2; }
.layout-list .card-meta { margin-top: 4px; }

/* ---------------- 布局：瀑布流 ---------------- */

.layout-masonry {
  display: block;
  columns: 4 250px;
  column-gap: 20px;
}
.layout-masonry .card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 20px;
  display: inline-block;
  width: 100%;
}
.layout-masonry .card-summary { -webkit-line-clamp: 5; }

/* ---------------- 布局：封面流 ---------------- */

.layout-cover { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.layout-cover .card-cover { --ratio: 3 / 4; }
.layout-cover .card-cover::after {
  background: linear-gradient(180deg, transparent 40%, rgba(16, 8, 26, 0.85) 100%);
  opacity: 1;
}
.layout-cover .card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 14px 14px 16px;
  gap: 6px;
  background: transparent;
}
.layout-cover .card-title {
  color: #fff;
  font-size: 14.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.layout-cover .card-link:hover .card-title { color: #ffd0e6; }
.layout-cover .card-summary { display: none; }
.layout-cover .card-tags { display: none; }
.layout-cover .card-meta { color: rgba(255, 255, 255, 0.75); margin-top: 2px; }
.layout-cover .views-badge { bottom: auto; top: 42px; right: 10px; }

/* ---------------- 骨架屏 / 空状态 ---------------- */

.skeleton-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 20px; }

.sk {
  height: 268px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border: 1px solid var(--line);
}
@keyframes shimmer { to { background-position: -220% 0; } }

.empty {
  text-align: center;
  padding: 70px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.empty-art {
  font-size: 44px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 12px;
}
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(255, 111, 174, 0.9);
  transition: transform 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); }

/* ---------------- 分页 ---------------- */

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pager button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  transition: all 0.2s var(--ease);
}
.pager button:hover:not(:disabled) { border-color: rgba(255, 111, 174, 0.5); color: var(--brand); transform: translateY(-2px); }
.pager button.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 8px 20px -12px rgba(255, 111, 174, 0.9); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .ellipsis { color: var(--muted); padding: 0 2px; }

/* ---------------- 页脚 ---------------- */

.site-footer { border-top: 1px solid var(--line); padding: 34px 24px 44px; margin-top: 20px; }
.footer-inner { max-width: 1360px; margin: 0 auto; text-align: center; }
.footer-inner p { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.footer-note { font-size: 11.5px !important; color: var(--muted) !important; }
.footer-note a { color: var(--muted); border-bottom: 1px dotted var(--line-strong); }
.footer-note a:hover { color: var(--brand); }

/* ---------------- 灯箱 / Toast ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 6, 18, 0.88);
  display: grid;
  place-items: center;
  padding: 5vh 4vw;
  cursor: zoom-out;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  z-index: 300;
  padding: 11px 22px;
  border-radius: 999px;
  background: rgba(30, 20, 45, 0.92);
  color: #fff;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   文章详情页
   ========================================================================== */

.article-page { max-width: 900px; margin: 0 auto; padding: 26px 24px 70px; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumb a:hover { color: var(--brand); }
.crumb .sep { opacity: 0.5; }

.article-head {
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.article-hero { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--grad-soft); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(16, 8, 26, 0.6));
}

.article-head-body { padding: 24px 30px 26px; }

.article-title {
  margin: 0 0 14px;
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.4;
  letter-spacing: -0.4px;
}

.article-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.article-meta .tag { font-size: 11.5px; }

.article-body {
  padding: 30px 34px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.prose { font-size: 15px; line-height: 1.95; color: var(--text); word-break: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 20px; margin: 34px 0 14px; padding-left: 14px; border-left: 4px solid; border-image: var(--grad) 1; }
.prose h3 { font-size: 17px; margin: 26px 0 10px; }
.prose h4 { font-size: 15px; margin: 20px 0 8px; color: var(--text-2); }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--brand); border-bottom: 1px dashed rgba(255, 111, 174, 0.5); }
.prose a:hover { border-bottom-style: solid; }
.prose img { border-radius: 14px; margin: 20px auto; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: zoom-in; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--brand); }
.prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 0 14px 14px 0;
  border-left: 3px solid var(--brand-2);
  background: var(--grad-soft);
  color: var(--text-2);
  font-size: 14px;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.14);
  color: #a855f7;
}
[data-theme='dark'] .prose code { color: #d8b4fe; }
.prose pre {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 14px;
  overflow-x: auto;
  background: #1c1728;
  border: 1px solid rgba(167, 139, 250, 0.2);
}
[data-theme='dark'] .prose pre { background: #100d1a; }
.prose pre code { background: none; color: #e9d5ff; padding: 0; font-size: 13px; line-height: 1.7; }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 28px 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.prose tr:last-child td { border-bottom: 0; }

/* 资源下载卡片 */

.resource-box {
  position: relative;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 143, 196, 0.14), rgba(167, 139, 250, 0.14));
  border: 1px solid rgba(255, 143, 196, 0.32);
  margin: 0 0 22px;
  overflow: hidden;
}

.resource-box h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.resource-box .hint { margin: 0 0 16px; font-size: 12px; color: var(--muted); }

.resource-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.resource-link {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
}
.resource-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-copy {
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--brand); color: var(--brand); }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 26px -12px rgba(255, 111, 174, 0.95);
  transition: transform 0.2s;
}
.btn-download:hover { transform: translateY(-2px); }

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(255, 143, 196, 0.6);
  font-size: 13px;
  color: var(--text-2);
}
[data-theme='dark'] .code-pill { background: rgba(255, 255, 255, 0.06); }
.code-pill b { color: var(--brand); letter-spacing: 1px; font-family: Consolas, monospace; }

/* 相关推荐 */

.related-title { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 34px 0 16px; }
.related-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

@media (max-width: 720px) {
  .article-page { padding: 18px 14px 50px; }
  .article-head-body { padding: 18px 18px 20px; }
  .article-body { padding: 20px 18px 26px; border-radius: 18px; }
  .article-hero { aspect-ratio: 16 / 9; }
  .prose { font-size: 14.5px; line-height: 1.9; }
  .prose table { font-size: 12.5px; }
  .prose th, .prose td { padding: 8px 10px; }
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1080px) {
  .hero-art { display: none; }
  .layout-masonry { columns: 3 220px; }
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .searchbar { order: 3; width: 100%; max-width: none; flex: 1 1 100%; margin: 0; height: 42px; }
  .brand { flex: 1; }
  .page { padding: 20px 16px 44px; }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero-stats { gap: 16px; margin-top: 14px; }
  .hero-stats b { font-size: 17px; }
  .layout-switch { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .layout-switch em { display: none; }
  .toolbar { gap: 10px; }
  .layout-list .card-cover { flex: 0 0 150px; width: 150px; min-height: 108px; }
  .layout-list .card-body { padding: 12px 14px; }
  .layout-list .card-title { font-size: 14.5px; }
  .layout-list .card-summary { -webkit-line-clamp: 2; font-size: 12px; }
  .layout-list .card-tags { display: none; }
  .layout-masonry { columns: 2 160px; column-gap: 14px; }
  .layout-masonry .card { margin-bottom: 14px; }
}

@media (max-width: 640px) {
  .brand-text i { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 17px; }
  .brand-text b { font-size: 15.5px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .search-btn { padding: 0 14px; }
  .search-clear { right: 70px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; }
  .hero-tag { font-size: 10px; letter-spacing: 1.6px; }
  .cards { gap: 14px; }
  .layout-small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .layout-small .card-body { padding: 9px 10px 11px; }
  .layout-small .card-title { font-size: 12.5px; }
  .layout-medium { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .layout-medium .card-body { padding: 10px 12px 12px; gap: 6px; }
  .layout-medium .card-title { font-size: 13.5px; }
  .layout-medium .card-summary { display: none; }
  .layout-medium .card-tags { display: none; }
  .layout-large { grid-template-columns: 1fr; }
  .layout-large .card-title { font-size: 16px; }
  .layout-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .layout-duo .card-body { padding: 10px 12px 12px; gap: 6px; }
  .layout-duo .card-title { font-size: 13.5px; }
  .layout-duo .card-summary, .layout-duo .card-tags { display: none; }
  .layout-cover { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .layout-cover .card-title { font-size: 13px; }
  .cat-badge, .pin-badge { height: 21px; font-size: 10px; padding: 0 7px; }
  .views-badge { display: none; }
  .result-info { font-size: 12px; }
  .sort-wrap { height: 34px; }
  .layout-switch button { padding: 0 9px; height: 28px; }
  .layout-switch svg { width: 15px; height: 15px; }
  .pager button { min-width: 36px; height: 36px; font-size: 13px; }
  .site-footer { padding: 26px 16px 34px; }
}

@media (max-width: 400px) {
  .layout-duo { grid-template-columns: 1fr; }
  .layout-switch button[data-layout='cover'] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .petals { display: none; }
}
