/* ===================================================================
   主站「最近做的事情」那一页（mimila.cn/recent）
   ===================================================================

   只有这一页加载它（`recent.html` 里那个 <link>）。
   为什么不塞进 app.css：那份是**每个页面**都要下载的，而这一页的
   时间轴 / 小格子 / 分类配色只有这里用得上，而且还挺长。

   用户 2026-09-21 的原话：「让『最近』页面给你自由发挥了，做的可爱
   有活力有生机一点，尽可能的好看」。所以这一页的调子：
     · 有生长的意思（一条竖线像根枝条，小格子像一格格的苗）
     · 颜色是暖的，但不吵：分类用六套**低饱和**的底色，谁的分类谁的颜色
     · 动效只有「浮现」和一点点摇摆，且都尊重「减弱动态效果」

   规矩照旧：零依赖、不引图片（枝叶是手写 SVG）、只用 transform/opacity。
   =================================================================== */

/* ===================================================================
   1. 页头：一株小苗 + 一句话 + 一排小格子
   =================================================================== */

.rc-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.rc-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* 手写的小苗：两片叶子挑着一根茎，风一吹轻轻晃 */
.rc-sprout {
  flex: none;
  width: 46px;
  height: 46px;
  transform-origin: 50% 92%;
  animation: rc-sway 6.5s ease-in-out infinite alternate;
}
.rc-sprout .stem {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: .9;
}
.rc-sprout .leaf { fill: var(--green); opacity: .55; }
.rc-sprout .leaf-2 { fill: var(--green); opacity: .35; }

@keyframes rc-sway {
  from { transform: rotate(-3deg); }
  to   { transform: rotate(3.4deg); }
}

.rc-hero-text { min-width: 0; flex: 1; }

.rc-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
}

.rc-lead {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--label-2);
}

/* 分类色的小圆点，跟在「记得最多的是 X」后面 */
.rc-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
}

/* ---- 最近 30 天：一排小格子 ----
   这里数的是**条数**（哪天留下过东西），不是时长 ——
   这一页是给外人看的，「花了多久」是他的私事（用户 2026-09-19 定的规矩）。 */
.rc-strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: 16px;
}

.rc-cell {
  flex: 1;
  min-width: 0;
  height: 22px;
  border-radius: 5px;
  background: var(--fill-2);
  transition: transform .18s var(--ease);
}
.rc-cell.lv1 { background: rgba(52, 199, 89, .28); }
.rc-cell.lv2 { background: rgba(52, 199, 89, .55); }
.rc-cell.lv3 { background: var(--green); }
.rc-cell.today { outline: 1.5px solid var(--accent); outline-offset: 1px; }
.rc-cell:hover { transform: translateY(-2px); }

.rc-strip-note {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--label-2);
}

/* ===================================================================
   2. 一天一张卡：左边一条「枝条」，上面一串节点
   =================================================================== */

.rc-day { position: relative; }

.rc-day-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 2px;
}

.rc-day-date {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--label);
}

.rc-day-count {
  font-size: 12.5px;
  color: var(--label-2);
}

/* 每条记录：前面一个圆点 + 一条竖线，看着像枝条上冒出来的叶子 */
.rc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-leaf {
  position: relative;
  padding: 11px 0 11px 22px;
}
.rc-leaf::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 17px;
  bottom: -11px;
  width: 2px;
  background: var(--fill);
  border-radius: 2px;
}
.rc-leaf:last-child::before { bottom: auto; height: 6px; }
.rc-leaf::after {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label-3);
}
/* 每条的小圆点用它自己分类的颜色 —— 一眼看出这片是「学习」还是「日语」 */
.rc-leaf.tone-0::after { background: #0A84FF; }
.rc-leaf.tone-1::after { background: #30B0C7; }
.rc-leaf.tone-2::after { background: #AF52DE; }
.rc-leaf.tone-3::after { background: #FF9500; }
.rc-leaf.tone-4::after { background: #34C759; }
.rc-leaf.tone-5::after { background: #FF2D55; }

.rc-leaf-title {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--label);
  word-break: break-word;
}

.rc-leaf-text {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--label-2);
  word-break: break-word;
}

/* 分类标签：六套低饱和底色（和上面小圆点同一套色）。
   ⚠️ 这几个字色不是随手挑的：底色是「同色 14% 压在卡片上」，
      字色是同一色相压暗后的值 —— 一组一组算过对比度，都在 4.7~5.0:1
      （≥4.5 才过 AA）。亮暗两套分开算，暗色下用的是调亮的那一组。
      tests/test_page_render.py 里有一条断言在算这个。 */
.rc-tag {
  display: inline-block;
  margin-top: 7px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--fill);
  color: var(--label-2);
}
.rc-tag.tone-0 { background: rgba(10, 132, 255, .14); color: #0866C6; }
.rc-tag.tone-1 { background: rgba(48, 176, 199, .14); color: #1F727F; }
.rc-tag.tone-2 { background: rgba(175, 82, 222, .14); color: #8F42B5; }
.rc-tag.tone-3 { background: rgba(255, 149, 0, .14); color: #9C5A00; }
.rc-tag.tone-4 { background: rgba(52, 199, 89, .14); color: #1F7735; }
.rc-tag.tone-5 { background: rgba(255, 45, 85, .14); color: #C02240; }
/* 暗色下把字调亮：上面那几个色在深底上压不住（对比度只有 2~3:1） */
:root[data-theme="dark"] .rc-tag.tone-0 { color: #6FB4FF; }
:root[data-theme="dark"] .rc-tag.tone-1 { color: #6FD3E8; }
:root[data-theme="dark"] .rc-tag.tone-2 { color: #CF9BEE; }
:root[data-theme="dark"] .rc-tag.tone-3 { color: #FFC46B; }
:root[data-theme="dark"] .rc-tag.tone-4 { color: #7BE39A; }
:root[data-theme="dark"] .rc-tag.tone-5 { color: #FF8AA3; }

/* ===================================================================
   3. 空着的时候 & 页脚
   =================================================================== */

.rc-empty {
  text-align: center;
  padding: 30px 20px 34px;
}
.rc-empty .rc-sprout {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  display: block;
}
.rc-empty p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--label-2);
}

.rc-foot-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--label-2);
  text-align: center;
}

/* ===================================================================
   4. 手机 / 减弱动效
   =================================================================== */

@media (max-width: 430px) {
  .rc-hero { padding: 18px 16px 15px; }
  .rc-cell { height: 18px; border-radius: 4px; }
  .rc-strip { gap: 2px; }
  /* 30 格挤在 320px 里每格只有 7px —— 窄屏只铺最近 20 天更好看
     （模板给的是 30 格，用 nth-child 把最早的 10 格藏掉） */
  .rc-cell:nth-child(-n+10) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-sprout { animation: none; }
  .rc-cell { transition: none; }
  .rc-cell:hover { transform: none; }
}
