/* redpaper — Xiaohongshu-inspired daily paper feed */

:root {
  --rp-red: #FF2442;
  --rp-red-soft: #FF6B8A;
  --rp-bg: #F7F7F7;
  --rp-surface: #FFFFFF;
  --rp-text: #1F1F1F;
  --rp-text-soft: #6B6B6B;
  --rp-text-dim: #9A9A9A;
  --rp-border: #ECECEC;
  --rp-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --rp-radius-lg: 14px;
  --rp-radius-md: 10px;
  --rp-radius-sm: 6px;
  --rp-max-width: 1280px;
  --rp-font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
    "Times New Roman", serif;
  --rp-font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --rp-bg: #121212;
  --rp-surface: #1E1E1E;
  --rp-text: #F0F0F0;
  --rp-text-soft: #B5B5B5;
  --rp-text-dim: #7E7E7E;
  --rp-border: #2A2A2A;
  --rp-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--rp-bg);
  color: var(--rp-text);
  font-family: var(--rp-font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

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

/* ----- Top app bar --------------------------------------------------- */
.rp-app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rp-border);
}

[data-theme="dark"] .rp-app-bar {
  background: rgba(20, 20, 20, 0.85);
}

.rp-app-bar__inner {
  max-width: var(--rp-max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.rp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--rp-text);
}

.rp-brand__logo {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--rp-red), var(--rp-red-soft));
  color: white;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  font-family: var(--rp-font-serif);
}

.rp-brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rp-brand__sub {
  display: none;
  color: var(--rp-text-dim);
  font-size: 13px;
  font-weight: 400;
}

@media (min-width: 720px) {
  .rp-brand__sub {
    display: inline;
  }
}

.rp-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  background: var(--rp-bg);
  border-radius: 999px;
  padding: 6px 14px;
  gap: 8px;
  max-width: 420px;
}

[data-theme="dark"] .rp-search {
  background: #2a2a2a;
}

.rp-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: inherit;
  font-size: 14px;
}

.rp-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--rp-text-soft);
}

.rp-icon-btn:hover {
  background: var(--rp-bg);
  color: var(--rp-red);
}

/* Bigger nav buttons with icon + label (label hidden on narrow screens) */
.rp-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  font-size: 14px;
  color: var(--rp-text);
  transition: all 0.15s;
  white-space: nowrap;
}

.rp-nav-btn:hover {
  border-color: var(--rp-red);
  color: var(--rp-red);
}

.rp-nav-btn__icon {
  font-size: 17px;
  line-height: 1;
}

.rp-nav-btn__label {
  display: none;
  font-weight: 500;
}

@media (min-width: 640px) {
  .rp-nav-btn__label {
    display: inline;
  }
}

/* ----- Channel tabs -------------------------------------------------- */
.rp-tabs {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: var(--rp-bg);
  border-bottom: 1px solid var(--rp-border);
}

.rp-tabs__scroll {
  max-width: var(--rp-max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rp-tabs__scroll::-webkit-scrollbar {
  display: none;
}

.rp-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rp-surface);
  color: var(--rp-text-soft);
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid var(--rp-border);
  transition: all 0.15s;
}

.rp-tab:hover {
  color: var(--rp-text);
}

.rp-tab.is-active {
  background: var(--rp-red);
  color: white;
  border-color: var(--rp-red);
}

/* ----- Masonry feed -------------------------------------------------- */
.rp-container {
  max-width: var(--rp-max-width);
  margin: 0 auto;
  padding: 16px;
}

.rp-feed {
  column-gap: 12px;
  column-count: 2;
}

@media (min-width: 640px) {
  .rp-feed {
    column-count: 3;
  }
}

@media (min-width: 1024px) {
  .rp-feed {
    column-count: 4;
  }
}

@media (min-width: 1400px) {
  .rp-feed {
    column-count: 5;
  }
}

/* ---- 周分组 + 无限滚动 -----------------------------------------------
 * 首页按 7 天窗口分组（本周→上周→上上周…），用户滚到底前 ~600px
 * 自动 append 下一周。每一周是独立的 .rp-feed 多列容器，append 不会
 * 让上面已经定位好的卡片重排。 */
.rp-feed-root {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rp-week {
  margin-top: 22px;
}
.rp-week:first-of-type { margin-top: 0; }

/* 分隔条：上半是几何虚线 + 居中徽章式标签，下半是细数据条。
 * 整体比之前的「一根红线」醒目得多，扫过去就知道在切换"周"。 */
.rp-week__divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 4px 6px;
  padding: 0 6px;
  pointer-events: none;
  user-select: none;
}
.rp-week__divider::before,
.rp-week__divider::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 2px dashed color-mix(in srgb, var(--rp-red) 55%, transparent);
  opacity: 0.7;
}
.rp-week__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--rp-red, #ff2e4d);
  color: #fff;
  font-family: var(--rp-font-serif, "Noto Serif SC", serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(255, 46, 77, 0.22);
}
.rp-week__chip-emoji {
  font-size: 16px;
  line-height: 1;
}

.rp-week__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 4px 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--rp-text) 12%, transparent);
  font-family: var(--rp-font-serif, "Noto Serif SC", serif);
  font-weight: 700;
  font-size: 19px;
  color: var(--rp-text);
}
.rp-week__title em {
  font-style: normal;
  font-family: var(--rp-font-sans, system-ui, sans-serif);
  font-weight: 400;
  font-size: 12px;
  color: var(--rp-text-dim);
  letter-spacing: 0.5px;
}
.rp-week__date {
  font-style: normal;
  font-family: var(--rp-font-sans, system-ui, sans-serif);
  font-weight: 400;
  font-size: 12px;
  color: var(--rp-text-dim);
}

#rp-feed-sentinel {
  height: 1px;
  width: 100%;
}

/* ----- Rankings page ------------------------------------------------- */
.rp-page-title {
  margin: 10px 4px 4px;
  font-family: var(--rp-font-serif, "Noto Serif SC", serif);
  font-size: 26px;
  font-weight: 700;
}
.rp-page-sub {
  margin: 0 4px 16px;
  color: var(--rp-text-dim);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 760px;
}

.rp-rank-tabs {
  margin: 6px 0 14px;
}
.rp-rank-note {
  margin: 0 0 14px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--rp-text-soft);
  background: color-mix(in srgb, var(--rp-accent, #b8e0ff) 12%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--rp-accent, #b8e0ff) 55%, transparent);
  border-radius: 6px;
}
.rp-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rp-rank__row {
  background: var(--rp-surface);
  border-radius: 14px;
  box-shadow: var(--rp-shadow);
  overflow: hidden;
}
.rp-rank__link {
  display: grid;
  grid-template-columns: 56px 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  transition: background 120ms ease;
}
.rp-rank__link:hover {
  background: color-mix(in srgb, var(--rp-red, #ff2e4d) 6%, transparent);
}
.rp-rank__rank {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--rp-text-dim);
  font-size: 17px;
  font-weight: 600;
}
.rp-rank__medal {
  display: inline-block;
  min-width: 28px;
  font-size: 20px;
  line-height: 1;
}
.rp-rank__medal--gold,
.rp-rank__medal--silver,
.rp-rank__medal--bronze {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.18));
}
.rp-rank__score {
  text-align: center;
  font-family: var(--rp-font-serif, "Noto Serif SC", serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--rp-red, #ff2e4d);
  font-variant-numeric: tabular-nums;
}
.rp-rank__body {
  min-width: 0;
}
.rp-rank__title {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.35;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rp-rank__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--rp-text-dim);
}
.rp-rank__chan {
  font-family: var(--rp-font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--rp-text-soft, #888);
  padding: 0 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--rp-text) 6%, transparent);
}
.rp-rank__badges {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.rp-rank__pill {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rp-red, #ff2e4d) 13%, transparent);
  color: var(--rp-red, #ff2e4d);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
@media (max-width: 640px) {
  .rp-rank__link {
    grid-template-columns: 40px 50px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .rp-rank__title { font-size: 14.5px; }
  .rp-rank__score { font-size: 19px; }
}

/* Crawl-window 指示条：以前是红色脉冲药丸 (太醒目)；改成低调的灰色
 * 单行小字，没有背景没有动画。提供信息但不抢戏。 */
.rp-crawl-banner {
  margin: 4px 6px 12px;
  padding: 0;
  color: var(--rp-text-dim, #888);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-variant-numeric: tabular-nums;
}
.rp-crawl-banner__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rp-text) 30%, transparent);
}

.rp-status--loading,
.rp-status--end {
  text-align: center;
  padding: 32px 20px;
  color: var(--rp-text-dim);
  font-size: 13px;
  letter-spacing: 1px;
}
.rp-status--end::before { content: "—  "; }
.rp-status--end::after  { content: "  —"; }

/* ----- Card ---------------------------------------------------------- */
.rp-card {
  break-inside: avoid;
  margin-bottom: 12px;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  box-shadow: var(--rp-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  display: block;
}

.rp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.08);
}

.rp-card.is-read {
  opacity: 0.6;
}

/* ----- Text cover (the Xiaohongshu "image") -------------------------- */
.rp-cover {
  position: relative;
  padding: 56px 22px 24px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.rp-cover__headline {
  position: relative;
  z-index: 1;
  font-family: var(--rp-font-serif);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: 0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rp-cover__source {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ================================================================
   Style A — 手账纸 / washi notebook
   Pastel paper, decorative "washi tape" top-left, subtle dot grid.
   ================================================================ */
.rp-cover--washi {
  --rp-washi-bg: #fef0f3;
  --rp-washi-tape: #ff8aa0;
  --rp-washi-text: #6b2030;
  --rp-washi-grid: rgba(120, 60, 80, 0.10);
  background-color: var(--rp-washi-bg);
  color: var(--rp-washi-text);
}

.rp-cover--washi::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 22px;
  width: 88px;
  height: 22px;
  background: var(--rp-washi-tape);
  opacity: 0.82;
  transform: rotate(-3deg);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.06);
  z-index: 1;
}

.rp-cover--washi::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--rp-washi-grid) 0.8px, transparent 0.8px);
  background-size: 14px 14px;
  pointer-events: none;
  opacity: 0.55;
}

.rp-cover--washi .rp-cover__headline {
  color: var(--rp-washi-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.rp-cover--washi .rp-cover__source {
  background: rgba(255, 255, 255, 0.75);
  color: var(--rp-washi-text);
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(2px);
}

/* 6 light pastel washi variants — pink / blue / green / purple / yellow / peach */
.rp-cover--washi.c0 { --rp-washi-bg: #fef0f3; --rp-washi-tape: #ff8aa0; --rp-washi-text: #6b2030; --rp-washi-grid: rgba(120, 60, 80, 0.10); }
.rp-cover--washi.c1 { --rp-washi-bg: #eef4fc; --rp-washi-tape: #7eb0e0; --rp-washi-text: #1a3050; --rp-washi-grid: rgba(50, 80, 130, 0.10); }
.rp-cover--washi.c2 { --rp-washi-bg: #eef7eb; --rp-washi-tape: #82c179; --rp-washi-text: #1f4326; --rp-washi-grid: rgba(50, 100, 60, 0.10); }
.rp-cover--washi.c3 { --rp-washi-bg: #f3edf9; --rp-washi-tape: #b294d2; --rp-washi-text: #3a1a55; --rp-washi-grid: rgba(90, 60, 130, 0.10); }
.rp-cover--washi.c4 { --rp-washi-bg: #fff7e0; --rp-washi-tape: #f0c878; --rp-washi-text: #5a4310; --rp-washi-grid: rgba(140, 110, 30, 0.10); }
.rp-cover--washi.c5 { --rp-washi-bg: #fdf0e6; --rp-washi-tape: #f4a988; --rp-washi-text: #6e3018; --rp-washi-grid: rgba(140, 80, 40, 0.10); }

/* ================================================================
   Style B — 杂志 / magazine
   Light pastel paper + thin top rule + serif headline.
   ================================================================ */
.rp-cover--magazine {
  --rp-mag-bg: #fbe9ed;
  --rp-mag-accent: #c52a4a;
  --rp-mag-text: #2a1018;
  background-color: var(--rp-mag-bg);
  color: var(--rp-mag-text);
  padding: 18px 22px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 220px;
}

.rp-cover--magazine::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 44px;
  height: 1px;
  background: var(--rp-mag-accent);
  opacity: 0.8;
}

.rp-cover--magazine .rp-cover__source {
  position: static;
  align-self: start;
  justify-self: start;
  background: transparent;
  color: var(--rp-mag-accent);
  padding: 0;
  font-size: 11px;
  letter-spacing: 2px;
  border: none;
  margin-bottom: 4px;
}

.rp-cover--magazine .rp-cover__headline {
  align-self: center;
  font-family: var(--rp-font-serif);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.32;
  -webkit-line-clamp: 6;
  margin-top: 18px;
  color: var(--rp-mag-text);
}

/* 6 light pastel magazine variants — pink / blue / green / purple / yellow / lavender */
.rp-cover--magazine.c0 { --rp-mag-bg: #fbe9ed; --rp-mag-accent: #c52a4a; --rp-mag-text: #2a1018; }
.rp-cover--magazine.c1 { --rp-mag-bg: #e6f0f9; --rp-mag-accent: #2c5d8c; --rp-mag-text: #11233a; }
.rp-cover--magazine.c2 { --rp-mag-bg: #ebf5e6; --rp-mag-accent: #4a8a4f; --rp-mag-text: #1a3220; }
.rp-cover--magazine.c3 { --rp-mag-bg: #f0e8f7; --rp-mag-accent: #6a3d9a; --rp-mag-text: #21143a; }
.rp-cover--magazine.c4 { --rp-mag-bg: #fff6dc; --rp-mag-accent: #a37414; --rp-mag-text: #4a370e; }
.rp-cover--magazine.c5 { --rp-mag-bg: #ede8f5; --rp-mag-accent: #5a4ba8; --rp-mag-text: #221c45; }

/* Card body below cover */
.rp-card__body {
  padding: 10px 12px 12px;
}

.rp-card__title {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--rp-text);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rp-card__tldr {
  font-size: 12px;
  color: var(--rp-text-soft);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rp-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--rp-text-dim);
}

.rp-card__authors {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-right: 8px;
}

.rp-card__like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  color: var(--rp-text-dim);
  border-radius: 6px;
  position: relative;
  z-index: 2;
}

.rp-card__like.is-liked {
  color: var(--rp-red);
}

.rp-card__badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0 0;
}

.rp-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--rp-bg);
  color: var(--rp-text-soft);
}

.rp-badge--hot {
  background: rgba(255, 36, 66, 0.12);
  color: var(--rp-red);
}

.rp-badge--fresh {
  background: rgba(255, 153, 0, 0.16);
  color: #d97706;
}

.rp-badge--pin {
  background: rgba(220, 70, 110, 0.16);
  color: #b8285a;
  font-weight: 700;
}

/* ---- Live2D mascot (站娘) ---- */
#rp-mascot {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 240px;
  height: 320px;
  z-index: 80;
  pointer-events: none;      /* canvas itself opts back in */
  user-select: none;
}
#rp-mascot-canvas {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: pointer;           /* tap-to-trigger-expression */
}
.rp-mascot__close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
  opacity: 0.55;
  transition: opacity 0.2s, background 0.2s;
}
.rp-mascot__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}
#rp-mascot.is-hidden {
  /* 不卸载 canvas，只让她"折"成 0 体积；再点小气泡瞬间恢复，不重新加载模型 */
  transform: translateY(40px) scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* 角落小气泡：默认看不见；站娘隐藏时弹出来 */
#rp-mascot-bubble {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--rp-red, #ff2e4d);
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 81;
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
#rp-mascot-bubble.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
#rp-mascot-bubble:hover {
  filter: brightness(1.08);
}
@media (max-width: 768px) {
  #rp-mascot,
  #rp-mascot-bubble { display: none; }
}

/* "Paper withdrawn" placeholder shown in 收藏夹 when a favorited id is no
 * longer in the master index. Greyscale + slightly faded to indicate it's a
 * dead link the user can clean up. */
.rp-card--missing {
  opacity: 0.78;
  cursor: default;
}
.rp-card--missing .rp-card__title {
  font-family: var(--rp-font-mono, ui-monospace, monospace);
  font-size: 13px;
  color: var(--rp-text-muted, #777);
}
.rp-cover--missing {
  background: repeating-linear-gradient(45deg, #e8e8e8 0 12px, #f4f4f4 12px 24px);
  color: #6a6a6a;
}
.rp-cover--missing .rp-cover__headline {
  color: #5a5a5a;
  font-weight: 600;
}

.rp-badge--lab {
  background: rgba(40, 80, 200, 0.14);
  color: #2854c8;
}

/* ----- Favorites category tabs -------------------------------------- */
.rp-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 4px 18px;
}

.rp-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  font-size: 13px;
  color: var(--rp-text);
  cursor: pointer;
  transition: all 0.15s;
}

.rp-cat-tab:hover {
  border-color: var(--rp-red);
}

.rp-cat-tab.is-active {
  background: var(--rp-red);
  border-color: var(--rp-red);
  color: white;
}

.rp-cat-tab__count {
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  min-width: 18px;
  text-align: center;
}

.rp-cat-tab.is-active .rp-cat-tab__count {
  background: rgba(255, 255, 255, 0.25);
}

.rp-cat-tab__remove {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.5;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
}

.rp-cat-tab__remove:hover {
  opacity: 1;
}

.rp-cat-tab--add {
  border-style: dashed;
  color: var(--rp-text-dim);
}

/* ----- Modal sheet (category picker on detail page) ----------------- */
.rp-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.rp-modal__sheet {
  background: var(--rp-surface);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 18px 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.rp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.rp-modal__header h3 {
  margin: 0;
  font-size: 17px;
}

.rp-modal__hint {
  font-size: 12px;
  color: var(--rp-text-dim);
  margin: 0 0 12px;
}

.rp-modal__list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.rp-modal__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.rp-modal__row:hover {
  background: var(--rp-bg);
}

.rp-modal__create {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--rp-border);
  padding-top: 10px;
}

.rp-modal__create input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--rp-border);
  background: var(--rp-bg);
  color: var(--rp-text);
  font-size: 13px;
}

/* ----- Empty / loading states --------------------------------------- */
.rp-status {
  padding: 80px 24px;
  text-align: center;
  color: var(--rp-text-dim);
}

.rp-status__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--rp-text-soft);
  margin: 0 0 6px;
}

.rp-status__hint {
  font-size: 13px;
  color: var(--rp-text-dim);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

.rp-btn--ghost {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--rp-text) 22%, transparent);
  color: var(--rp-text-soft);
}
.rp-btn--ghost:hover {
  background: color-mix(in srgb, var(--rp-text) 8%, transparent);
}

/* ----- Post deck (Xiaohongshu-style swipe carousel) ----------------- */
.rp-post-deck {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 16px;
  position: relative;
}

/* The viewport is the visible area. Slides are absolutely positioned
 * inside it and animate via transform so we don't fight with scroll-snap. */
.rp-post-deck__viewport {
  position: relative;
  height: calc(100vh - 200px);
  min-height: 500px;
  max-height: 780px;
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  touch-action: pan-y;
}

.rp-post-slide {
  position: absolute;
  inset: 0;
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.42s ease;
  will-change: transform;
}

/* --- Cover slide --- */
.rp-post-slide--cover {
  transform: translateX(0);
  z-index: 1;
}

.rp-post-slide--cover .rp-cover {
  width: 100%;
  height: 100%;
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  padding: 80px 30px 60px;
}

.rp-post-slide--cover .rp-cover__headline {
  font-size: 32px;
  line-height: 1.45;
  -webkit-line-clamp: 8;
}

@media (max-width: 540px) {
  .rp-post-slide--cover .rp-cover__headline { font-size: 26px; }
}

.rp-post-slide--cover .rp-cover__source {
  top: 18px;
  right: 18px;
  font-size: 12px;
  padding: 4px 10px;
}

.rp-post-deck__peek {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.65) 100%);
  pointer-events: none;
  border-top-right-radius: var(--rp-radius-lg);
  border-bottom-right-radius: var(--rp-radius-lg);
  transition: opacity 0.25s;
  z-index: 3;
}

[data-theme="dark"] .rp-post-deck__peek {
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
}

.rp-post-deck__hint {
  position: absolute;
  bottom: 24px;
  right: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border-radius: 999px;
  font-size: 12px;
  z-index: 5;
  animation: rp-bounce-x 1.6s infinite;
  transition: opacity 0.25s;
}

@keyframes rp-bounce-x {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* --- Preview slides (rendered PDF pages 1-3 of the paper). JS sets the
 * transform inline based on the active index so we don't need per-slide
 * classes; CSS just provides the shared layout. */
.rp-post-slide--preview {
  z-index: 2;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.rp-post-deck__page-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.5px;
  z-index: 4;
}

.rp-post-slide__hero {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  border-radius: 6px;
}

.rp-post-slide__noimg {
  max-width: 92%;
  font-size: 16px;
  line-height: 1.7;
  color: var(--rp-text);
  text-align: center;
  padding: 0 12px;
}

.rp-post-deck__scroll-cta {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: var(--rp-red);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 36, 66, 0.32);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 5;
}
.rp-post-deck__scroll-cta:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 36, 66, 0.45);
}

/* The "body article" — full post content rendered NORMALLY below the
   carousel. No nested scroll, no overflow:hidden, no surprises. */
.rp-post__body {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 24px 28px 56px;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 540px) {
  .rp-post__body { padding: 20px 18px 48px; margin: 20px 12px 0; }
}

/* --- Dot indicators --- */
.rp-post-deck__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 4px;
}

.rp-post-deck__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rp-text-dim);
  opacity: 0.4;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.rp-post-deck__dot.is-active {
  background: var(--rp-red);
  opacity: 1;
  width: 26px;
  border-radius: 4px;
}

/* --- Desktop nav arrows --- */
.rp-post-deck__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 24px;
  line-height: 1;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
}

.rp-post-deck__nav:hover { background: rgba(0, 0, 0, 0.75); }
.rp-post-deck__nav--prev { left: 4px; }
.rp-post-deck__nav--next { right: 4px; }

@media (min-width: 820px) {
  .rp-post-deck__nav { display: inline-flex; }
}

/* ----- Post (detail) page ------------------------------------------- */
.rp-post {
  max-width: 820px;
  margin: 0 auto;
  padding: 4px 0 16px;
}

.rp-post__hero {
  border-radius: var(--rp-radius-lg);
  overflow: hidden;
  box-shadow: var(--rp-shadow);
  background: var(--rp-surface);
  margin-bottom: 18px;
}

.rp-post__hero img {
  width: 100%;
  height: auto;
}

.rp-post__title-zh {
  font-family: var(--rp-font-serif);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}

.rp-post__title-en {
  color: var(--rp-text-soft);
  font-size: 14px;
  margin: 0 0 14px;
}

.rp-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--rp-text-dim);
  font-size: 13px;
  margin-bottom: 18px;
}

.rp-post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}

.rp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  font-size: 13px;
  color: var(--rp-text);
  transition: all 0.15s;
}

.rp-btn:hover {
  border-color: var(--rp-red);
  color: var(--rp-red);
}

.rp-btn--primary {
  background: var(--rp-red);
  color: white;
  border-color: var(--rp-red);
}

.rp-btn--primary:hover {
  background: #e91d3a;
  border-color: #e91d3a;
  color: white;
}

.rp-section {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--rp-shadow);
}

/* ----- Card / post 二级 chip：机构 + 方法 / 问题 tag ---------------- */
.rp-card__chips,
.rp-post__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.rp-post__chips {
  margin: 14px 0 18px;
}
.rp-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1;
  /* 防止 chip 把 cover headline 顶下去：限制单 chip 最大宽度 */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-chip--inst {
  background: color-mix(in srgb, var(--rp-accent, #b8e0ff) 16%, transparent);
  color: var(--rp-text-soft);
  border: 1px solid color-mix(in srgb, var(--rp-accent, #b8e0ff) 35%, transparent);
}
.rp-chip--method {
  background: color-mix(in srgb, var(--rp-primary, #ff6b6b) 14%, transparent);
  color: color-mix(in srgb, var(--rp-primary, #d44) 70%, var(--rp-text));
  border: 1px solid color-mix(in srgb, var(--rp-primary, #ff6b6b) 30%, transparent);
}
/* P1 新增：机器人平台 / 仿真栈 chip，颜色与机构 / 方法刻意拉开。 */
.rp-chip--plat {
  background: color-mix(in srgb, #8b5cf6 16%, transparent);
  color: color-mix(in srgb, #6b3fc4 70%, var(--rp-text));
  border: 1px solid color-mix(in srgb, #8b5cf6 32%, transparent);
}
.rp-chip--sim {
  background: color-mix(in srgb, #14b8a6 14%, transparent);
  color: color-mix(in srgb, #0f8a7c 78%, var(--rp-text));
  border: 1px solid color-mix(in srgb, #14b8a6 32%, transparent);
}

/* P0: 卡片角标——有 demo 视频时显示一个小🎬，告诉用户"点进去能看演示"。
 * 绝对定位到 cover 右上角，跟 source label 互不打架。 */
.rp-card__videoflag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(4px);
}

/* P1: 详情页结构化"事实卡片"——三栏 KV，把方法家族 / 真机 / 训练规模摆在最显眼处 */
.rp-factbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--rp-accent, #b8e0ff) 8%, var(--rp-bg, #fff));
  border: 1px solid color-mix(in srgb, var(--rp-accent, #b8e0ff) 25%, transparent);
}
.rp-factbox__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rp-factbox__k {
  font-size: 11px;
  font-weight: 500;
  color: var(--rp-text-soft);
  letter-spacing: 0.4px;
}
.rp-factbox__v {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--rp-text);
}

/* P0: 详情页 demo 视频区。YouTube/Bilibili 强制 16:9，mp4 同理。 */
.rp-post__videos {
  margin: 22px 0 28px;
}
.rp-post__videos h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}
.rp-video {
  margin: 0 0 16px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--rp-shadow);
}
.rp-video iframe,
.rp-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

/* P0+: 详情页图片放大预览 lightbox。极简实现：固定 fixed 蒙层 + 居中图。
 * Mac/系统级深色蒙层，按钮全是白底圆形，无障碍标签齐全。 */
.rp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.rp-lightbox.is-open {
  display: flex;
}
.rp-lightbox__stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 95vw;
  max-height: 95vh;
}
.rp-lightbox__img {
  max-width: 95vw;
  /* 留 60px 给 caption + 一点呼吸 */
  max-height: calc(95vh - 60px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  background: #fff;
  /* 缩放 / 拖拽相关 */
  transform-origin: center center;
  transition: transform 0.15s ease-out;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none; /* 触屏自己处理双指捏合 */
  will-change: transform;
}
.rp-lightbox.is-zoomed .rp-lightbox__img {
  cursor: grab;
}
.rp-lightbox.is-dragging .rp-lightbox__img {
  cursor: grabbing;
  transition: none; /* 拖拽时关掉过渡，避免延迟感 */
}
.rp-lightbox__caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.3px;
}
.rp-lightbox__close,
.rp-lightbox__nav {
  position: absolute;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
}
.rp-lightbox__close:hover,
.rp-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}
.rp-lightbox__close {
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
}
.rp-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 32px;
  line-height: 44px;
  text-align: center;
}
.rp-lightbox__nav--prev { left: 18px; }
.rp-lightbox__nav--next { right: 18px; }
.rp-lightbox.is-single .rp-lightbox__nav,
.rp-lightbox.is-single .rp-lightbox__dots {
  display: none;
}
.rp-lightbox__dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.rp-lightbox__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.18s, transform 0.18s;
}
.rp-lightbox__dots span.is-active {
  background: #fff;
  transform: scale(1.15);
}
/* 工具栏：右下角，放大 / 缩小 / 重置 + 当前缩放百分比 */
.rp-lightbox__tools {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.rp-lightbox__tool {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.rp-lightbox__tool:hover { background: rgba(255, 255, 255, 0.32); }
.rp-lightbox__zoom {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: center;
  padding: 0 4px;
}
/* 触屏小屏：工具栏下移到顶部 caption 一侧，避免和底部 dots 重叠 */
@media (max-width: 640px) {
  .rp-lightbox__tools { bottom: 56px; right: 12px; padding: 4px 8px; }
  .rp-lightbox__tool { width: 30px; height: 30px; font-size: 16px; }
  .rp-lightbox__zoom { display: none; }
}

/* P0: YouTube 缩略图 facade。点击 → 在新标签页打开 YouTube（避开 YT 的
 * 反 bot challenge——iframe 内嵌触发概率太高，干脆不嵌）。
 * 同样的 16:9 占位，跟 Bilibili / mp4 iframe 视觉对齐。 */
.rp-video__facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  margin: 0;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;  /* <a> facade 不要默认下划线 */
}
.rp-video__facade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.45) 100%);
  transition: background 0.2s;
}
.rp-video__facade:hover::before {
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
}
.rp-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: rgba(220, 30, 35, 0.92);
  color: #fff;
  font-size: 22px;
  line-height: 48px;
  text-align: center;
  padding-left: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s, background 0.18s;
}
.rp-video__facade:hover .rp-video__play {
  background: rgba(255, 0, 0, 1);
  transform: translate(-50%, -50%) scale(1.06);
}
.rp-video__brand {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.rp-video figcaption {
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--rp-text-soft);
  background: color-mix(in srgb, var(--rp-bg, #fff) 95%, var(--rp-text, #000));
}
.rp-video__cap-link {
  font-weight: 600;
  color: var(--rp-primary, #d44);
}
.rp-video__cap-link:hover {
  text-decoration: underline;
}

/* P6: Monthly digest page ----------------------------------------------- */
.rp-monthly-tabs {
  margin-bottom: 18px;
}
.rp-monthly-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 4px 60px;
}
.rp-monthly-head {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--rp-accent, #b8e0ff) 10%, var(--rp-bg, #fff));
  border: 1px solid color-mix(in srgb, var(--rp-accent, #b8e0ff) 28%, transparent);
}
.rp-monthly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--rp-text-soft);
  margin-bottom: 8px;
}
.rp-monthly-headline {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 700;
  color: var(--rp-text);
}
.rp-monthly-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rp-monthly-content {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--rp-text);
}
.rp-monthly-content h2 {
  margin: 28px 0 12px;
  font-size: 19px;
  font-weight: 700;
  border-bottom: 2px solid color-mix(in srgb, var(--rp-primary, #ff6b6b) 30%, transparent);
  padding-bottom: 4px;
}
.rp-monthly-content h3 {
  margin: 22px 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--rp-primary, #d44);
}
.rp-monthly-content h4 {
  margin: 16px 0 6px;
  font-size: 15.5px;
  font-weight: 600;
}
.rp-monthly-content p {
  margin: 0 0 12px;
}
.rp-monthly-content ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.rp-monthly-content li {
  margin: 4px 0;
}
.rp-monthly-content strong {
  color: var(--rp-primary, #d44);
  font-weight: 600;
}
.rp-monthly-content code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--rp-accent, #b8e0ff) 18%, transparent);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 92%;
}

/* DeepSeek judge "LLM 把关" 小卡片：通过 / 被砍 的 chip + 一句中文 reason */
.rp-judge__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.rp-judge__chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  background: color-mix(in srgb, var(--rp-text) 8%, transparent);
  color: var(--rp-text);
}
.rp-judge__chip--pass {
  background: color-mix(in srgb, #4caf50 18%, transparent);
  color: #2e7d32;
}
.rp-judge__chip--fail {
  background: color-mix(in srgb, #f44336 18%, transparent);
  color: #c62828;
}
.rp-judge__reason {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--rp-text-soft);
  font-style: italic;
}

.rp-section__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rp-text-soft);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.rp-section__zh {
  font-size: 16px;
  line-height: 1.8;
  color: var(--rp-text);
}

.rp-section__en {
  font-size: 14px;
  line-height: 1.7;
  color: var(--rp-text-soft);
  white-space: pre-wrap;
}

/* "为啥今天选了它" — per-paper score breakdown shown below the abstract. */
.rp-score__total {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  background: var(--rp-red);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0;
  vertical-align: middle;
}

.rp-score__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rp-score__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--rp-surface-2, rgba(0, 0, 0, 0.025));
  border-radius: 10px;
  font-size: 14px;
}

[data-theme="dark"] .rp-score__row {
  background: rgba(255, 255, 255, 0.04);
}

.rp-score__points {
  flex-shrink: 0;
  min-width: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--rp-text-soft);
  font-size: 15px;
}
.rp-score__points.is-plus  { color: #2d8a3d; }
.rp-score__points.is-minus { color: #c52a4a; }

.rp-score__body {
  flex: 1;
  min-width: 0;
}

.rp-score__label {
  color: var(--rp-text);
  line-height: 1.5;
}

.rp-score__hint {
  color: var(--rp-text-dim);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.5;
}

.rp-score__note {
  margin-top: 12px;
  color: var(--rp-text-dim);
  font-size: 12px;
}

.rp-section details summary {
  cursor: pointer;
  color: var(--rp-text-soft);
  font-size: 13px;
  margin-top: 10px;
}

.rp-section details[open] summary {
  margin-bottom: 6px;
}

.rp-post__related {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.rp-mini-card {
  background: var(--rp-bg);
  border-radius: var(--rp-radius-md);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--rp-text);
  display: block;
}

.rp-mini-card__title {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----- Toast -------------------------------------------------------- */
.rp-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.rp-toast.is-visible {
  opacity: 1;
}

/* ----- Footer -------------------------------------------------------- */
.rp-footer {
  padding: 30px 20px 60px;
  text-align: center;
  color: var(--rp-text-dim);
  font-size: 12px;
}

.rp-footer a {
  color: var(--rp-text-soft);
}
