:root {
  --bg: #0b0d12;
  --bg-soft: #12151d;
  --card: #171b25;
  --card-hover: #1d2230;
  --line: #262c3a;
  --text: #e6e9f0;
  --text-dim: #9aa3b5;
  --text-faint: #6b7385;
  --accent: #6d8fff;
  --accent-soft: rgba(109, 143, 255, 0.12);
  --accent-2: #4fd1a5;
  --radius: 12px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}
.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo:hover { text-decoration: none; }
.logo .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
nav.main { display: flex; gap: 22px; flex: 1; }
nav.main a {
  color: var(--text-dim);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
nav.main a:hover, nav.main a.on { color: var(--text); text-decoration: none; }
nav.main a.on { border-bottom-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 44px; }
.hero h1 {
  font-size: 40px;
  line-height: 1.25;
  margin: 0 0 16px;
  letter-spacing: -1px;
  font-weight: 700;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 640px;
  margin: 0 0 28px;
}
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats div { line-height: 1.4; }
.hero-stats b { display: block; font-size: 22px; font-weight: 700; }
.hero-stats span { color: var(--text-faint); font-size: 13px; }

/* ---------- 分类条 ---------- */
.layerbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 16px 0 14px;
}
.layerbar .chip { font-weight: 600; }
.catbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 4px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .n { opacity: .55; margin-left: 4px; font-size: 12px; }

/* ---------- 卡片墙 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding-bottom: 60px;
  /* 同一行卡片等高：内容多的卡片把整行拉高，其余卡片跟着补白 */
  align-items: stretch;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .16s, border-color .16s, background .16s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card-hover);
}
.card:hover .card-title { color: var(--accent); }
.card-top { display: flex; align-items: flex-start; gap: 12px; }

/* ── 卡片内的迷你收藏按钮（2026-11-26）─────────────────
 * 精选 + 发现两个板块的卡片都用它。
 * 放在 card-top 右上角，不占页脚空间。
 */
.fav-chip {
  position: relative;
  flex-shrink: 0;
  width: 28px; height: 28px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s;
}
.fav-chip:hover { border-color: var(--accent); color: var(--accent); }
.fav-chip.on {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251, 191, 36, .1);
}
.fav-chip.fail { border-color: #ef4444; color: #ef4444; }
.avatar {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
}
.card-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  transition: color .15s;
}
.card-sub {
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 2px 0 0;
}
.card-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 预留 3 行高度：描述长短不影响卡片内部各段的对齐位置 */
  min-height: calc(3 * 1.5em);
}
.card-foot {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
/* 只有「最后一行」页脚才撑到卡底（margin-top:auto）。
   多行卡片时由 .card-foot-last 承担，避免前一行把后一行挤出卡片外。 */
.card-foot-last { margin-top: auto; }
.tag {
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 5px;
}
.card-badge {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--accent-2);
  display: flex; align-items: center; gap: 4px;
}

/* ---------- 卡片速览：层级 / 类别 / 能做什么 / 优点 / 短板 ---------- */
.card-layers {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-top: -4px;
}
.layer-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
}
.layer-tag.layer-app {
  color: var(--accent-2);
  background: rgba(79, 209, 165, 0.12);
  border: 1px solid rgba(79, 209, 165, 0.32);
}
.layer-tag.layer-dev {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(109, 143, 255, 0.32);
}
.layer-cat {
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
}
.card-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.quick-row {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; line-height: 1.55;
}
.quick-label {
  flex-shrink: 0;
  color: var(--text-faint);
  font-size: 11px;
  padding-top: 1px;
  min-width: 44px;
}
.quick-text {
  color: var(--text-dim);
  min-width: 0;
}
/* 「能做什么」这一行是卡片主信息，给亮一点 */
.quick-do .quick-text { color: var(--text); }
.quick-do .quick-label { color: var(--accent-2); }
.chip-pro, .chip-con {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 1px 7px;
  border-radius: 5px;
  margin: 0 4px 3px 0;
  max-width: 100%;
}
.chip-pro {
  color: var(--accent-2);
  background: rgba(79, 209, 165, 0.10);
  border: 1px solid rgba(79, 209, 165, 0.22);
}
.chip-con {
  color: #e8a33d;
  background: rgba(232, 163, 61, 0.10);
  border: 1px solid rgba(232, 163, 61, 0.24);
}

/* ---------- 搜索 ---------- */
.searchbox { display: flex; gap: 10px; margin-bottom: 22px; }
.searchbox input {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 15px;
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  font-family: inherit;
}
.searchbox input:focus { border-color: var(--accent); }
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }

/* ---------- 详情页 ---------- */
.detail { padding: 40px 0 70px; max-width: 820px; }
.back {
  color: var(--text-faint);
  font-size: 13.5px;
  display: inline-block;
  margin-bottom: 26px;
}
.back:hover { color: var(--accent); text-decoration: none; }
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.detail-head .avatar { width: 52px; height: 52px; border-radius: 12px; font-size: 21px; }
.detail h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -0.6px; }
.detail .sub { color: var(--text-faint); font-size: 14px; margin: 0; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 26px; }
/* 详情页速览块：比卡片版上下留白多一点，与 detail-meta 区分开 */
.detail-quick { margin: 0 0 20px; }
.detail-body { color: var(--text-dim); }
.detail-body h2 { color: var(--text); font-size: 21px; margin: 34px 0 12px; }
.detail-body h3 { color: var(--text); font-size: 17px; margin: 26px 0 10px; }
.detail-body p { margin: 0 0 15px; }
.detail-body ul, .detail-body ol { margin: 0 0 16px; padding-left: 22px; }
.detail-body li { margin-bottom: 6px; }
.detail-body code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent-2);
}
.detail-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  overflow-x: auto;
}
.detail-body pre code { background: none; border: none; padding: 0; color: var(--text-dim); }
.detail-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  color: var(--text-dim);
}
.detail-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.detail-body a { color: var(--accent); }

.action-row { display: flex; gap: 10px; margin: 26px 0; flex-wrap: wrap; }

.related { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.related h2 { font-size: 18px; margin: 0 0 16px; }

/* ---------- 表单 ---------- */
.form-wrap { max-width: 640px; padding: 40px 0 70px; }
.form-wrap h1 { font-size: 28px; margin: 0 0 8px; }
.form-wrap .sub { color: var(--text-dim); margin: 0 0 30px; font-size: 14.5px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-dim);
}
.field .hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.field input[type=text],
.field input[type=url],
.field input[type=email],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
.msg { padding: 12px 15px; border-radius: 8px; font-size: 14px; margin-top: 16px; display: none; }
.msg.ok { display: block; background: rgba(79, 209, 165, .1); border: 1px solid rgba(79,209,165,.3); color: var(--accent-2); }
.msg.err { display: block; background: rgba(255, 100, 100, .1); border: 1px solid rgba(255,100,100,.3); color: #ff8f8f; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-faint);
}
.empty h3 { color: var(--text-dim); font-size: 17px; margin: 0 0 8px; }

/* ---------- 发现板块 ---------- */
.notice {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 15px 18px;
  margin: 22px 0 30px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.75;
}
.notice strong { color: var(--text); }
.notice.ok { border-left-color: var(--accent-2); }
.notice a { color: var(--accent); }

/* 首页发现区块 */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 46px 0 4px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.section-head h2 { font-size: 20px; margin: 0; letter-spacing: -0.3px; }
.section-head .sub { color: var(--text-faint); font-size: 13px; flex: 1; }
.section-head .more { color: var(--accent); font-size: 13.5px; white-space: nowrap; }
.section-head .more:hover { text-decoration: none; }

.card.disc { border-style: dashed; }
.card.disc:hover { border-style: solid; }

/* ---------- 置顶 / 排序 / 关联 ---------- */

/* 人工置顶徽章（boost > 0） */
.card-badge.boost {
  color: #ffcf5c;
  background: rgba(255, 207, 92, .12);
  border-color: rgba(255, 207, 92, .32);
  font-weight: 600;
}
.badge-boost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffcf5c;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* 排序切换条 */
.sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sortbar .label {
  color: var(--text-faint);
  font-size: 13px;
  margin-right: 4px;
}
.sortbar a.sortbtn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-soft);
}
.sortbar a.sortbtn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.sortbar a.sortbtn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* 相关发现区（收录 <-> 发现 双向） */
.related-discovered { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.related-discovered h2 { font-size: 18px; margin: 0 0 6px; }
.related-discovered .hint { color: var(--text-faint); font-size: 13px; margin: 0 0 16px; }
.related-discovered .grid { padding-bottom: 0; }

/* 一键收录按钮 */
.btn.collect {
  background: rgba(79, 209, 165, .12);
  border: 1px solid rgba(79, 209, 165, .4);
  color: var(--accent-2);
}
.btn.collect:hover { background: rgba(79, 209, 165, .2); opacity: 1; }
.btn.collect:disabled { opacity: .55; cursor: not-allowed; }
.btn.collect.done {
  background: rgba(79, 209, 165, .06);
  border-color: rgba(79, 209, 165, .2);
  color: var(--text-faint);
  cursor: default;
}

/* 收录状态徽章 */
.coll-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
}
.coll-state.ok { border-color: rgba(79,209,165,.3); color: var(--accent-2); background: rgba(79,209,165,.08); }
.coll-state .dotmark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 星标榜（首页 Top N） ---------- */
.rank-card { position: relative; padding-top: 26px; }
.rank-no {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 0 0 8px 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-card.top1 .rank-no { background: rgba(255,207,92,.16); border-color: rgba(255,207,92,.4); color: #ffcf5c; }
.rank-card.top2 .rank-no { background: rgba(200,210,230,.13); border-color: rgba(200,210,230,.32); color: #c8d2e6; }
.rank-card.top3 .rank-no { background: rgba(214,150,90,.13); border-color: rgba(214,150,90,.32); color: #d6965a; }

/* 星标数突出显示 */
.rank-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 分享栏 ---------- */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0 4px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.share-label {
  font-size: 13px;
  color: var(--text-faint);
  margin-right: 2px;
}
.share-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-dim);
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }

/* 卡片内的官网直达 */
.card-site {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-faint);
  text-decoration: none;
  white-space: nowrap;
}
.card-site:hover { color: var(--accent); text-decoration: none; }

/* ---------- 语义搜索命中片段 ---------- */
.match-card { flex-direction: column; }
.match-snippet {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
}
.match-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.match-snippet p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}
.match-meta {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- 页脚 ---------- */
footer.bottom {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--text-faint);
  font-size: 13px;
}
footer.bottom .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.bottom a { color: var(--text-dim); }

@media (max-width: 640px) {
  .hero h1 { font-size: 29px; }
  .hero { padding: 40px 0 30px; }
  .wrap { padding: 0 16px; }
  nav.main { gap: 14px; }
  .grid { grid-template-columns: 1fr; }
  .detail h1 { font-size: 24px; }

  /* ---- 顶栏：窄屏收紧间距，按钮缩小 ---- */
  header.top .wrap { gap: 12px; height: 56px; }
  .logo { font-size: 15px; gap: 7px; }
  nav.main { gap: 12px; }
  nav.main a { font-size: 13px; }
  header.top .btn { padding: 7px 12px !important; font-size: 12.5px !important; }

  /* ---- 搜索框：换行，输入框独占一行 ---- */
  .searchbox { flex-wrap: wrap; gap: 8px; }
  .searchbox input { flex: 1 1 100%; min-width: 0; }
  .searchbox .btn { flex: 1 1 auto; padding: 10px 14px; font-size: 13.5px; }

  /* ---- 卡片：排名角标不再绝对定位，避免压住标题 ---- */
  .grid { gap: 14px; }
  .card { padding: 16px; }
  .rank-card { padding-top: 16px; }
  .rank-no {
    position: static;
    display: inline-flex;
    align-self: flex-start;
    width: auto;
    min-width: 0;
    max-width: 42px;
    height: 20px;
    padding: 0 8px;
    border-radius: 5px;
    border-right: none;
    border-bottom: none;
    margin-bottom: 8px;
    font-size: 12px;
  }
  .rank-card.top1 .rank-no,
  .rank-card.top2 .rank-no,
  .rank-card.top3 .rank-no { border-color: currentColor; }

  /* ---- 排序条：可横向滚动，不换行挤压 ---- */
  .sortbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .sortbar .sortbtn { flex: 0 0 auto; white-space: nowrap; }

  /* ---- 详情页 ---- */
  .detail { padding: 28px 0 50px; }
  .detail-head { gap: 12px; }
  .detail-head .avatar { width: 44px; height: 44px; border-radius: 10px; font-size: 18px; }
  .detail h1 { font-size: 22px; }
  .detail-body h2 { font-size: 19px; margin: 26px 0 10px; }
  .detail-body pre { padding: 12px; font-size: 12.5px; }
  .action-row .btn { flex: 1 1 auto; text-align: center; }

  /* ---- 命中片段 ---- */
  .match-snippet { padding: 9px 11px; }
  .match-snippet p { font-size: 12.5px; line-height: 1.65; }

  /* ---- 其他 ---- */
  .hero-stats { gap: 20px; }
  .hero-stats b { font-size: 19px; }
  .section-head { flex-wrap: wrap; gap: 6px 12px; margin: 34px 0 4px; }
  .section-head h2 { font-size: 18px; }
  .catbar { padding: 14px 0 20px; margin-bottom: 22px; }
  .layerbar { padding: 12px 0 10px; }
  .chip { padding: 5px 11px; font-size: 12.5px; }
  footer.bottom .wrap { flex-direction: column; gap: 8px; }
  .form-wrap { padding: 28px 0 50px; }
  .form-wrap h1 { font-size: 24px; }
}

/* 超窄屏（iPhone SE 等 320-375px） */
@media (max-width: 380px) {
  .wrap { padding: 0 12px; }
  nav.main { gap: 9px; }
  nav.main a { font-size: 12.5px; }
  header.top .btn { padding: 6px 9px !important; font-size: 11.5px !important; }
  .card { padding: 14px; }
  .hero h1 { font-size: 25px; }
}

/* ---------- 发现卡片：信息密度增强 ---------- */
/* 第二行页脚：时间轴 + 状态徽章 + 分享，比第一行弱化，避免抢主信息 */
/* 第二行页脚：时间轴 + 状态徽章 + 分享，比第一行弱化，避免抢主信息 */
/* 注意：不能去掉 margin-top:auto —— 卡片是 flex 列布局，
   第一行靠 auto 撑到卡底，第二行若也 auto 会被挤出卡片外。
   这里用负 margin 把第二行拉回卡内，auto 仍留在第一行。 */
.card-foot-sub {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
/* 数字型标签（fork 数）用等宽数字，避免跳动 */
.tag-num { font-variant-numeric: tabular-nums; }
/* 时间标签更淡，弱于语言/许可证等硬信息 */
.tag-dim { opacity: .72; }

/* ---------- 卡片内紧凑分享 ---------- */
.share-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.share-mini {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-faint);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  line-height: 1.6;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.share-mini:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.share-mini.ok { border-color: var(--accent); color: var(--accent); }
.share-mini.fail { border-color: #d96a6a; color: #d96a6a; }

/* div 卡片（发现页）：整卡可点 */
.card.disc[data-href] { cursor: pointer; }
.card.disc[data-href]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 发现详情页：HF 详情 + 功能测试（2026-11-25） ───────────── */

/* HF Space README 抓下来的结构化信息 */
.hf-detail {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft, rgba(255, 255, 255, 0.02));
}
.hf-sub { color: var(--text); font-size: 15px; margin: 18px 0 8px; }
.hf-detail > .hf-sub:first-of-type { margin-top: 0; }
.hf-list { margin: 0 0 6px; padding-left: 20px; line-height: 1.75; }
.hf-list li { margin-bottom: 5px; }
.hf-list code {
  background: rgba(120, 200, 150, 0.14);
  color: #86d6a4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.hf-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.09);
  border-left: 3px solid #fbbf24;
  color: #d9c08a;
  font-size: 14px;
  line-height: 1.7;
}
.hf-meta { margin: 14px 0 0; font-size: 12px; color: var(--text-dim); }
.hf-status {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  margin-bottom: 14px;
}

/* 功能测试区块 */
.demo-block {
  margin: 18px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft, rgba(255, 255, 255, 0.02));
}
.demo-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.demo-block-head .btn { font-size: 13px; padding: 5px 12px; }
.demo-result {
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
}

/* ── 发现列表：两级筛选栏（一级形态 / 二级功能方向）2026-11-25 ── */

/* 一级：形态分类（Skill / 网页 / 代码库）—— 视觉上更突出 */
.catbar.catbar-sub { margin-top: 10px; }

/* 二级（catbar）默认已有样式，这里只调一级 */
#formbar {
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
#formbar .chip-form {
  font-weight: 600;
  font-size: 14px;
  padding: 7px 15px;
}
#formbar .chip-form.on {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* ── 发现详情页：互动元素（2026-11-25） ───────────────── */

/* 收藏按钮 */
.fav-btn.on {
  border-color: #fbbf24;
  color: #fbbf24;
}
.fav-btn .fav-ico {
  font-size: 15px;
  line-height: 1;
}

/* 可点击的 topics 标签行 —— 点标签跳到同标签的发现列表 */
.topics-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 22px;
}
.tag-link {
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.tag-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 相关发现横向滚动 */
.related-discovered .grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.related-discovered .grid > .card {
  flex: 0 0 260px;
  scroll-snap-align: start;
}
.related-discovered .grid::-webkit-scrollbar {
  height: 6px;
}
.related-discovered .grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* 收藏按钮的轻量提示 */
.fav-btn {
  position: relative;
}
.fav-tip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0b0f14;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  animation: favTipFade 1.4s ease forwards;
  z-index: 20;
}
@keyframes favTipFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(-3px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* 快捷键提示条 */
.kbnav-hint {
  margin: 34px 0 10px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-faint);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  transition: opacity 0.8s;
}
.kbnav-hint.fade { opacity: 0.35; }
.kbnav-hint > span {
  color: var(--text-dim);
  margin-right: 4px;
}
.kbnav-hint kbd {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 0 1px;
}
