/* ============================================================
 * css/diary.css —— 单日页（day.html）+ 日记详情（diary-detail.html）
 * 两页共用同一套视觉语言（两栏布局 / 面板 / 互动区），故合并为一个文件。
 * 通用部分（Banner/导航/页脚/令牌）见 css/common.css。
 * 日历组件样式由 assets/diary-render.js 运行时注入（.cal-* / .diary-empty）。
 * 2026-11-21：移除列表页后清掉年份 tab / 月份胶囊 / 列表卡片等死样式。
 * ============================================================ */

/* ===== 两栏布局（叠加在 common.css 的 .container 基础之上） ===== */
.container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== 左侧栏 + 面板 ===== */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-title {
  background: var(--primary-light);
  color: var(--primary-deep);
  font-size: 15px;
  font-weight: bold;
  padding: 10px 16px;
  border-left: 4px solid var(--primary);
}
.panel-body { padding: 14px 16px; }

/* ===== 右侧主区公共 ===== */
.main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 隔离内容容器：模板+文字结合体的渲染目标，调整模板不影响详情整体架构 */
#diary-content { min-height: 120px; }

/* ===== 日记正文（plain 模板渲染产物） ===== */
.diary {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.diary-body { padding: 18px 22px 22px; line-height: 1.9; font-size: 15px; color: var(--ink); }
.diary-body p { margin: 0 0 14px; text-indent: 2em; text-align: justify; text-align-last: left; }
.diary-body p:last-child { margin-bottom: 0; }
/* 图文模板：图片/视频槽位 */
.diary-figure { margin: 14px 22px; }
.diary-figure img, .diary-figure video { width: 100%; border-radius: var(--radius); display: block; box-shadow: var(--shadow); }
.diary-figure.placeholder { height: 140px; background: var(--placeholder-bg); border: 1px dashed var(--placeholder-border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--placeholder-fg); font-size: 14px; margin: 14px 22px; }

/* ===== 相关日记（左栏） ===== */
.related-loading { font-size: 13px; color: var(--ink-soft); padding: 4px 0; }
.related-item {
  padding: 8px; border-radius: 10px; cursor: pointer; display: block;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.related-item:hover { background: var(--primary-light); border-color: var(--line); }
.ri-reason { display: block; font-size: 13px; color: var(--ink); line-height: 1.45; }
.ri-date { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== 互动区（点赞 / 分享 / 评论）——2026-10-17 补齐（此前无任何样式，控件裸奔呈浏览器默认白底，暗夜下黑白刺眼） ===== */
.interactions {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px 20px;
}
.inter-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; font-size: 14px; font-family: inherit; cursor: pointer;
  color: var(--primary-deep); background: var(--primary-light);
  border: 1px solid var(--edge); border-radius: 999px;
  transition: background .15s, color .15s, transform .1s;
}
.like-btn .heart { color: var(--primary); font-size: 15px; line-height: 1; }
.like-btn:hover { background: var(--cream-active); }
.like-btn:active { transform: scale(.94); }
.like-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.like-btn[aria-pressed="true"] .heart { color: var(--on-primary); }
.share-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-btn {
  padding: 5px 14px; font-size: 13px; font-family: inherit; cursor: pointer;
  color: var(--blue); background: var(--blue-light);
  border: 1px solid transparent; border-radius: 999px;
  transition: background .15s, color .15s;
}
.share-btn:hover { background: var(--blue-soft); }
.share-count { font-size: 13px; color: var(--ink-soft); }

.comment-block { margin-top: 16px; }
.comment-title { margin: 0 0 10px; font-size: 16px; color: var(--ink); }
.comment-title .badge {
  display: inline-block; min-width: 18px; text-align: center;
  font-size: 12px; font-weight: normal; color: var(--on-primary); background: var(--blue);
  border-radius: 9px; padding: 0 7px; line-height: 18px; vertical-align: 2px;
}
.comment-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.comment-item:last-child { border-bottom: none; }
.ci-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ci-nick { font-size: 13px; font-weight: bold; color: var(--blue); }
.ci-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-text { margin-top: 4px; font-size: 14px; color: var(--ink); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.comment-empty { font-size: 13px; color: var(--ink-soft); padding: 6px 0; }

.comment-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment-nick, .comment-text {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.comment-nick { width: 240px; max-width: 100%; }
.comment-text { width: 100%; min-height: 84px; resize: vertical; }
.comment-nick::placeholder, .comment-text::placeholder { color: var(--muted); }
.comment-nick:focus, .comment-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.comment-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.comment-msg { font-size: 13px; color: var(--ink-soft); }
.comment-submit {
  padding: 7px 22px; font-size: 14px; font-family: inherit; cursor: pointer;
  color: var(--on-primary); background: var(--primary); border: none; border-radius: 999px;
  transition: background .15s;
}
.comment-submit:hover { background: var(--primary-deep); }

/* ===== 微信扫码分享弹窗：已统一收进全站组件 js/ui.js（DD.wechatQrModal，皮肤感知，零本地样式） ===== */

/* ===== 移动端：两栏退化为单栏（Banner/导航通用部分见 common.css） ===== */
@media (max-width: 768px) {
  .container { grid-template-columns: 1fr; margin-top: 16px; }
}
