/* ============================================================
   devlog.css — 开发日志（/devlog）左轨日期 + 单列内容流（changelog 形态）
   卡片内按字头分组渲染更新明细（新增/优化/修复/重构/安全/注意等彩色标签）
   依赖 style.css 基础令牌与 about.css 工具类（ab-hero/ab-cta/ab-empty）
   文字层：浅区 --t-strong/--t-h3/--t-num，次级 --ink-2/--ink-3（暗色末尾重映射）
   ============================================================ */

.dg-wrap { padding-top: 44px; padding-bottom: 72px; }

/* ---- 时间线主干：左侧竖线，左轨日期、右侧卡片 ----
   几何：rail 宽 110（日期右对齐）→ 线 x=130（rail 外 20px）→ 卡片 margin-left 46 → 卡片起 x=156
   （线右缘 132 + 24 间隙），月份徽章 padding-left 154 与卡片左缘对齐 */
.dg-timeline { position: relative; max-width: 1020px; margin: 0 auto; padding: 8px 0; }
.dg-timeline::before {
  content: ""; position: absolute; left: 130px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 6%, var(--line-strong) 94%, transparent);
}

/* ---- 月份分组：徽章挂在线右侧组顶，与卡片左缘对齐 ---- */
.dg-month { display: flex; padding: 30px 0 12px 156px; }
.dg-month-badge {
  padding: 6px 18px; border-radius: 999px; background: var(--gold-grad);
  color: #F2EFE6; font-size: 13px; font-weight: 700; letter-spacing: .05em;
  box-shadow: var(--shadow-sm);
}

/* ---- 条目：左轨日期 + 节点 + 卡片 ---- */
.dg-item { position: relative; display: flex; padding: 12px 0; }
.dg-node {
  position: absolute; left: 123px; top: 28px; width: 14px; height: 14px; z-index: 1;
  border-radius: 50%; background: var(--paper);
  border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.dg-rail { width: 110px; flex-shrink: 0; text-align: right; padding: 24px 26px 0 0; }
.dg-date { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.dg-card {
  display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0;
  margin-left: 46px;
  padding: 20px 24px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s ease;
}
.dg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

/* 卡片头部：标题居左，查看详情固定右上 */
.dg-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dg-title { font-size: 16.5px; font-weight: 700; line-height: 1.5; color: var(--t-h3); transition: color .2s ease; }
.dg-card:hover .dg-title { color: var(--accent-strong); }
.dg-top {
  display: inline-block; margin-right: 8px; padding: 1px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 11px; font-weight: 600; vertical-align: 2px;
}

/* ---- 字头分组明细 ---- */
.dg-sections { display: flex; flex-direction: column; gap: 12px; }
.dg-sec { display: flex; align-items: flex-start; gap: 12px; }
.dg-tag {
  flex-shrink: 0; min-width: 48px; text-align: center; margin-top: 1px;
  padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.6;
}
.dg-list { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dg-li { position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.dg-li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); opacity: .55;
}

/* 字头色板（8 色固定，亮暗双套；后台更新日志插件可配置字头→色板映射） */
.dg-tag-t-green  { color: #157347; background: rgba(21, 115, 71, .1); }
.dg-tag-t-blue   { color: #0b5cad; background: rgba(11, 92, 173, .09); }
.dg-tag-t-orange { color: #b4530a; background: rgba(180, 83, 10, .1); }
.dg-tag-t-purple { color: #6d3fc0; background: rgba(109, 63, 192, .09); }
.dg-tag-t-gold   { color: #8a6d00; background: rgba(138, 109, 0, .1); }
.dg-tag-t-red    { color: #b3261e; background: rgba(179, 38, 30, .09); }
.dg-tag-t-cyan   { color: #0e7490; background: rgba(14, 116, 144, .09); }
.dg-tag-t-gray   { color: #64748b; background: rgba(100, 116, 139, .11); }

.dg-more { flex-shrink: 0; margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.dg-desc { font-size: 13.5px; line-height: 1.75; color: var(--ink-3); }

/* ---- 空态 ---- */
.dg-empty { max-width: 720px; margin: 0 auto; }

/* ---- 响应式：窄屏日期并入卡片上方，线贴左 ---- */
@media (max-width: 640px) {
  .dg-wrap { padding-top: 28px; padding-bottom: 56px; }
  .dg-timeline::before { left: 8px; }
  .dg-month { padding: 20px 0 8px 24px; }
  .dg-item { flex-wrap: wrap; padding: 8px 0 8px 24px; }
  .dg-node { left: 1px; top: 16px; }
  .dg-rail { width: auto; text-align: left; padding: 0; }
  .dg-card { flex: 1 1 100%; margin-left: 0; margin-top: 8px; padding: 16px 18px; }
  .dg-more { font-size: 12.5px; }
  .dg-sec { gap: 10px; }
}

/* ---- 暗色主题可读性重映射 ----
   次级说明统一提为白系弱化档（--ink-4），强调统一提为点缀色（--fg-accent），
   卡片/分页转 glass 深底，字头标签转低饱和亮色（同 news.css 体系）。 */
html[data-theme="dark"] .dg-month-badge { background: var(--accent-2); color: var(--brand-deep); }
html[data-theme="dark"] .dg-date,
html[data-theme="dark"] .dg-desc,
html[data-theme="dark"] .dg-li { color: var(--ink-4); }
html[data-theme="dark"] .dg-li::before { background: rgba(255, 255, 255, .4); }
html[data-theme="dark"] .dg-card,
html[data-theme="dark"] .dg-node { background: var(--glass); }
html[data-theme="dark"] .dg-node { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
html[data-theme="dark"] .dg-card { border-color: var(--glass-line); box-shadow: none; }
html[data-theme="dark"] .dg-card:hover { border-color: var(--border-strong); }
html[data-theme="dark"] .dg-title { color: var(--td-h); }
html[data-theme="dark"] .dg-card:hover .dg-title,
html[data-theme="dark"] .dg-more { color: var(--fg-accent); }
html[data-theme="dark"] .dg-top { background: rgba(255, 255, 255, .07); color: var(--ink-4); }
/* 字头色板（暗色：亮字 + 低透明彩底） */
html[data-theme="dark"] .dg-tag-t-green  { color: #6fd9a0; background: rgba(111, 217, 160, .13); }
html[data-theme="dark"] .dg-tag-t-blue   { color: #7db8f0; background: rgba(125, 184, 240, .13); }
html[data-theme="dark"] .dg-tag-t-orange { color: #f0a35e; background: rgba(240, 163, 94, .13); }
html[data-theme="dark"] .dg-tag-t-purple { color: #c3a1f5; background: rgba(195, 161, 245, .13); }
html[data-theme="dark"] .dg-tag-t-gold   { color: #e8d27a; background: rgba(232, 210, 122, .13); }
html[data-theme="dark"] .dg-tag-t-red    { color: #f4948f; background: rgba(244, 148, 143, .13); }
html[data-theme="dark"] .dg-tag-t-cyan   { color: #6fd0e8; background: rgba(111, 208, 232, .13); }
html[data-theme="dark"] .dg-tag-t-gray   { color: #aab2bd; background: rgba(170, 178, 189, .13); }
html[data-theme="dark"] .nw-page-btn { background: var(--glass); border-color: var(--glass-line); color: var(--ink-2); }
html[data-theme="dark"] .nw-page-btn.is-active { background: var(--accent-2); border-color: transparent; color: var(--brand-deep); }
