/* 首页 / 书库共用：嗑糖货架、系列折叠、玩法三步、NPC 气泡、SEO 折叠 */
.play-shelf { width: min(100%, var(--max)); margin-inline: auto; padding-block: clamp(30px, 5vw, 60px) 80px; }
.home-main > section + section { margin-top: clamp(44px, 6vw, 76px); }

/* ---------------- 嗑糖货架（n-card 网格；书库页用 shelf-grid 同名样式） ---------------- */
.sugar-grid, .shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: clamp(14px, 2vw, 20px); align-items: start; }
@media (min-width: 1024px) { .sugar-grid, .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); } }
.series-foot { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.series-foot a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 38px; padding: 6px 10px; border-radius: 10px;
  font-size: 12.5px; color: var(--text-2);
  background: color-mix(in srgb, var(--ink-3) 72%, transparent);
  transition: color .18s, background .18s;
}
.series-foot a:hover { color: var(--rose); background: var(--rose-soft); }
.series-foot a svg { width: 14px; height: 14px; flex: none; }

/* ---------------- 玩法三步 ---------------- */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-card {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--ink-2) 82%, transparent);
  border: 1px solid var(--line-soft);
}
.how-card::after {
  content: ""; position: absolute; right: -36px; top: -36px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rose) 16%, transparent), transparent 66%);
}
.how-card .no { font-size: 11px; letter-spacing: .16em; color: var(--rose); font-weight: 700; }
.how-card b { display: block; font-family: var(--font-serif); font-size: 18px; margin: 9px 0 7px; }
.how-card p { font-size: 13px; color: var(--text-2); line-height: 1.72; }
@media (max-width: 760px) { .how-grid { grid-template-columns: 1fr; } }

/* ---------------- NPC 气泡演示 ---------------- */
.npc-demo {
  margin-top: 16px; padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--rose) 32%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, var(--rose) 6%, transparent), transparent 60%), color-mix(in srgb, var(--ink-2) 78%, transparent);
  display: grid; gap: 8px;
}
.npc-demo-title { font-size: 12px; letter-spacing: .14em; color: var(--rose); font-weight: 600; }
.bubble {
  max-width: 34em; padding: 10px 15px;
  border-radius: 16px; font-family: var(--font-serif);
  font-size: 14.5px; line-height: 1.7;
  background: var(--ink-3); color: var(--text);
  border: 1px solid var(--line-soft);
}
.bubble.you {
  justify-self: end; max-width: 20em;
  background: var(--rose-soft);
  border-color: color-mix(in srgb, var(--rose) 30%, transparent);
  color: var(--text);
  border-bottom-right-radius: 5px;
}
.bubble.npc { justify-self: start; max-width: 24em; border-bottom-left-radius: 5px; }

/* ---------------- SEO 折叠说明 ---------------- */
.seo-about details {
  padding: 4px 18px; border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--ink-2) 62%, transparent);
}
.seo-about summary {
  cursor: pointer; padding: 14px 0;
  font-size: 13.5px; color: var(--muted); font-weight: 600;
  list-style: none;
}
.seo-about summary::-webkit-details-marker { display: none; }
.seo-about summary::after { content: " +"; color: var(--rose); }
.seo-about details[open] summary::after { content: " –"; }
.seo-about .prose { padding: 2px 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.seo-about .prose a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.seo-about .prose a:hover { color: var(--rose); }

/* ---------------- 书库页（沿用旧骨架类名） ---------------- */
#works { scroll-margin-top: calc(var(--header-h) + 16px); }
.shelf-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }
.shelf-heading h1, .shelf-heading h2 { font: 700 clamp(25px, 4vw, 40px)/1.18 var(--font-serif); color: var(--text); }
.shelf-heading h1 em, .shelf-heading h2 em { font-style: normal; color: var(--rose); }
.shelf-heading p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.shelf-count { white-space: nowrap; color: var(--text-2); font-size: 12px; }
.shelf-search { margin-bottom: 18px; max-width: 360px; }
.shelf-search input { min-height: 44px; }
.shelf-message { grid-column: 1 / -1; padding: 28px 0; text-align: center; color: var(--text-2); }
.shelf-message button { margin-left: 10px; }

@media (max-width: 650px) {
  .sugar-grid, .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bubble.you { max-width: 16em; }
}
