:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --accent: #db2777;
  --bg: #faf9ff;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #ece9f5;
  --radius: 18px;
  --shadow: 0 1px 3px rgba(124,58,237,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-hover: 0 10px 25px -5px rgba(124,58,237,0.18), 0 4px 10px -2px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.header-inner .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.main-nav {
  display: flex;
  gap: 24px;
}
.main-nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color .2s;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #fff 0%, #faf9ff 100%);
  padding: 48px 0 32px;
  text-align: center;
}
.hero-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.hero-logo .logo-icon {
  width: 52px;
  height: 52px;
  font-size: 22px;
  border-radius: 14px;
}
.hero-logo h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}
.hero-logo h1 span {
  color: #7c3aed;
}
.hero-sub {
  margin: 8px 0 28px;
  color: var(--text-muted);
  font-size: 14px;
}
.search-box {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow);
  max-width: 560px;
  width: 100%;
}
.search-box select {
  border: none;
  background: transparent;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  border-right: 1px solid var(--border);
  height: 40px;
  appearance: none;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  height: 40px;
}

/* Category pills */
.category-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  margin-top: 16px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .2s;
}
.cat-pill:hover { background: #f5f3ff; border-color: #ddd6fe; }
.cat-pill.active {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 20px;
}
.toolbar .count {
  font-size: 14px;
  color: var(--text-muted);
}
.toolbar .count strong {
  color: var(--text);
  font-weight: 700;
}


/* Layout */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all .2s;
}
.sidebar-cat:hover {
  background: #fff;
  border-color: var(--border);
}
.sidebar-cat.active {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all .3s ease;
  overflow: hidden;
  min-height: 170px;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #ddd6fe;
}
.card-deco {
  position: absolute;
  right: 8px;
  bottom: -10px;
  width: 90px;
  height: 130px;
  opacity: 0.55;
  pointer-events: none;
  transition: transform .3s ease;
}
.card:hover .card-deco {
  transform: translateY(-6px) scale(1.05);
}
.card-deco img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* 角标：放在卡片内侧右上角，纵向排列，避免被卡片圆角裁掉、也避免互相重叠 */
.card-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 3;
  pointer-events: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.14);
  white-space: nowrap;
}
.badge-hot {
  background: linear-gradient(135deg, #ef4444, #f97316);
}
.badge-rec {
  background: linear-gradient(135deg, #10b981, #14b8a6);
}
.badge-new {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
}
/* 有角标时，标题右侧留出空间，避免被角标盖住 */
.card.has-badges .card-info {
  padding-right: 72px;
}

.card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.card-logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.card-info {
  flex: 1;
  min-width: 0;
}
.card-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
.card:hover .card-info h3 {
  color: var(--primary);
}
.card-info p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-arrow {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  margin-top: 4px;
  transition: all .2s;
}
.card:hover .card-arrow {
  color: var(--primary);
  transform: translateX(3px);
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.card-tags span {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 500;
}

/* Footer */
.site-footer {
  background: #1b1533;
  color: #cbd5e1;
  margin-top: 60px;
  padding: 40px 0 20px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
}
.footer-section h4 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 16px;
}
.footer-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 2;
}
.footer-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}
.copyright {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #2e2550;
  font-size: 13px;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 160px 1fr; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { display: none; }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .hero-logo h1 { font-size: 24px; }
  .hero { padding: 32px 0 24px; }
  .search-box { max-width: 100%; }
  .toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
