/* ============ 基础 & 主题变量 ============ */
:root,
[data-theme="dark"] {
  --bg: #0a0e17;
  --bg-soft: #0f1522;
  --card: #121a2b;
  --card-hover: #16213a;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e8edf7;
  --text-dim: #9aa8c2;
  --text-faint: #64748b;
  --accent: #4d6bfe;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #4d6bfe 0%, #22d3ee 100%);
  --star: #fbbf24;
  --nav-bg: rgba(10, 14, 23, 0.82);
  --hero-title: linear-gradient(180deg, #ffffff 30%, #a5b4d4 100%);
  --hero-glow: radial-gradient(ellipse at center, rgba(77, 107, 254, 0.22) 0%, rgba(34, 211, 238, 0.08) 45%, transparent 70%);
  --code-bg: rgba(6, 9, 16, 0.9);
  --code-fg: #cbd5e1;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.35);
  --seg-active-bg: rgba(77, 107, 254, 0.2);
  --seg-active-fg: #b7c6ff;
  --icon-bg: rgba(77, 107, 254, 0.1);
  --icon-border: rgba(77, 107, 254, 0.22);
  --toast-bg: rgba(18, 26, 43, 0.95);
  --mark-bg: rgba(251, 191, 36, 0.25);
  --mark-fg: #fcd34d;
  --copy-fg: #93a8ff;
  --radius: 14px;
  --nav-h: 64px;
  font-size: 16px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #64748b;
  --accent: #3b5bfd;
  --accent-2: #0891b2;
  --accent-grad: linear-gradient(135deg, #4d6bfe 0%, #0ea5e9 100%);
  --star: #d97706;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --hero-title: linear-gradient(180deg, #0f172a 20%, #334155 100%);
  --hero-glow: radial-gradient(ellipse at center, rgba(77, 107, 254, 0.14) 0%, rgba(14, 165, 233, 0.08) 45%, transparent 70%);
  --code-bg: #0f172a;
  --code-fg: #cbd5e1;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.1);
  --seg-active-bg: rgba(77, 107, 254, 0.12);
  --seg-active-fg: #3b5bfd;
  --icon-bg: rgba(77, 107, 254, 0.08);
  --icon-border: rgba(77, 107, 254, 0.2);
  --toast-bg: rgba(255, 255, 255, 0.96);
  --mark-bg: rgba(245, 158, 11, 0.22);
  --mark-fg: #b45309;
  --copy-fg: #4d6bfe;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.hidden { display: none !important; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -56px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}

.noscript-fallback {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 24px 20px 48px;
}
.noscript-fallback h1 { margin-bottom: 12px; font-size: 1.6rem; }
.noscript-fallback p { color: var(--text-dim); margin-bottom: 12px; }
.noscript-fallback ul { padding-left: 1.2em; color: var(--text-dim); }
.noscript-fallback li { margin: 8px 0; }
.noscript-fallback a { color: var(--accent); text-decoration: underline; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 顶部导航 ============ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; letter-spacing: 0.3px; }
.brand-logo { font-size: 1.4rem; }
.brand-text b {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mainnav { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 16px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: all 0.18s ease;
}
.nav-link:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav-link.active { color: var(--text); background: rgba(77, 107, 254, 0.16); }

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  width: 240px;
  margin: 0;
  transition: border-color 0.18s ease;
}
.search-box:focus-within { border-color: var(--accent); }
.search-icon { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0 8px;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input[type="search"]::-webkit-search-decoration,
.search-box input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-kbd {
  font-size: 0.72rem;
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 6px;
}

.lang-toggle {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.18s ease;
}
.lang-toggle:hover { color: var(--text); border-color: var(--accent); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  transition: all 0.18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn .icon-sun { display: block; }
.icon-btn .icon-moon { display: none; }
[data-theme="light"] .icon-btn .icon-sun { display: none; }
[data-theme="light"] .icon-btn .icon-moon { display: block; }

.github-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  transition: all 0.18s ease;
}
.github-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ============ 视图切换 ============ */
main { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }
.view { display: none; animation: fadeUp 0.35s ease; }
.view.active { display: block; }

.page-head {
  padding: 48px 0 20px;
}
.page-head h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px;
}
.page-head p {
  color: var(--text-dim);
  margin: 0;
}

.page-not-found {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}
.page-not-found h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 12px;
}
.page-not-found p {
  color: var(--text-dim);
  margin: 0 0 8px;
}
.page-not-found a {
  color: var(--accent);
  font-weight: 600;
}
.page-not-found a:hover {
  text-decoration: underline;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 24px 56px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 420px;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  position: relative;
  font-size: 0.82rem;
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.07);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-title {
  position: relative;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 1px;
  background: var(--hero-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  position: relative;
  color: var(--text-dim);
  font-size: 1.06rem;
  margin: 18px auto 28px;
  max-width: 560px;
}

.hero-filters {
  position: relative;
  text-align: left;
}

.btn {
  padding: 11px 26px;
  border-radius: 11px;
  font-size: 0.96rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 24px rgba(77, 107, 254, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(77, 107, 254, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.hero-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
}
.hero-search-row .filter-search { flex: 1; }
.search-submit {
  flex-shrink: 0;
  height: 42px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(77, 107, 254, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(77, 107, 254, 0.4);
}

.hero-stats {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 44px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b { font-size: 1.5rem; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 0.82rem; color: var(--text-faint); }
.stat-divider { width: 1px; height: 34px; background: var(--border); }

/* ============ 区块标题 ============ */
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 64px 0 22px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.45rem; font-weight: 700; }
.section-note { color: var(--text-faint); font-size: 0.88rem; }
.section-head .list-toolbar { margin-left: auto; margin-bottom: 0; }

/* ============ 插件卡片网格 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover { background: var(--card-hover); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: flex-start; gap: 13px; }
.card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  border-radius: 12px;
  overflow: hidden;
}
.card-icon img,
.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-title-wrap { flex: 1; min-width: 0; }
.card-name { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.featured-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.card-repo { font-size: 0.78rem; color: var(--text-faint); font-family: Consolas, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
  font-size: 0.75rem;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 2px 10px;
  border-radius: 999px;
}
.badge-link {
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}
.badge-link:hover {
  background: rgba(34, 211, 238, 0.18);
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.card-stars { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--star); font-size: 0.88rem; font-weight: 600; }
.card-updated { font-size: 0.78rem; color: var(--text-faint); }

/* ============ 列表工具栏（排序 + 视图切换） ============ */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sort-select {
  height: 42px;
  padding: 0 34px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa8c2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
}
.sort-select:hover, .sort-select:focus { border-color: var(--border-strong); outline: none; }

.view-seg { height: 42px; align-items: stretch; padding: 4px; border-radius: 12px; }
.view-seg .seg-btn { padding: 0 14px; }
.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.16s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--seg-active-bg); color: var(--seg-active-fg); }
.seg-icon { padding: 6px 10px; }
.seg-icon svg { display: block; }

/* ============ 卡片列表模式 ============ */
.grid.list-mode { grid-template-columns: 1fr; gap: 12px; }
.grid.list-mode .card {
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 15px 20px;
}
.grid.list-mode .card:hover { transform: none; }
.grid.list-mode .card::before { inset: 0 auto 0 0; width: 2px; height: auto; }
.grid.list-mode .card-top { flex: 0 0 240px; align-items: center; min-width: 0; }
.grid.list-mode .card-desc { -webkit-line-clamp: 1; margin: 0; }
.grid.list-mode .card-foot { flex-shrink: 0; flex-wrap: nowrap; }
.grid.list-mode .card-stars { margin-left: 0; }

/* ============ 分页（页码导航） ============ */
.list-pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 0 8px;
}
.list-pager.hidden { display: none !important; }
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.16s ease;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
  background: var(--card-hover);
}
.page-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(77, 107, 254, 0.3);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.page-nav {
  font-size: 0.82rem;
  padding: 0 12px;
}
.page-ellipsis {
  color: var(--text-faint);
  padding: 0 4px;
  font-size: 0.9rem;
  user-select: none;
}
.page-info {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-left: 8px;
  white-space: nowrap;
}

/* ============ 最新视图 ============ */

/* ============ 分类视图 ============ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 200px;
  width: auto;
  height: 42px;
  border-radius: 12px;
}
.filter-bar .list-toolbar { margin-bottom: 0; }
#searchToolbar { margin-bottom: 18px; }

/* ============ Chips 滚动容器 ============ */
.chips-scroll {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
  max-width: 100%;
}

.category-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 0 2px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.category-chips::-webkit-scrollbar { display: none; }
.category-chips:active { cursor: grabbing; }
.category-chips.dragging { cursor: grabbing; }

.chips-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -2px;
  transition: all 0.18s ease;
  margin-left: 8px;
}
.chips-arrow:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--card-hover);
}

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.chip .count {
  font-size: 0.75rem;
  background: rgba(148, 163, 184, 0.14);
  padding: 1px 8px;
  border-radius: 999px;
}
.chip.active .count { background: rgba(255, 255, 255, 0.22); }

/* ============ 插件详情页 ============ */
.detail-page {
  padding: 44px 0 70px;
  animation: fadeUp 0.3s ease;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  margin-bottom: 28px;
  transition: all 0.18s ease;
  text-decoration: none;
}
.detail-back:hover { color: var(--text); border-color: var(--border-strong); background: var(--card-hover); }

/* 头部 */
.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.detail-icon {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  border-radius: 18px;
  overflow: hidden;
}
.detail-header-info { flex: 1; min-width: 0; }
.detail-title { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 0; }
.detail-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.detail-meta .updated { font-size: 0.82rem; color: var(--text-faint); }

/* 双栏布局 */
.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 36px;
  align-items: start;
}
.detail-main { min-width: 0; }
.detail-sidebar { position: sticky; top: calc(var(--nav-h) + 24px); }

/* 侧边栏卡片 */
.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.sidebar-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.sidebar-card .github-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: Consolas, monospace;
  transition: color 0.18s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.sidebar-card .github-link:hover { color: var(--accent-2); border-color: var(--border-strong); }

/* 侧边栏统计列表 */
.sidebar-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.sidebar-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sidebar-stat svg { color: var(--text-faint); flex-shrink: 0; }
.sidebar-stat b { color: var(--text); font-size: 0.92rem; }
.sidebar-stat span { font-size: 0.82rem; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }

/* 侧边栏元信息 */
.sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.meta-label { color: var(--text-faint); }
.meta-value { color: var(--text-dim); font-family: Consolas, monospace; font-size: 0.8rem; }

/* 详情区块 */
.detail-section {
  margin-bottom: 36px;
}
.detail-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

.detail-desc {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.85;
}

.detail-desc p {
  margin: 0 0 0.9em;
}

.detail-desc p:last-child {
  margin-bottom: 0;
}

/* 安装区块 */
.install-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 36px;
}
.install-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.install-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 18px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.18s ease;
}
.install-tab:hover { color: var(--text); }
.install-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }

.install-panel { display: none; padding-top: 16px; }
.install-panel.active { display: block; animation: fadeUp 0.25s ease; }
.install-hint { font-size: 0.85rem; color: var(--text-faint); margin-bottom: 10px; }

.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 13px 15px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
}
.code-box code { flex: 1; color: var(--code-fg); overflow-x: auto; white-space: nowrap; }
.prompt-box { align-items: flex-start; }
.prompt-box code { white-space: pre-wrap; line-height: 1.7; }

.copy-btn {
  flex-shrink: 0;
  background: rgba(77, 107, 254, 0.14);
  border: 1px solid rgba(77, 107, 254, 0.35);
  color: var(--copy-fg);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 8px;
  transition: all 0.18s ease;
}
.copy-btn:hover { background: rgba(77, 107, 254, 0.28); color: #fff; }
.copy-btn.copied { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.4); color: #34d399; }

/* 图片轮播 */
.image-carousel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.carousel-stage {
  position: relative;
}
.carousel-viewport {
  overflow: hidden;
  width: 100%;
}
.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--code-bg);
}
.carousel-slide img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.carousel-btn:hover:not(:disabled) {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--accent);
}
.carousel-btn:disabled {
  color: var(--text-faint);
  background: color-mix(in srgb, var(--text-faint) 22%, var(--card));
  border-color: var(--border);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px 12px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.45;
  cursor: pointer;
  transition: width 0.22s ease, background 0.22s ease, opacity 0.22s ease;
}
.carousel-dot:hover { opacity: 0.8; }
.carousel-dot.active {
  width: 18px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 1;
}

/* 场景 & 人员信息卡片 */
.detail-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.info-card .detail-section-title { margin-bottom: 10px; }
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}
.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
}
.info-list .info-empty {
  color: var(--text-faint);
  padding-left: 0;
}
.info-list .info-empty::before { display: none; }

/* 标签 */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-tags .tag {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.detail-tags .tag:hover { color: var(--text); border-color: var(--accent); }
.detail-tags .tag-link {
  text-decoration: none;
  cursor: pointer;
}

/* 相关插件 */
#detailRelatedSection .section-head {
  margin-top: 0;
  margin-bottom: 18px;
}
#detailRelatedSection .section-head h2 { font-size: 1.2rem; }

/* ============ 搜索空态 / Toast ============ */
.empty-state { text-align: center; padding: 80px 0; color: var(--text-dim); }
.empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.5; }

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--toast-bg);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #34d399;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 实时数据标记 & 搜索高亮 */
.live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 1px 8px;
  border-radius: 999px;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  border-radius: 3px;
  padding: 0 2px;
}

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border); padding: 40px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; color: var(--text-dim); font-size: 0.9rem; }

.footer-left { flex: 1; max-width: 560px; }
.footer-right { flex-shrink: 0; text-align: right; }

.footer-brand { font-size: 1.05rem; margin-bottom: 8px; color: var(--text); }
.footer-brand b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-note { font-size: 0.78rem; color: var(--text-faint); margin-top: 6px; }

.footer-disclaimer { font-size: 0.78rem; color: var(--text-faint); margin: 8px 0 0; line-height: 1.5; }

.footer-links { font-size: 0.85rem; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.footer-links-label { color: var(--text-dim); }
.footer-links a { color: var(--accent); text-decoration: none; padding: 0 6px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-hover); text-decoration: underline; }
.footer-links a + a { border-left: 1px solid var(--border); }

.footer-copyright { font-size: 0.78rem; color: var(--text-faint); margin-top: 12px; }
.footer-copyright a { color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.footer-copyright a:hover { color: var(--text-dim); }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .topnav-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 12px; }
  .topnav-right { margin-left: 0; width: 100%; }
  .search-box { flex: 1; width: auto; }
  .hero { padding: 56px 8px 40px; }
  .hero-stats { gap: 18px; }
  .section-head { flex-direction: column; gap: 4px; align-items: flex-start; }
  .search-kbd { display: none; }
  .detail-page { padding: 30px 0 50px; }
  .detail-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .detail-icon { width: 64px; height: 64px; font-size: 2rem; border-radius: 14px; }
  .detail-title { font-size: 1.4rem; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .detail-info-cards { grid-template-columns: 1fr; }
  .hero-search-row { flex-wrap: nowrap; }
  .hero-search-row .filter-search { width: auto; flex: 1; min-width: 0; }
  .filter-search { width: 100%; min-width: 0; }
  .filter-bar .list-toolbar { margin-left: 0; width: 100%; justify-content: flex-start; }
  .section-head .list-toolbar { margin-left: 0; }
  .list-toolbar { justify-content: flex-start; }
  .grid.list-mode .card { flex-wrap: wrap; gap: 10px 14px; }
  .grid.list-mode .card-top { flex: 1 1 200px; }
  .grid.list-mode .card-desc { flex: 1 1 100%; order: 3; -webkit-line-clamp: 2; }
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
  .footer-left { max-width: none; }
  .footer-right { text-align: center; }
  .footer-links { justify-content: center; }
}

.grid-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  color: var(--text-dim);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
