/* /learning/ 我的学习页样式 —— 与 /me/ /syllabus/ /glossary/ 同款暖色调 */
:root {
  --paper: #fbf6ee;
  --paper-strong: #f5ecdc;
  --paper-deep: #eadbc8;
  --paper-card: #f9f2e5;
  --ink: #3d2c1f;
  --ink-soft: #5b4329;
  --muted: #8a6f54;
  --line: rgba(110, 79, 54, 0.14);
  --line-strong: rgba(110, 79, 54, 0.22);
  --shadow: 0 14px 32px rgba(81, 58, 35, 0.10);
  --shadow-hover: 0 18px 36px rgba(81, 58, 35, 0.16);

  --accent: #70543a;
  --accent-hover: #5a4226;
  --accent-soft: #f3e7d2;
  --accent-fg: #ffffff;

  --success-bg: #e6f4ea;
  --success-fg: #1e7a3a;
  --leaf: #5b9c3a;
  --warning-bg: #fef3cd;
  --warning-fg: #856404;
  --error-bg: #fdecea;
  --error-fg: #b3261e;

  --heat-0: #f1e6d2;
  --heat-1: #e1c9a3;
  --heat-2: #c8a273;
  --heat-3: #a87a4a;
  --heat-4: #7a532d;

  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
           "Times New Roman", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "PingFang SC",
           "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.lr-body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, #fbf6ee 0%, #f3e7d2 100%);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* —— shell —— */
.lr-shell {
  /* 与 /me/ /syllabus /repository 同宽 (1040px),顶栏水平边界对齐 */
  max-width: 1040px;
  margin: 4px auto;
  padding: 28px 24px 64px;
}

/* —— topbar (与 me / syllabus 一致) —— */
.lr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  height: 30px;
  line-height: 1;
}
.lr-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lr-topbar__brand:hover { color: var(--accent); }
.lr-topbar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  line-height: 1;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f1e7, #eadbc8);
  color: #6e4f36;
  font-weight: 700;
  font-size: 14px;
}

/* —— header (标题 + 会员专享 banner) —— */
.lr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.lr-header__heading {
  display: flex;
  align-items: center;
  gap: 5px;
}
.lr-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.lr-header__icon-leaf { color: var(--leaf); }
.lr-header__icon svg { width: 24px; height: 24px; }
.lr-header__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}
.lr-header__sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.lr-header__member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.lr-header__member:hover { color: var(--accent-hover); }
.lr-header__member:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.lr-header__member-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.lr-header__member-icon svg { width: 16px; height: 16px; }
.lr-header__member-text {
  font-size: 0.86rem;
  color: var(--accent);
  white-space: nowrap;
}

/* —— 通用按钮 —— */
.lr-btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-card);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lr-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.lr-btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.lr-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* —— ① 顶部 4 卡 —— */
.lr-topcards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 12px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.lr-topcards__head {
  grid-column: 1 / -1;
  margin: -2px 0 4px;
}
.lr-topcard {
  display: grid;
  /* icon | (num+label/sub stacked, 1fr) | arrow, 3 列;
     num/label 同列上下, label/sub 用 1fr 占满中间宽度避免 "累计学习字数"
     这类长 label 被 4-列布局挤到 wrap */
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lr-topcard__icon  {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}
.lr-topcard__num   {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-topcard__label {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-topcard__sub {
  display: block;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  color: var(--muted);
}
.lr-topcard__arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  padding-left: 4px;
}

/* 第 4 张卡 num 自带 "连续学习 N 天" 语义, label 隐藏, 用 sub */
.lr-topcard[data-highlight="recent"] .lr-topcard__label { display: none; }
/* card 4 num "连续学习 N 天" 字串较长, 整体字号比其它 3 张卡的 num (1.2rem) 小一档 */
.lr-topcard[data-highlight="recent"] .lr-topcard__num { font-size: 1rem; }
.lr-topcard:hover { background: var(--accent-soft); border-color: var(--line-strong); }
.lr-topcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lr-topcard__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  line-height: 1;
  /* 高度 = .lr-topcard__num (1.2rem*1.2=23.04) + 4px gap + .lr-topcard__label (0.84rem*1.3=17.47) ≈ 44.5px,
     取整到 46px 让 icon 略大一圈, 视觉上撑得住 num+label 这一列。 */
}
.lr-topcard__icon svg { width: 26px; height: 26px; }
.lr-topcard__num {
  display: block;
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  /* 用 sans 跟 label 一致; 不加粗, 数字只是这一列的强调, 不需要比 icon 更抢眼 */
}
.lr-topcard__label {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.3;
}
.lr-topcard__arrow { font-size: 22px; color: var(--line-strong); line-height: 1; }
.lr-topcard:hover .lr-topcard__arrow { color: var(--accent); }

/* —— 通用 card —— */
.lr-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.lr-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.lr-card__head--tabs { align-items: center; flex-wrap: wrap; }
.lr-card__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.lr-card__title-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  vertical-align: -3px;
  margin-right: 6px;
  flex-shrink: 0;
}
.lr-card__sub {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* card head 右栏 ——
   学习轨迹专用: sub + tab 横向排, 跟 title 同一行 (避免上下布局的左侧大空洞) */
.lr-card__head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;  /* 跟 title 拉开: title 在最左, head-right 在最右 */
}
.lr-card__head-right .lr-card__sub {
  /* 在 head-right 内重置默认 margin, 避免 4px 上 margin 制造奇怪的纵向间距 */
  margin: 0;
}

/* —— 学习轨迹 tab (阅读|完成) ——
   Segmented control: 一个圆角胶囊外框包两个按钮, 中间用 '|' 隔开;
   默认空心 --line + paper-card bg, active 那一侧填 --accent-soft + 文字 --accent + 字重 500。
   字号 0.74rem, 比常规更小, 跟右侧分隔统计里的 0.76rem 字号段一致。 */
.lr-track__tabs {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-card);
  height: 24px;
  overflow: hidden;
}
.lr-track__tab {
  background: none;
  border: none;
  padding: 0 12px;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  height: 100%;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.lr-track__tab:hover { color: var(--ink-soft); }
.lr-track__tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
.lr-track__divider {
  /* 中间 '|' 分隔符: 浅色细字重, 不响应鼠标 */
  color: var(--line-strong);
  font-weight: 200;
  font-size: 0.78rem;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  height: 100%;
}


/* —— 2 列布局 —— */
.lr-2col {
  /* 主列(继续学习 / 最近学习) : 侧列(学习统计 / 学习路线完成度) ≈ 2:1,
     侧列占比约 33% (略多于 1/3) —— 与设计图一致 */
  /* 左右两列高度解耦: 继续学习 / 学习统计 各自高度独立,
    后面右侧加新卡片时不影响左侧; 改用 flex 两栏 + 每栏内 flex column */
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
}
.lr-2col__left,
.lr-2col__right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.lr-2col__left { flex: 2; }
.lr-2col__right { flex: 1; }

/* —— ② 学习轨迹 —— */
.lr-track { padding-bottom: 14px; }
.lr-heatmap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  margin: 8px 0 4px;
  min-height: 130px;
}
.lr-heatmap__months {
  display: grid;
  /* 列宽与 .lr-heatmap__week-cols 完全一致 (12px + 3px gap),
     月份标签才能精准对齐到对应格子上方。*/
  /* 列宽与下方 week-cols 完全一致: minmax(12px, 1fr) 让格子撑满卡片宽度,
     单元格在窄屏保持 12px 不变形,在宽屏自动拉伸 (GitHub 风格)。
     月份标签因此精准对齐到对应格子上方 */
  grid-template-columns: repeat(var(--weeks, 53), minmax(12px, 1fr));
  column-gap: 3px;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
}
.lr-heatmap__month { grid-column: span 1; }
.lr-heatmap__week-cols {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  /* GitHub 风格: 整条铺满卡片, 最后一列因 today 不是周六而 partial */
  grid-template-columns: repeat(var(--weeks, 53), minmax(12px, 1fr));
  column-gap: 3px;
  row-gap: 3px;
}
.lr-heatmap__weekday-labels {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 12px;
}
.lr-heatmap__cell {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: var(--heat-0);
  transition: transform 0.1s;
  cursor: default;
}
.lr-heatmap__cell:hover { transform: scale(1.4); }
.lr-heatmap__cell[data-level="1"] { background: var(--heat-1); }
.lr-heatmap__cell[data-level="2"] { background: var(--heat-2); }
.lr-heatmap__cell[data-level="3"] { background: var(--heat-3); }
.lr-heatmap__cell[data-level="4"] { background: var(--heat-4); }
/* 今日 cell 不再画外圈轮廓, 跟其它 cell 视觉一致, 用 level 颜色区分即可 */

/* lr-heatmap__tooltip —— 跟随鼠标 cell 浮起, 替代原生 title (避免 500ms-1s 延迟) */
.lr-heatmap__tooltip {
  position: fixed;
  z-index: 1000;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: var(--paper);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.lr-heatmap__tooltip.is-visible { opacity: 1; }

.lr-track__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.lr-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}
.lr-legend__cell {
  width: 11px; height: 11px;
  border-radius: 2px;
  display: inline-block;
}
.lr-legend__cell[data-level="0"] { background: var(--heat-0); }
.lr-legend__cell[data-level="1"] { background: var(--heat-1); }
.lr-legend__cell[data-level="2"] { background: var(--heat-2); }
.lr-legend__cell[data-level="3"] { background: var(--heat-3); }
.lr-legend__cell[data-level="4"] { background: var(--heat-4); }
.lr-track__totals {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.lr-track__totals strong { color: var(--ink); font-weight: 600; }

/* —— ② 热力图 时间范围筛选 —— */
/* —— 卡片头部右侧 "查看更多" 链接 —— */
.lr-card__more {
  font-size: 0.84rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.lr-card__more:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* —— ③ 继续学习 —— */
.lr-continue {
  /* 底部内边距收窄到 14px, 与 .lr-track 一致, 让本卡到下方"最近学习"的
     视觉间距 ≈ 上方"学习轨迹"到本卡的间距 (track pb 14 + lr-2col mt 16 = 30px) */
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
}
.lr-continue__empty {
  padding: 12px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.lr-continue__card {
  display: grid;
  /* col 2 用 minmax(0, 1fr) 而非 1fr —— 默认 min-width:auto 会让 nowrap 文字撑爆 col,
     把 title/desc/meta 推到 .lr-continue__right 右边甚至卡片外面 */
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  /* stretch 让 col 2 / col 3 拉到行高, 这样右栏可以用 space-between 把 status 顶到
     title 顶, 把最近学习压到 desc 底; icon 因为有 explicit 56px, 仍居中 */
  align-items: stretch;
  padding: 9px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.lr-continue__card:hover { background: var(--paper-deep); border-color: var(--line-strong); }
.lr-continue__cover {
  width: 56px; height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5ecdc, #eadbc8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}
.lr-continue__cover svg { width: 26px; height: 26px; color: var(--accent); }
.lr-continue__title {
  /* margin-bottom 从 4 → 0, 让 col 2 intrinsic 减 4, "最近学习"被 space-between 顶上去 4px。
     title ↔ desc 视觉间距不缩太多: desc line-height: 1.4 的 leading 已经有 ~2.6px 在文字上方,
     即使没有 margin-bottom 文字与实际间距仍有 ~5px。 */
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-continue__desc {
  /* margin-bottom 删掉: 之前 6px 的留白会被算进 row height, 导致 col 3 stretch 时
     最近学习被压到 desc 元素底 (含 margin) 而不是 desc 内容底 (即"第二行字的底部")。
     title margin-bottom: 4 还在, title ↔ desc 的视觉间距足够。 */
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 长英文路径在 2 行内放不下时强制在任意字符间断行, 把第一行剩余空间填满,
     避免 overflow-wrap:anywhere 在软连字符(-)处优雅断行后留出大块空白。
     break-all 副作用: 偶尔会在 CJK 文本里也按字符断, 但 .lr-continue__desc
     实际场景里全是中英混排 + 路径, 视觉可接受 */
  word-break: break-all;
  overflow-wrap: anywhere;
}
.lr-continue__right {
  text-align: left;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  /* 让 status 顶到 title 顶, 最近学习压到 desc 底 (col 已 stretch 到行高) */
  justify-content: space-between;
}
/* "最近学习" / "已学习" 两行小一档, status 徽标保持 .lr-continue__right 的 0.84rem */
.lr-continue__right > div {
  font-size: 0.76rem;
  color: var(--muted-soft, var(--muted));
  line-height: 1.65;
}
.lr-continue__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  font-size: 0.78rem;
  /* margin-bottom 删了, 由 .lr-continue__right 的 justify-content: space-between 统一管 */
  line-height: 1;
}
/* 状态徽标前的小圆图标 — 空心描边, 颜色继承父级 (已完成=绿, 继续阅读=棕) */
.lr-continue__status-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.25px solid currentColor;
  color: inherit;
  flex-shrink: 0;
}
.lr-continue__status[data-status="completed"] { background: var(--success-bg); color: var(--success-fg); }
.lr-continue__status[data-status="reading"]   { background: var(--accent-soft); color: var(--accent); }


/* —— ③ 权益额度 —— */
.lr-quotas__list { list-style: none; margin: 0; padding: 0; }
.lr-quotas__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.lr-quotas__item:first-child { padding-top: 0; }
.lr-quotas__item:last-child  { border-bottom: 0; padding-bottom: 0; }
.lr-quotas__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.lr-quotas__label { color: var(--ink-soft); }
.lr-quotas__nums  {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lr-quotas__bar {
  position: relative;
  height: 6px;
  background: var(--paper-strong);
  border-radius: 3px;
  overflow: hidden;
}
.lr-quotas__bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #a87a4a, #6e4f36);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.lr-quotas__bar-fill[data-state="warn"]   { background: linear-gradient(90deg, #c68943, #8a5a25); }
.lr-quotas__bar-fill[data-state="danger"] { background: linear-gradient(90deg, #b53c2d, #7d2618); }
.lr-quotas__plan {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.lr-quotas__plan[hidden] { display: none; }
.lr-quotas__upgrade {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: center;
  margin-left: 4px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.lr-quotas__upgrade-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  display: block;
}
.lr-quotas__upgrade:hover { color: var(--accent-hover); }
.lr-quotas__upgrade:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* —— ④ 学习统计 —— */
.lr-stats__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lr-stats__list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.lr-stats__list li:last-child { border-bottom: 0; }
.lr-stats__icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.lr-stats__icon svg { width: 16px; height: 16px; }
.lr-stats__label { color: var(--ink-soft); }
.lr-stats__val { font-weight: 600; color: var(--ink); }

/* —— ⑤ 最近学习 —— */
/* 与 .lr-track__tabs 同款: pill (height 24px) + | 分隔符 + active = accent-soft */
.lr-tabs {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-card);
  height: 24px;
  overflow: hidden;
}
.lr-tab {
  background: none;
  border: none;
  padding: 0 12px;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  height: 100%;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.lr-tab:hover { color: var(--ink-soft); }
.lr-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
/* tab 之间的 "|" 分隔符 — 用 ::after 伪元素在按钮内画线,不引入 DOM */
.lr-tab { position: relative; }
.lr-tab:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--line-strong);
  opacity: 0.6;
}


.lr-recent__group {
  margin-top: 10px;
}
.lr-recent__group:first-child { margin-top: 0; }
.lr-recent__date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.lr-recent__date-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.lr-recent__date-icon svg { width: 13px; height: 13px; }
.lr-recent__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lr-recent__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 18px;
  border-radius: 14px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.lr-recent__item:hover { background: var(--accent-soft); }
.lr-recent__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lr-recent__row--primary > .lr-recent__title { flex: 1; min-width: 0; }
/* 第二行 padding-left = status(22) + gap(10) — 让 sub-text 与 title 左边对齐 */
.lr-recent__row--sub {
  padding-left: 32px;
  font-size: 0.78rem;
  color: var(--muted);
}
.lr-recent__status {
  /* 与 .lr-continue__status 完全一致: pill (height 22) + 内嵌 14px 描边圆;
     recent 没有 statusText, 所以 padding-right 取相同的对称值 */
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 3px 4px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1;
}
.lr-recent__status-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.25px solid currentColor;
  color: inherit;
  flex-shrink: 0;
}
.lr-recent__status-icon svg { width: 10px; height: 10px; }
.lr-recent__status[data-status="completed"] { background: var(--success-bg); color: var(--success-fg); }
.lr-recent__status[data-status="reading"]   { background: var(--accent-soft); color: var(--accent); }
.lr-recent__title {
  display: block;
  font-size: 0.92rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-recent__sub-text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-recent__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(110, 79, 54, 0.08);
  color: var(--ink-soft);
  font-size: 0.74rem;
  flex-shrink: 0;
}
.lr-recent__arrow { color: var(--line-strong); font-size: 18px; flex-shrink: 0; }
.lr-recent__item:hover .lr-recent__arrow { color: var(--accent); }
.lr-recent__empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 0.92rem;
}
.lr-recent__loadmore {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.lr-recent__loadmore[hidden] { display: none !important; }

/* —— ⑥ 学习路线 —— */
.lr-paths__list { list-style: none; margin: 0; padding: 0; }
.lr-paths__item {
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.lr-paths__item:last-child { border-bottom: 0; }
.lr-paths__link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.18s ease;
}
.lr-paths__link:hover .lr-paths__name,
.lr-paths__link:focus-visible .lr-paths__name { color: var(--accent); }
.lr-paths__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lr-paths__main { min-width: 0; }
.lr-paths__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lr-paths__icon svg { width: 16px; height: 16px; }
.lr-paths__name { font-size: 0.92rem; color: var(--ink); }
.lr-paths__bar {
  position: relative;
  height: 6px;
  background: var(--paper-strong);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.lr-paths__bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #a87a4a, #6e4f36);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.lr-paths__pct {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lr-paths__nums {
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* —— 响应式 —— */
@media (max-width: 880px) {
  .lr-topcards { grid-template-columns: repeat(2, 1fr); }
  .lr-2col { flex-direction: column; }
  .lr-2col__left,
  .lr-2col__right { flex: 1 1 100%; }
  .lr-shell { padding: 20px 16px 40px; }
  .lr-header { flex-direction: column; align-items: stretch; }
  .lr-card { padding: 18px 16px; }
  .lr-recent__item { padding: 12px 14px; }
}
@media (max-width: 480px) {
  .lr-topcards { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .lr-topcard__num { font-size: 1.25rem; }
}
