/* The home page's 近期发布 stream and the 站主笔记 banner (_includes/home-recent*.html,
   home-notes-banner.html, _pages/notes.md). Self-contained: no dependency on the library
   stylesheet, so it reads the same on the home page, /notes/ and anywhere else it is used. */
.rc, .nb {
  --rc-ink: #1e293b;
  --rc-soft: #475569;
  --rc-faint: #64748b;
  --rc-rule: #e2e8f0;
  --rc-card: #fff;
  --rc-accent: #b91c1c;
  color: var(--rc-ink);
}

/* ---- filters ---- */
.rc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.rc-filters button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rc-rule); border-radius: 999px; padding: 5px 13px;
  background: #fff; color: var(--rc-soft); font: inherit; font-size: 13px; line-height: 1.2; cursor: pointer;
}
.rc-filters button i { font-size: 12px; opacity: .75; }
.rc-filters button:hover { border-color: var(--rc-accent); color: var(--rc-accent); }
.rc-filters button.is-on { border-color: var(--rc-ink); background: var(--rc-ink); color: #fff; }

/* ---- one day ---- */
.rc-day { margin: 0 0 30px; }
.rc-day[hidden], .rc-card[hidden] { display: none; }
.rc-dayhead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: 0 0 12px; padding-left: 12px; border-left: 4px solid var(--rc-accent);
}
.rc-dayhead time { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.rc-dayhead b { font-size: 14px; font-weight: 700; color: var(--rc-soft); }
.rc-tally { font-size: 12.5px; color: var(--rc-faint); }
.rc-tally a { color: var(--rc-accent); font-weight: 600; }
.rc-more { margin: 12px 0 0; font-size: 13px; }
.rc-more a, .rc-end a { color: var(--rc-accent); font-weight: 600; text-decoration: none; }
.rc-more a:hover, .rc-end a:hover { text-decoration: underline; }
.rc-end { margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--rc-rule); font-size: 13px; color: var(--rc-faint); }

/* ---- cards ---- */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.rc-card {
  --c: #475569;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--rc-rule); border-radius: 12px; background: var(--rc-card);
  color: inherit; text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.rc-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, #fff); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); }
.rc-t-analysis  { --c: #c2410c; }
.rc-t-interview { --c: #2563eb; }
.rc-t-scan      { --c: #7c3aed; }
.rc-t-blog      { --c: #0f766e; }
.rc-t-doc       { --c: #64748b; }
.rc-cover {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 16 / 10; background: #e2e8f0;
}
.rc-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.rc-cover--portrait img { object-position: center 18%; }
.rc-cover--tile img { object-position: center; }
.rc-badge {
  position: absolute; left: 8px; top: 8px; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 9px 3px 7px;
  background: rgba(15, 23, 42, .74); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.3;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.rc-badge i { font-size: 11px; color: color-mix(in srgb, var(--c) 40%, #fff); }
.rc-card--bare .rc-cover {
  align-content: center; gap: 6px; padding: 30px 12px 10px; text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 17%, #fff), color-mix(in srgb, var(--c) 5%, #fff));
}
.rc-cover__icon { font-size: 34px; color: color-mix(in srgb, var(--c) 70%, #fff); }
.rc-cover em { font-size: 11.5px; font-style: normal; color: var(--rc-soft); line-height: 1.3; }
.rc-body { display: grid; gap: 7px; padding: 10px 12px 12px; }
.rc-title {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 700; line-height: 1.42; color: var(--rc-ink);
}
.rc-card:hover .rc-title { color: var(--c); }
.rc-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--rc-faint); }
.rc-meta time { font-variant-numeric: tabular-nums; }

/* ---- the keeper's own news ---- */
.rc-news {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; align-items: start;
  border: 1px solid var(--rc-rule); border-radius: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed, #fff); color: inherit; text-decoration: none;
}
.rc-news:hover { border-color: #fdba74; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.rc-news__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.rc-news__main { display: grid; gap: 4px; min-width: 0; }
.rc-news__main strong { font-size: 15px; line-height: 1.4; }
.rc-news__main span { font-size: 13.5px; line-height: 1.65; color: var(--rc-soft); }
.rc-news__main em { font-size: 13px; font-style: normal; font-weight: 600; color: var(--rc-accent); }
.rc-news__cover { grid-column: 2; width: 100%; max-height: 220px; margin-top: 8px; border-radius: 8px; object-fit: cover; object-position: center 25%; }

/* ---- the 站主笔记 banner: two doors ---- */
.nb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.nb--page { margin: 18px 0 28px; }
.nb-card {
  position: relative; display: grid; grid-template-columns: 46% minmax(0, 1fr); align-items: stretch; overflow: hidden;
  min-height: 132px; border: 1px solid var(--rc-rule); border-radius: 14px; background: var(--rc-card);
  color: inherit; text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease;
}
.nb-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .12); }
.nb-card > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-card__text { display: grid; align-content: center; gap: 5px; padding: 14px 16px; min-width: 0; }
.nb-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--rc-accent); }
.nb-card strong { font-size: 19px; line-height: 1.25; }
.nb-card em { font-size: 13px; font-style: normal; line-height: 1.55; color: var(--rc-soft); }
.nb-card small { font-size: 12px; color: var(--rc-faint); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.nb-card--long .nb-kicker { color: #c2410c; }
.nb-card--frag { background: #fffdf8; border-top: 3px solid #d4a72c; }
.nb-card--frag .nb-kicker { color: #8a6d1a; }
.nb-stickers { position: relative; display: block; min-height: 132px; background: repeating-linear-gradient(transparent 0 25px, rgba(60, 90, 160, .1) 25px 26px), #fff8d4; }
.nb-stickers img { position: absolute; display: block; width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.nb-stickers img:nth-child(1) { left: 12%; top: 14%; transform: rotate(-9deg); width: 66px; height: 66px; }
.nb-stickers img:nth-child(2) { right: 12%; top: 10%; transform: rotate(8deg); width: 46px; height: 46px; border-radius: 10px; background: #fff; border: 3px solid #fff; box-sizing: content-box; }
.nb-stickers img:nth-child(3) { left: 34%; bottom: 8%; transform: rotate(5deg); width: 62px; height: 62px; }
.nb-stickers img:nth-child(4) { right: 8%; bottom: 14%; transform: rotate(-6deg); width: 42px; height: 42px; border-radius: 10px; background: #fff; border: 3px solid #fff; box-sizing: content-box; }

/* ---- phones ---- */
@media (max-width: 820px) {
  .nb { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rc-cover { aspect-ratio: 4 / 3; }
  .rc-body { padding: 8px 10px 10px; gap: 5px; }
  .rc-title { font-size: 13.5px; -webkit-line-clamp: 3; }
  .rc-meta span { display: none; }
  .rc-dayhead time { font-size: 18px; }
  .rc-tally { flex-basis: 100%; }
  .rc-badge { left: 6px; top: 6px; padding: 2px 7px 2px 6px; font-size: 10.5px; }
  .rc-news { grid-template-columns: minmax(0, 1fr); }
  .rc-news__avatar { width: 32px; height: 32px; }
  .rc-news__cover { grid-column: 1; }
  .rc-filters { flex-wrap: nowrap; overflow-x: auto; margin-right: -4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .rc-filters::-webkit-scrollbar { display: none; }
  .rc-filters button { flex: 0 0 auto; }
  .nb-card { grid-template-columns: 38% minmax(0, 1fr); min-height: 112px; }
  .nb-card strong { font-size: 17px; }
  .nb-stickers { min-height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-card, .nb-card { transition: none; }
  .rc-card:hover, .nb-card:hover { transform: none; }
}
