/* ============================================================
   DSH 创意工坊 — Design System v2
   纯静态站样式系统。中性色 + 暖色星标，注重层次与微交互。
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #f5f6f8;
  --bg-grad: radial-gradient(1200px 480px at 80% -8%, rgba(245, 158, 11, 0.06), transparent 60%), #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #f2f3f5;
  --surface-glass: rgba(255, 255, 255, 0.82);

  /* Text */
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --text-4: #a9aeb8;

  /* Lines */
  --line: #e5e6eb;
  --line-2: #c9cdd4;
  --line-soft: #eef0f3;

  /* Brand / accent */
  --brand: #1d2129;
  --brand-2: #2b2f36;
  --primary: #1d2129;
  --primary-ink: #ffffff;
  --accent: #f59e0b;        /* amber — star / highlight */
  --accent-soft: rgba(245, 158, 11, 0.12);
  --link: #1664ff;
  --ok: #00b42a;
  --ok-soft: rgba(0, 180, 42, 0.12);
  --danger: #f53f3f;
  --warn: #ff7d00;
  --info: #1664ff;

  /* Star — warm gold */
  --star: #f59e0b;
  --star-ink: #92400e;

  /* Shadows — layered for depth */
  --shadow: 0 1px 2px rgba(29, 33, 41, 0.04), 0 1px 1px rgba(29, 33, 41, 0.03);
  --shadow-sm: 0 1px 3px rgba(29, 33, 41, 0.05);
  --shadow-panel: 0 6px 20px rgba(29, 33, 41, 0.07), 0 2px 6px rgba(29, 33, 41, 0.04);
  --shadow-pop: 0 12px 40px rgba(29, 33, 41, 0.12), 0 4px 12px rgba(29, 33, 41, 0.06);
  --shadow-card-hover: 0 10px 28px rgba(29, 33, 41, 0.10), 0 3px 8px rgba(29, 33, 41, 0.05);

  /* Radius */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Layout */
  --sider-w: 232px;
  --top-h: 58px;
  --tab-h: 0px;
  --content-max: 1160px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.18s;

  /* Fonts */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", "Menlo", "Consolas",
    "Liberation Mono", monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141416;
  --bg-grad: radial-gradient(1200px 480px at 80% -8%, rgba(245, 158, 11, 0.07), transparent 60%), #141416;
  --surface: #1d1d20;
  --surface-2: #242427;
  --surface-3: #2a2a2d;
  --surface-glass: rgba(29, 29, 32, 0.82);

  --text: #e8e8ea;
  --text-2: #b8b8be;
  --text-3: #7d7d85;
  --text-4: #5c5c64;

  --line: #2c2c30;
  --line-2: #3e3e44;
  --line-soft: #252528;

  --brand: #f2f3f5;
  --brand-2: #e8e8ea;
  --primary: #f2f3f5;
  --primary-ink: #1d1d20;
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --link: #60a5fa;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --star: #fbbf24;
  --star-ink: #fde68a;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-panel: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { padding-bottom: var(--tab-h); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--text); }

img { max-width: 100%; display: block; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-4); border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 8px;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}

/* ============================================================
   Layout shell
   ============================================================ */
.app { display: flex; min-height: 100dvh; }

/* ---------- Sidebar ---------- */
.sider {
  width: var(--sider-w);
  flex: 0 0 var(--sider-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--top-h);
  padding: 0 18px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
}
.brand:hover { text-decoration: none; background: var(--surface-2); }

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  transition: transform var(--dur) var(--ease-out);
}
.brand:hover .brand-mark { transform: scale(1.06) rotate(-3deg); }

.brand-lockup {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.brand-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand-sub {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.sider-nav {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sider-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sider-nav a svg { flex: 0 0 auto; opacity: 0.8; transition: opacity var(--dur); }
.sider-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sider-nav a:hover svg { opacity: 1; }
.sider-nav a.is-on {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}
.sider-nav a.is-on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sider-nav a.is-on svg { opacity: 1; color: var(--accent); }

.sider-nav .nav-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.sider-nav a.is-on .nav-badge { background: var(--accent-soft); color: var(--star-ink); }

.sider-foot {
  margin-top: auto;
  padding: 14px 18px 18px;
  color: var(--text-3);
  font-size: 11.5px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sider-foot .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  box-shadow: 0 0 0 3px var(--ok-soft);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--ok-soft); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

/* ---------- Main column ---------- */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--top-h);
  background: var(--surface-glass);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 25;
}

.workspace {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 13px;
  flex: 0 0 auto;
}
.workspace svg { color: var(--text-3); }

.cmd {
  flex: 1 1 auto;
  max-width: 540px;
  position: relative;
}
.cmd > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.cmd input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 19px;
  padding: 0 14px 0 36px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
}
.cmd input::placeholder { color: var(--text-3); }
.cmd input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.cmd .kbd-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-4);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--mono);
  pointer-events: none;
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  padding: 0;
  transition: background var(--dur) var(--ease), color var(--dur), transform var(--dur);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--dur) var(--ease), border-color var(--dur), transform var(--dur), box-shadow var(--dur), opacity var(--dur);
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: var(--line-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  box-shadow: var(--shadow-panel);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.btn-accent:hover { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }

.btn-block { width: 100%; height: 38px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- Content ---------- */
.content {
  padding: 22px 26px 56px;
  max-width: var(--content-max);
  width: 100%;
  flex: 1;
}
.main-col { flex: 1; }

.view { display: none; animation: fadeUp 0.3s var(--ease-out); }
.view.is-on { display: block; }

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

/* ---------- Page head ---------- */
.page-head { margin: 4px 0 22px; }
.page-head .crumb {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-head .crumb::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 4px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.page-head p {
  margin: 0;
  color: var(--text-2);
  max-width: 50em;
  line-height: 1.65;
}
.page-head p code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}
.stat::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.5;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-panel); }
.stat b {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat span {
  display: block;
  margin-top: 7px;
  color: var(--text-3);
  font-size: 12.5px;
  position: relative;
  z-index: 1;
}

.status-line {
  color: var(--text-3);
  font-size: 12px;
  margin: 0 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status-line .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

/* ---------- Grid 2 ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  margin-bottom: 26px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  color: var(--text);
  font-size: 14px;
}
.panel-hd span { font-weight: 400; color: var(--text-3); font-size: 12px; }

/* Terminal */
.term pre, .code-body {
  margin: 0;
  padding: 16px 18px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-x: auto;
  background: var(--surface-2);
  color: var(--text);
}
.term .cmt { color: var(--text-3); }
.term .cmd { color: var(--text); font-weight: 500; }
.term .ok { color: var(--ok); }

/* Compare table */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compare th, .compare td {
  text-align: left;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare th {
  color: var(--text-3);
  font-weight: 500;
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare tr:last-child td { border-bottom: 0; }
.compare td:first-child {
  color: var(--text-2);
  width: 76px;
  white-space: nowrap;
  font-weight: 500;
}

/* ---------- Section heads ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head p { margin: 5px 0 0; color: var(--text-3); font-size: 12.5px; }

/* ---------- Feature grid ---------- */
.feature-grid, .card-grid, .guide-grid {
  display: grid;
  gap: 14px;
}
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.card-grid { grid-template-columns: repeat(3, 1fr); }
.guide-grid { grid-template-columns: 1fr 1fr; }

.feature, .step, .plugin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature, .step { padding: 18px; transition: transform var(--dur) var(--ease-out), box-shadow var(--dur); }
.feature:hover, .step:hover { transform: translateY(-2px); box-shadow: var(--shadow-panel); }
.feature .num, .step .num {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.feature h3, .step h3 { margin: 0 0 7px; font-size: 14.5px; font-weight: 650; }
.feature p, .step p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.feature p code, .step p code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ============================================================
   Plugin cards
   ============================================================ */
.plugin-card {
  padding: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 176px;
  position: relative;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur), box-shadow var(--dur);
}
.plugin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), transparent 50%);
  opacity: 0;
  transition: opacity var(--dur);
  pointer-events: none;
}
.plugin-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-card-hover);
}
.plugin-card:hover::before { opacity: 1; }
.plugin-card.is-fav::after {
  content: "★";
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--accent);
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(245,158,11,0.4));
}
.plugin-card.is-official { border-left: 3px solid var(--accent); }

.plugin-top { display: flex; gap: 11px; align-items: flex-start; position: relative; z-index: 1; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.official {
  background: linear-gradient(135deg, #1d2129, #2b2f36);
  color: #fff;
  border-color: transparent;
}

.plugin-title {
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.3;
  word-break: break-all;
  color: var(--text);
  letter-spacing: -0.01em;
}
.plugin-owner {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.plugin-desc {
  margin: 11px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em;
  position: relative;
  z-index: 1;
}
.plugin-meta {
  margin-top: auto;
  padding-top: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--text-3);
  font-size: 12px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.plugin-meta .star {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.plugin-meta .star svg { color: var(--accent); }
.plugin-meta .lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.plugin-meta .lang .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.plugin-meta .updated { color: var(--text-4); }
.plugin-meta .recent {
  color: var(--ok);
  font-weight: 500;
}

.tag {
  padding: 0 7px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.tag.archived { background: rgba(245, 63, 63, 0.1); color: var(--danger); }
.tag.lic { background: var(--ok-soft); color: var(--ok); }

.card-copy {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur), transform var(--dur), background var(--dur), color var(--dur);
  z-index: 2;
}
.plugin-card:hover .card-copy { opacity: 1; transform: translateY(0); }
.card-copy:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.plugin-card.is-fav .card-copy { right: 34px; }

.fav-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-4);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur), transform var(--dur), color var(--dur);
  z-index: 2;
}
.plugin-card:hover .fav-btn { opacity: 1; transform: translateY(0); }
.fav-btn:hover { color: var(--accent); }
.fav-btn.is-on { opacity: 1; transform: translateY(0); color: var(--accent); }
.plugin-card.is-fav .fav-btn { opacity: 1; transform: translateY(0); }

/* ============================================================
   Toolbar / search / filters
   ============================================================ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .search {
  flex: 1 1 260px;
  position: relative;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 34px;
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.search .clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--surface-3);
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-3);
  display: none;
  place-items: center;
}
.search .clear-btn.is-on { display: grid; }
.search .clear-btn:hover { background: var(--line-2); color: var(--text); }

.selects { display: flex; gap: 8px; align-items: center; }
.selects select {
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 28px 0 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: 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='%2386909c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--dur);
}
.selects select:hover { border-color: var(--line-2); }
.selects select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* View toggle */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.view-toggle button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--dur), color var(--dur);
}
.view-toggle button:hover { background: var(--surface-2); color: var(--text-2); }
.view-toggle button.is-on { background: var(--surface-3); color: var(--accent); }

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 15px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.chip .chip-count { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.chip.is-on {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.chip.is-on .chip-count { color: var(--accent); }

/* List view */
.card-grid.is-list {
  grid-template-columns: 1fr;
  gap: 8px;
}
.card-grid.is-list .plugin-card {
  flex-direction: row;
  align-items: center;
  min-height: 0;
  padding: 12px 15px;
  gap: 14px;
}
.card-grid.is-list .plugin-top { flex: 0 0 auto; width: 200px; min-width: 0; }
.card-grid.is-list .plugin-desc {
  flex: 1;
  min-height: 0;
  -webkit-line-clamp: 2;
  margin: 0;
}
.card-grid.is-list .plugin-meta { padding-top: 0; flex: 0 0 auto; width: auto; }
@media (max-width: 720px) {
  .card-grid.is-list .plugin-card { flex-wrap: wrap; }
  .card-grid.is-list .plugin-top { width: 100%; }
  .card-grid.is-list .plugin-meta { width: 100%; }
}

/* Pager */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--text-2);
}
.pager #pageInfo { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 60px; text-align: center; }

.empty {
  color: var(--text-3);
  text-align: center;
  padding: 56px 16px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty .empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.5; }

/* ---------- Prose ---------- */
.prose h2 { margin: 0 0 10px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.prose > p { color: var(--text-2); margin: 0 0 16px; }
.prose code, .copy-row code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.notice {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text-2);
  font-size: 13px;
  border-left: 3px solid var(--accent);
}
.notice code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ---------- Footer ---------- */
.footer {
  color: var(--text-3);
  font-size: 12px;
  padding: 10px 26px 32px;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.footer a { color: var(--text-2); }
.footer .sep { color: var(--line-2); margin: 0 2px; }
.footer .kbd {
  font-family: var(--mono);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
}

/* ---------- FAQ ---------- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 9px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.faq details[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-3);
  transition: transform var(--dur);
  font-weight: 300;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; color: var(--text-2); line-height: 1.65; }

/* ---------- Directory page ---------- */
.dir-page { max-width: 820px; margin: 0 auto; padding: 26px 16px 52px; }
.dir-nav { color: var(--text-3); font-size: 12px; margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.dir-list { display: flex; flex-direction: column; gap: 12px; }
.dir-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.dir-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.dir-item h2 { margin: 0 0 7px; font-size: 16px; }
.dir-meta, .dir-install { color: var(--text-3); font-size: 12px; }
.dir-install code { font-family: var(--mono); word-break: break-all; }

/* ---------- Mobile tabbar ---------- */
.tabbar { display: none; }

/* ============================================================
   Drawer (plugin detail)
   ============================================================ */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(29, 33, 41, 0.4);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.drawer-mask.is-on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  z-index: 60;
  right: 0;
  top: 0;
  height: 100dvh;
  width: min(440px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.26s var(--ease-out);
  overflow-y: auto;
  padding: 18px 22px 40px;
  box-shadow: var(--shadow-pop);
}
.drawer.is-on { transform: none; }
.drawer .drawer-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--surface-2);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-3);
  display: grid;
  place-items: center;
  transition: background var(--dur), color var(--dur);
}
.drawer .drawer-close:hover { background: var(--surface-3); color: var(--text); }
.drawer .drawer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 20px;
  font-weight: 700;
  border: 1px solid var(--line);
  overflow: hidden;
}
.drawer .drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.drawer h2 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-all;
  padding-right: 40px;
}
.drawer .plugin-owner { font-size: 13px; color: var(--text-3); margin-bottom: 0; }
.drawer .drawer-desc {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 14px 0 0;
}
.drawer .plugin-meta { margin-top: 14px; gap: 10px; }
.drawer .drawer-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.drawer .drawer-topic {
  font-size: 11.5px;
  color: var(--link);
  background: rgba(22, 100, 255, 0.08);
  padding: 3px 9px;
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--dur);
}
.drawer .drawer-topic:hover { background: rgba(22, 100, 255, 0.16); text-decoration: none; }

.drawer .drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.drawer .drawer-stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.drawer .drawer-stat b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.drawer .drawer-stat span { font-size: 11px; color: var(--text-3); }

.copy-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
}
.copy-row code {
  flex: 1;
  border: 1px solid var(--line);
  padding: 9px 11px;
  overflow: auto;
  white-space: nowrap;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.drawer-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--tab-h));
  transform: translate(-50%, 12px);
  background: var(--brand);
  color: var(--primary-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  box-shadow: var(--shadow-pop);
  transition: opacity var(--dur), transform var(--dur) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.skeleton-card { height: 176px; }

/* ---------- Insights page ---------- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.insight-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
}
.insight-card .insight-sub { color: var(--text-3); font-size: 12px; margin-bottom: 14px; }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .bar-label { width: 90px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.bar-row .bar-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: 5px; overflow: hidden; position: relative; }
.bar-row .bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #d97706);
  transition: width 0.6s var(--ease-out);
  min-width: 2px;
}
.bar-row .bar-val { width: 70px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row .legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend-row .legend-name { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .legend-val { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Topic cloud ---------- */
.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 0;
}
.topic-cloud .topic-item {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all var(--dur);
  font-weight: 500;
}
.topic-cloud .topic-item:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.topic-cloud .topic-item .topic-n { color: var(--text-4); margin-left: 4px; font-size: 11px; }
.topic-cloud .topic-item:hover .topic-n { color: rgba(255,255,255,0.8); }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 10px 0 10px 22px;
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.timeline-item:hover { background: var(--surface-2); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.timeline-item .tl-name { font-weight: 600; font-size: 13.5px; }
.timeline-item .tl-meta { color: var(--text-3); font-size: 12px; }
.timeline-item .tl-time { color: var(--text-4); font-size: 11.5px; margin-left: auto; white-space: nowrap; }

.mobile-brand { display: none; }

/* ---------- Empty hero badge ---------- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-soft);
  color: var(--star-ink);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sider { display: none; }
  .mobile-brand { display: flex; }
  .grid-2, .feature-grid, .card-grid, .guide-grid, .stats, .insight-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px 18px 44px; }
  .drawer .drawer-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --tab-h: 54px; }
  .workspace { display: none; }
  .grid-2, .feature-grid, .card-grid, .guide-grid, .stats, .insight-grid { grid-template-columns: 1fr; }
  .content { padding: 14px 13px 36px; }
  .cmd { max-width: none; }
  .cmd .kbd-hint { display: none; }
  .page-head h1 { font-size: 21px; }
  .drawer {
    width: 100%;
    height: auto;
    max-height: 88dvh;
    top: auto;
    bottom: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding: 20px 18px 36px;
  }
  .drawer.is-on { transform: none; }
  .drawer .drawer-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .drawer .drawer-stat { padding: 9px 6px; }
  .drawer .drawer-stat b { font-size: 15px; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 45;
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--dur);
  }
  .tabbar a.is-on { color: var(--accent); font-weight: 600; }
  .hide-sm { display: none !important; }
}

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

/* ============================================================
   v2.1 additions — tier badges, search history, export, modal
   ============================================================ */

/* Star tier badges on card titles */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
  flex: 0 0 auto;
}
.tier-badge.tier-fire { background: linear-gradient(135deg, #f59e0b, #dc2626); color: #fff; box-shadow: 0 1px 3px rgba(220,38,38,0.35); }
.tier-badge.tier-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.tier-badge.tier-silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.tier-badge.tier-bronze { background: var(--surface-3); color: var(--text-3); }

/* NEW badge for recently created plugins */
.new-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,185,129,0.3);
}

/* Card entrance stagger animation */
.plugin-card {
  animation: cardIn 0.35s var(--ease-out) backwards;
  animation-delay: calc(var(--idx, 0) * 0.04s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Search history dropdown */
.search-history {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  z-index: 40;
  display: none;
  flex-direction: column;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.search-history.is-on { display: flex; }
.search-history .history-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--dur), color var(--dur);
}
.search-history .history-item::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background: var(--text-4);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.search-history .history-item:hover { background: var(--surface-2); color: var(--text); }
.search-history .history-clear {
  margin-top: 4px;
  text-align: center;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  padding: 8px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: color var(--dur), background var(--dur);
}
.search-history .history-clear:hover { color: var(--danger); background: var(--surface-2); }

/* Archived toggle button */
#archivedToggle.is-on {
  background: var(--accent-soft);
  color: var(--star-ink);
  border-color: transparent;
  font-weight: 600;
}

/* Export dropdown menu */
.export-menu { position: relative; }
.export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  z-index: 40;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.export-menu:hover .export-dropdown,
.export-menu:focus-within .export-dropdown { display: flex; }
.export-dropdown button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur), color var(--dur);
}
.export-dropdown button:hover { background: var(--surface-2); color: var(--text); }

/* Modal (shortcuts) */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(29, 33, 41, 0.45);
  backdrop-filter: blur(3px);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.modal-mask.is-on { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed;
  z-index: 75;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
  overflow: hidden;
}
.modal.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-hd h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 2px; }
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--text-2);
}
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 10px;
  color: var(--text);
  font-weight: 600;
  min-width: 32px;
  text-align: center;
}

/* Better focus rings */
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible,
.view-toggle button:focus-visible, .selects select:focus-visible,
.search input:focus-visible, .cmd input:focus-visible,
.plugin-card:focus-visible, .fav-btn:focus-visible, .card-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Empty state with icon */
.empty .empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
  line-height: 1;
}

/* Drawer recent section visibility */
#drawerRecent:empty { display: none; }
#drawerRecentHead:has(+ #drawerRecent:empty) { display: none; }

/* ============================================================
   v2.2 additions — skeleton, back-to-top, context menu, details
   ============================================================ */

/* Skeleton card */
.skeleton-card { cursor: default; pointer-events: none; }
.skeleton-card .plugin-meta { gap: 8px; }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: calc(28px + var(--tab-h));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 35;
  box-shadow: var(--shadow-panel);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.85);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease-out), background var(--dur), color var(--dur);
}
.back-to-top.is-on { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.back-to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px) scale(1.05); }
@media (max-width: 720px) {
  .back-to-top { right: 16px; bottom: calc(20px + var(--tab-h)); }
}

/* Context menu */
.ctx-menu {
  position: fixed;
  z-index: 85;
  min-width: 184px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: scale(0.95);
  transform-origin: top left;
  transition: opacity 0.12s, transform 0.12s;
}
.ctx-menu.is-on {
  display: flex;
  opacity: 1;
  transform: scale(1);
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background var(--dur), color var(--dur);
}
.ctx-item svg { flex: 0 0 auto; opacity: 0.8; }
.ctx-item:hover { background: var(--surface-2); color: var(--text); }
.ctx-item[data-ctx="fav"] svg { color: var(--accent); }

/* Star icon bounce on card hover */
.plugin-card:hover .star svg {
  animation: starBounce 0.5s var(--ease-out);
}
@keyframes starBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25) rotate(-8deg); }
  70% { transform: scale(0.95); }
}

/* Drawer scrollbar polish */
.drawer { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.drawer::-webkit-scrollbar { width: 6px; }
.drawer::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; border: 0; }

/* Dark mode tier badge contrast */
[data-theme="dark"] .tier-badge.tier-silver { background: linear-gradient(135deg, #94a3b8, #64748b); }
[data-theme="dark"] .tier-badge.tier-bronze { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--line); }
[data-theme="dark"] .new-badge { box-shadow: 0 1px 2px rgba(52,211,153,0.25); }

/* Star bucket bar label wider */
#insStarBuckets .bar-label { width: 90px; }

/* Mobile toolbar — make secondary buttons wrap nicely */
@media (max-width: 720px) {
  .toolbar {
    gap: 8px;
  }
  .toolbar .view-toggle,
  .toolbar .export-menu,
  #archivedToggle,
  [data-random] {
    order: 3;
  }
  .toolbar .search { order: 1; flex-basis: 100%; }
  .toolbar .selects { order: 2; }
  .toolbar .view-toggle { margin-left: auto; }
  .back-to-top { right: 14px; bottom: calc(70px + var(--tab-h)); }
}

/* ============================================================
   v2.3 additions — search highlight, compare bar/modal, heatmap
   ============================================================ */

/* Search highlight mark */
mark.hl {
  background: var(--accent-soft);
  color: var(--star-ink);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: inset 0 -1px 0 rgba(245, 158, 11, 0.4);
}
[data-theme="dark"] mark.hl {
  background: rgba(251, 191, 36, 0.22);
  color: var(--star-ink);
}

/* Context menu separator */
.ctx-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 8px;
}
.ctx-item[data-ctx="compare"] { color: var(--accent); }

/* Compare bar */
.compare-bar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--tab-h));
  transform: translate(-50%, 80px);
  z-index: 38;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: min(680px, calc(100vw - 32px));
  opacity: 0;
  transition: transform 0.28s var(--ease-out), opacity 0.2s;
}
.compare-bar.is-on {
  display: flex;
  transform: translate(-50%, 0);
  opacity: 1;
}
.compare-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  font-weight: 500;
}
.compare-label svg { color: var(--accent); }
.compare-label b { color: var(--accent); font-weight: 700; }
.compare-items {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 3px 4px 3px 4px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
}
.compare-chip:hover { border-color: var(--line-2); background: var(--surface-3); }
.cc-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
}
.cc-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.cc-remove {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background var(--dur), color var(--dur);
}
.cc-remove:hover { background: var(--danger); color: #fff; }
.compare-actions { display: flex; gap: 6px; flex: 0 0 auto; }
@media (max-width: 720px) {
  .compare-bar { bottom: calc(76px + var(--tab-h)); padding: 8px 10px; }
  .compare-label { display: none; }
}

/* Compare modal */
.compare-modal { width: min(820px, calc(100vw - 32px)); }
.compare-modal .modal-body { padding: 0; }
.cmp-table-wrap { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cmp-table th, .cmp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: top;
}
.cmp-table thead th {
  background: var(--surface-2);
  font-weight: 650;
  position: sticky;
  top: 0;
  z-index: 1;
}
.cmp-table thead th:first-child { text-align: left; width: 90px; }
.cmp-table thead a { color: var(--link); }
.cmp-table .cmp-owner {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 400;
}
.cmp-table .cmp-label {
  text-align: left;
  color: var(--text-3);
  font-size: 12px;
  background: var(--surface-2);
  font-weight: 500;
}
.cmp-table .cmp-max {
  background: var(--accent-soft);
  color: var(--star-ink);
  font-weight: 700;
}
[data-theme="dark"] .cmp-table .cmp-max { color: var(--star-ink); }
.cmp-foot {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

/* Heatmap */
.heatmap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
  padding: 8px 4px 0;
}
.heat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: default;
}
.heat-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 5px 5px 0 0;
  background: var(--surface-3);
  transition: height 0.6s var(--ease-out), filter 0.2s;
  min-height: 4px;
}
.heat-bar[data-intensity="1"] { background: rgba(245, 158, 11, 0.3); }
.heat-bar[data-intensity="2"] { background: rgba(245, 158, 11, 0.55); }
.heat-bar[data-intensity="3"] { background: rgba(245, 158, 11, 0.78); }
.heat-bar[data-intensity="4"] { background: var(--accent); box-shadow: 0 -2px 8px rgba(245, 158, 11, 0.4); }
.heat-col:hover .heat-bar { filter: brightness(1.15); }
.heat-val {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.heat-label {
  font-size: 10.5px;
  color: var(--text-3);
}

/* ============================================================
   v2.4 additions — global search history, lang trend, hover tip
   ============================================================ */

/* Global search history dropdown — wider than market one */
.global-search-history {
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-width: none;
}
@media (max-width: 720px) {
  .global-search-history { right: 0; }
}

/* Language trend stacked chart */
.lang-trend { padding: 4px 0; }
.stack-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 8px 4px 0;
}
.stack-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
  cursor: default;
  min-width: 0;
}
.stack-bar {
  width: 100%;
  max-width: 48px;
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  transition: height 0.6s var(--ease-out);
}
.stack-seg {
  width: 100%;
  transition: filter 0.2s, transform 0.2s;
  min-height: 2px;
}
.stack-col:hover .stack-seg { filter: brightness(1.1); }
.stack-col:hover .stack-seg:hover { filter: brightness(1.25); transform: scaleX(1.02); }
.stack-val {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.stack-label {
  font-size: 10.5px;
  color: var(--text-3);
}
.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
}
.stack-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* Card hover preview tooltip */
.hover-tip {
  position: fixed;
  z-index: 82;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 14px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease-out);
}
.hover-tip.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hover-tip .tip-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.hover-tip .tip-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}
.hover-tip .tip-owner {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}
.hover-tip .tip-desc {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hover-tip .tip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 8px;
}
.hover-tip .tip-meta .star { color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.hover-tip .tip-meta .star svg { color: var(--accent); }
.hover-tip .tip-meta .lang { display: inline-flex; align-items: center; gap: 5px; }
.hover-tip .tip-meta .lang .dot { width: 9px; height: 9px; border-radius: 50%; }
.hover-tip .tip-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.hover-tip .tip-topic {
  font-size: 11px;
  color: var(--link);
  background: rgba(22, 100, 255, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
}
.hover-tip .tip-hint {
  font-size: 11px;
  color: var(--text-4);
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

/* ============================================================
   v2.5 additions — favorites page, no-result recs, hero dark
   ============================================================ */

/* No-result recommendations */
.no-result-recs {
  margin-top: 20px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-column: 1 / -1;
  width: 100%;
}
.no-result-recs h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}
.no-result-recs .card-grid {
  gap: 12px;
  grid-template-columns: repeat(3, 1fr) !important;
}
@media (max-width: 720px) {
  .no-result-recs .card-grid { grid-template-columns: 1fr !important; }
}

/* Favorites page stats */
.fav-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.fav-stats .stat { padding: 16px 18px 14px; }

/* Favorites empty state — larger icon */
#favEmpty .empty-icon {
  font-size: 48px;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 16px;
}

/* Dark mode hero gradient refinement — more atmospheric */
[data-theme="dark"] {
  --bg-grad: radial-gradient(900px 400px at 78% -6%, rgba(245, 158, 11, 0.10), transparent 55%),
             radial-gradient(700px 360px at 12% 8%, rgba(96, 165, 250, 0.07), transparent 50%),
             #141416;
}
[data-theme="dark"] .hero-badge {
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

/* Sidebar nav: favorites link accent */
.sider-nav a[data-nav="favorites"] svg { color: var(--text-3); }
.sider-nav a[data-nav="favorites"].is-on svg { color: var(--accent); }

/* Card hover: subtle sheen sweep */
.plugin-card { position: relative; overflow: hidden; }
.plugin-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.6s var(--ease);
  z-index: 0;
}
.plugin-card:hover::after { left: 120%; }
[data-theme="dark"] .plugin-card::after {
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.04), transparent);
}

/* Favorites page drawer avatar bg */
#drawerAvatar { font-size: 0; }
#drawerAvatar:empty::before { content: "D"; font-size: 20px; }

/* ============================================================
   v2.6 additions — notice bar, relevance sort
   ============================================================ */

/* Global notice bar */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  background: linear-gradient(90deg, var(--accent-soft), rgba(96, 165, 250, 0.06));
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  max-height: 60px;
  transition: max-height 0.3s var(--ease), padding 0.3s, opacity 0.3s;
}
.notice-bar.is-off {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom-color: transparent;
}
.notice-bar .notice-icon {
  font-size: 15px;
  flex: 0 0 auto;
}
.notice-bar .notice-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-bar .notice-text b { color: var(--accent); font-weight: 700; }
.notice-bar .notice-text a { color: var(--link); }
.notice-bar .notice-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background var(--dur), color var(--dur);
}
.notice-bar .notice-close:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 720px) {
  .notice-bar { padding: 8px 14px; font-size: 12px; }
  .notice-bar .notice-text { white-space: normal; }
}

/* Relevance sort indicator — subtle highlight when active */
#sortSelect option[value="relevance"] { color: var(--accent); font-weight: 600; }

/* Compare history section in modal */
.cmp-history {
  padding: 0 18px 18px;
  max-height: 180px;
  overflow-y: auto;
}
.cmp-history:empty { display: none; }
.cmp-hist-h {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cmp-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.cmp-hist-row:hover { background: var(--surface-2); }
.cmp-hist-names {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2);
}
.cmp-hist-ago {
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  flex: 0 0 auto;
}
.cmp-hist-restore {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--dur);
}
.cmp-hist-restore:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================================================
   v2.7 additions — plugin detail page polish
   ============================================================ */

/* Plugin detail page (p/*.html) — load app.css but tweak */
.dir-page .plugin-meta,
.content > .plugin-meta {
  flex-wrap: wrap;
  gap: 8px;
}
/* Topics on detail page: proper wrapping */
.content > .plugin-meta .drawer-topic {
  display: inline-block;
  margin: 2px 4px 2px 0;
}

/* Similar plugin mini-cards on detail page */
.content > .card-grid .plugin-card[data-open] {
  cursor: pointer;
}
.content > .card-grid .avatar {
  background: var(--surface-3) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--line);
}

/* ============================================================
   v2.8 additions — spell suggest, sparkline in tooltip
   ============================================================ */

/* Spelling suggestions on no-result */
.spell-suggest {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-column: 1 / -1;
  width: 100%;
}
.spell-suggest .ss-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.spell-suggest .ss-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--star-ink);
  border-radius: 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.spell-suggest .ss-chip:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Mini sparkline in hover tooltip */
.hover-tip .tip-spark {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--line-soft);
}
.hover-tip .ts-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}
.hover-tip .ts-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  min-width: 0;
}
.hover-tip .ts-bar {
  flex: 1;
  min-width: 2px;
  background: linear-gradient(to top, var(--accent), #fbbf24);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: filter 0.2s;
}
.hover-tip .ts-bar:last-child {
  background: linear-gradient(to top, var(--accent), #dc2626);
}
.hover-tip .tip-spark:hover .ts-bar { filter: brightness(1.15); }
.hover-tip .ts-age {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   v2.9 additions — author leaderboard, notice rotator, share
   ============================================================ */

/* Author leaderboard table */
.lb-table-wrap {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
  border-radius: var(--radius);
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lb-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}
.lb-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.lb-table th.lb-num {
  text-align: right;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur);
}
.lb-table th.lb-num:hover { color: var(--accent); }
.lb-table th .sort-arrow { color: var(--accent); font-size: 10px; }
.lb-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.lb-table tbody tr {
  cursor: pointer;
  transition: background var(--dur);
}
.lb-table tbody tr:hover { background: var(--surface-2); }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table .lb-rank {
  width: 40px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-weight: 600;
}
.lb-table .lb-author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 140px;
}
.lb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.lb-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-table .lb-num {
  text-align: right;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lb-table .lb-num .star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
  font-weight: 500;
}
.lb-table .lb-num .star svg { color: var(--accent); }

/* Notice bar rotator */
.notice-bar { position: relative; }
.notice-rotator {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.notice-rotator .notice-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: noticeFade 0.4s var(--ease);
}
@keyframes noticeFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.notice-rotator .notice-text kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  margin: 0 1px;
}
.notice-dots {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
  align-items: center;
  margin: 0 8px;
}
.notice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-2);
  cursor: pointer;
  transition: background var(--dur), transform var(--dur);
}
.notice-dot.is-on {
  background: var(--accent);
  transform: scale(1.3);
}
.notice-dot:hover { background: var(--text-3); }
@media (max-width: 720px) {
  .notice-dots { display: none; }
  .notice-rotator .notice-text { white-space: normal; }
}

/* Context menu share item */
.ctx-item[data-ctx="share"] { color: var(--link); }
.ctx-item[data-ctx="share"] svg { color: var(--link); }

/* ============================================================
   v2.10 additions — dblclick hint, install stats, share fallback
   ============================================================ */

/* Card double-click hint cursor */
.plugin-card[data-open]:not([data-open$="/—"]) {
  cursor: pointer;
}
.plugin-card[data-open]:not([data-open$="/—"]) .plugin-title {
  cursor: pointer;
}

/* Install stats on plugin detail page */
.install-stats .stats {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
}
.install-stats .stat b {
  font-size: 20px;
}

/* Subtle dblclick affordance: card title underline on hover */
.plugin-card[data-open]:not([data-open$="/—"]):hover .plugin-title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
