/* ============================================
   精品导航 · 自定义样式
   ============================================ */

:root {
  --bg-overlay: rgba(248, 250, 252, 0.55);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.06);
  --card-hover-shadow: 0 10px 28px -10px rgba(59, 130, 246, 0.25);
  --section-bg: rgba(255, 255, 255, 0.85);
  --section-border: rgba(0, 0, 0, 0.06);
  --text-secondary: #64748b;
}

html.dark {
  --bg-overlay: rgba(15, 23, 42, 0.65);
  --card-bg: #1e293b;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-shadow: 0 10px 28px -10px rgba(59, 130, 246, 0.4);
  --section-bg: rgba(30, 41, 59, 0.85);
  --section-border: rgba(255, 255, 255, 0.08);
  --text-secondary: #94a3b8;
}

body {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(2px);
  z-index: -1;
  pointer-events: none;
}

/* 玻璃面板 */
.panel {
  background: var(--section-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--section-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ============================================
   书签卡片 - 紧凑现代风
   ============================================ */
.bm-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.bm-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--card-accent, transparent);
  transition: width .18s ease;
}

.bm-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  border-color: transparent;
}

.bm-card:hover::before { width: 4px; }

.bm-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 17px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  letter-spacing: 0;
}

.bm-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  padding: 4px;
}

html.dark .bm-icon img { background: #f1f5f9; }

.bm-text {
  flex: 1;
  min-width: 0;
}

.bm-title {
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bm-card:hover .bm-title {
  color: var(--card-accent, #3b82f6);
}

.bm-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.bm-badge.hot { background: #fee2e2; color: #dc2626; }
.bm-badge.quick { background: #fef3c7; color: #d97706; }
html.dark .bm-badge.hot { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
html.dark .bm-badge.quick { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }

/* ============================================
   分类侧栏
   ============================================ */
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: background .15s;
  cursor: pointer;
  text-align: left;
}

.cat-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

html.dark .cat-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cat-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), transparent);
  color: #2563eb;
  font-weight: 600;
}

html.dark .cat-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), transparent);
  color: #60a5fa;
}

.cat-item .cat-icon {
  width: 18px;
  text-align: center;
}

/* ============================================
   子分类 chips
   ============================================ */
.sub-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--section-border);
  background: var(--card-bg);
  color: inherit;
  transition: all .15s;
  cursor: pointer;
}

.sub-chip:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.sub-chip.active {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4);
}

/* ============================================
   Hero 标语
   ============================================ */
.hero {
  text-align: center;
  padding: 28px 16px;
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.hero p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (min-width: 768px) {
  .hero { padding: 36px 24px; }
  .hero h1 { font-size: 2.4rem; }
  .hero p { font-size: 15px; }
}

/* ============================================
   通用
   ============================================ */
.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: rgba(120, 120, 120, 0.3); border-radius: 3px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.25s ease both; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 兼容旧类名 */
.glass { background: var(--section-bg); backdrop-filter: blur(14px); border: 1px solid var(--section-border); }
.bookmark-card { transition: all 0.18s; }
.bookmark-card:hover { transform: translateY(-2px); box-shadow: var(--card-hover-shadow); }
