/* ============ 个人博客 · B站风格主题 ============ */
:root {
  --primary: #00a1d6;
  --primary-dark: #0087b3;
  --bg: #f6f7f8;
  --card: #ffffff;
  --text: #18191c;
  --text-2: #61666d;
  --text-3: #9499a0;
  --line: #e3e5e7;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 46px; /* 给固定页脚留出高度 */
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- 顶部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 20px;
}
.site-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.site-title .dot { color: var(--primary); }
.site-subtitle {
  position: absolute;
  right: 20px;
  font-size: 12px;
  color: var(--text-3);
}

/* 顶部右侧：副标题 + 我的收藏 */
.header-right {
  position: absolute;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-right .site-subtitle { position: static; }
.my-fav {
  font-size: 12px;
  line-height: 1;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(0, 161, 214, .07);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.my-fav:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 161, 214, .35);
}
.tip-link { color: var(--primary); text-decoration: underline; }
.tip-link:hover { opacity: .8; }

/* 类型标签条：搜索框与内容列表之间，竖线分隔，单选筛选 */
.type-bar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 6px 20px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.type-bar .t-item {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, font-size .15s, background-color .15s;
}
.type-bar .t-item:hover { color: var(--primary); }
.type-bar .t-item.on {
  font-size: 16px;              /* 大一号 */
  font-weight: 600;
  color: var(--primary);        /* 与页面主体搭配的颜色 */
  background: rgba(0, 161, 214, .08);
}
.type-bar .t-sep { color: var(--line); font-size: 13px; user-select: none; }

/* 卡片封面右上角类型标签（右下角是观看次数） */
.card .cover .type-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 161, 214, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}

/* ---------- 留言板样式 ---------- */
.message-board {
  margin-top: 24px;
  padding: 20px 34px 24px;
  border-top: 1px solid var(--line);
}
.msg-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}
.msg-form {
  margin-bottom: 20px;
}
.msg-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.msg-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 161, 214, .1);
}
.msg-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.msg-count {
  font-size: 12px;
  color: var(--text-3);
}
.msg-submit {
  padding: 8px 24px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}
.msg-submit:hover:not(:disabled) {
  background: var(--primary-dark);
}
.msg-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg-item {
  padding: 14px 16px;
  background: #f7f9fa;
  border-radius: 8px;
}
.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.msg-visitor {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.msg-time {
  font-size: 12px;
  color: var(--text-3);
}
.msg-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-loading,
.msg-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-3);
  font-size: 14px;
}

/* 手机端留言板适配 */
@media (max-width: 768px) {
  .message-board {
    padding: 16px;
  }
}

/* 轻提示（重复点赞 / 频率限制的原因） */
.toast {
  position: fixed;
  left: 50%;
  top: 78px;
  transform: translate(-50%, -8px);
  z-index: 999;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(20, 22, 26, .92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 窄屏：标题与收藏按钮优先，副标题隐藏 */
@media (max-width: 768px) {
  .header-right { right: 12px; gap: 6px; }
  .header-right .site-subtitle { display: none; }
  .my-fav { padding: 5px 9px; }
}
.back-link {
  position: absolute;
  left: 20px;
  display: inline;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  transition: .2s;
}
.back-link:hover { background: #f1f2f3; color: var(--primary); }
.back-link svg {
  display: inline-block;
  vertical-align: -3px;   /* 与 14px 文字基线对齐 */
  margin-right: 5px;
}

/* ---------- 搜索区 ---------- */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px 6px;   /* 紧贴顶栏，减少上方留白 */
  text-align: center;
}
.hero .tagline {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 10px;
  letter-spacing: .5px;
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow);
  transition: .2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 161, 214, .15);
}
.search-box svg { flex: none; color: var(--text-3); }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 8px 12px;
  color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box button {
  flex: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  height: 36px;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.search-box button:hover { background: var(--primary-dark); }
.search-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.search-tip .kw { color: var(--primary); font-weight: 600; }

/* ---------- 视频流网格 ---------- */
.feed {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 20px 150px; /* 底部预留：固定页脚 + 浮动分页 */
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 18px;
}
@media (max-width: 1240px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 940px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.card .cover {
  position: relative;
  aspect-ratio: 16 / 11;   /* 封面加高，吃掉底部富余空间 */
  overflow: hidden;
  background: linear-gradient(135deg, #e8eef2, #d9e6ec);
}
.card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .cover img { transform: scale(1.07); }
.card .cover .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  background: linear-gradient(135deg, #00a1d6, #5bcef5);
}
.card .views {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card .body { padding: 9px 11px 10px; flex: 1; display: flex; flex-direction: column; }
.card .title {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;          /* 只显示一行 */
  overflow: hidden;
  text-overflow: ellipsis;      /* 超出用省略号 */
  transition: color .2s;
}
.card:hover .title { color: var(--primary); }
.card .note {
  margin-top: 5px;             /* 紧贴标题 */
  font-size: 13px;              /* 比标题小一号 */
  line-height: 1.4;
  color: var(--text-3);
  white-space: nowrap;          /* 只显示一行 */
  overflow: hidden;
  text-overflow: ellipsis;      /* 超出显示省略号 */
}
.card .meta {
  margin-top: auto;             /* 沉到卡片底部，与备注自然拉开距离 */
  padding-top: 8px;            /* 与上方内容（标题/备注）留一点呼吸感 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.card .meta .loc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 无感人机验证 ---------- */
.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: verifyFadeIn .3s ease;
}
.verify-overlay.fade-out {
  animation: verifyFadeOut .3s ease forwards;
}
@keyframes verifyFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes verifyFadeOut { from { opacity: 1; } to { opacity: 0; } }

.verify-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 22px;
  width: 340px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: verifySlideUp .35s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes verifySlideUp {
  from { transform: translateY(30px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.verify-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.verify-subtitle {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 18px;
}

.verify-canvas-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #f0f0f0;
}
.verify-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
.verify-puzzle {
  position: absolute;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  border: 2px solid rgba(255, 255, 255, .8);
  cursor: grab;
  transition: left .05s linear;
}
.verify-puzzle:active { cursor: grabbing; }

.verify-slider-track {
  position: relative;
  width: 100%;
  height: 44px;
  background: #f1f2f3;
  border-radius: 999px;
  overflow: hidden;
}
.verify-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: linear-gradient(90deg, rgba(0, 161, 214, .25), rgba(0, 161, 214, .4));
  border-radius: 999px;
  transition: width .05s linear;
}
.verify-slider-btn {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  cursor: grab;
  transition: transform .05s linear, box-shadow .15s;
  user-select: none;
  touch-action: none;
}
.verify-slider-btn:hover {
  box-shadow: 0 4px 14px rgba(0, 161, 214, .35);
}
.verify-slider-btn:active { cursor: grabbing; box-shadow: 0 4px 14px rgba(0, 161, 214, .5); }

.verify-result {
  text-align: center;
  font-size: 13px;
  min-height: 20px;
  margin-top: 10px;
  color: var(--text-3);
  transition: color .2s;
}
.verify-result.success { color: #22c55e; font-weight: 600; }
.verify-result.fail { color: #ef4444; }

.verify-refresh {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
  cursor: pointer;
  padding: 4px;
  transition: color .2s;
}
.verify-refresh:hover { color: var(--primary); }

/* 窄屏适配 */
@media (max-width: 480px) {
  .verify-box { padding: 20px 16px 16px; width: 300px; }
  .verify-title { font-size: 15px; }
  .verify-subtitle { font-size: 12px; margin-bottom: 12px; }
  .verify-slider-track { height: 40px; }
  .verify-slider-btn { width: 36px; height: 36px; }
  .verify-slider-fill { width: 36px; }
}

/* 置顶文章卡片样式 */
.card.top-card {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 16px rgba(0, 161, 214, .2);
}
.card .cover .top-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 152, 0, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}

/* 生命倒计时卡片 */
.life-countdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.countdown-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.countdown-bar {
  width: 100%;
  height: 8px;
  background: #f1f2f3;
  border-radius: 999px;
  overflow: hidden;
}
.countdown-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.countdown-fill.year {
  background: linear-gradient(90deg, #00a1d6, #5bcef5);
}
.countdown-fill.month {
  background: linear-gradient(90deg, #ff9800, #ffb74d);
}
.countdown-fill.day {
  background: linear-gradient(90deg, #4caf50, #81c784);
}
.countdown-text {
  font-size: 12px;
  color: var(--text-3);
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* 推荐阅读置顶标记 */
.side-list .top-badge {
  font-size: 12px;
  margin-right: 2px;
}
/* 推荐阅读置顶文章：淡橙色背景 */
.side-list a.top-article {
  background: rgba(255, 152, 0, .08);
  border-radius: 4px;
  padding-left: 6px;
  margin-left: -6px;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.skeleton .sk-cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, #eceef0 25%, #f6f7f8 50%, #eceef0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.skeleton .sk-line {
  height: 14px;
  margin: 13px 13px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #eceef0 25%, #f6f7f8 50%, #eceef0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.skeleton .sk-line.short { width: 55%; margin-bottom: 15px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 空状态 ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 0;
  color: var(--text-3);
}
.empty .icon { font-size: 46px; margin-bottom: 12px; }
.empty .retry {
  margin-top: 14px;
  display: inline-block;
  color: var(--primary);
  cursor: pointer;
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 13px;
}

/* ---------- 浮动分页 ---------- */
.pager {
  position: fixed;
  left: 50%;
  bottom: 66px; /* 在固定页脚上方，不遮挡备案信息 */
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
  user-select: none;
  max-width: calc(100vw - 24px);
}
.pager button {
  min-width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: .18s;
  padding: 0 8px;
}
.pager button:hover:not(:disabled):not(.active) { background: #f1f2f3; color: var(--text); }
.pager button.active { background: var(--primary); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pager .sep { color: var(--text-3); font-size: 13px; }
.pager .info { font-size: 13px; color: var(--text-2); padding: 0 6px; white-space: nowrap; }
.pager .jump {
  width: 54px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  outline: none;
}

/* ---------- 页脚：单行，固定在底部 ---------- */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 240;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.6;
}
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--primary); }
.site-footer .icp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 70px;
  z-index: 300;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-2);
  opacity: 0;
  pointer-events: none;
  transition: .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--primary); transform: translateY(-3px); }

/* ============ 详情页（B站/抖音图文风格） ============ */
.article-wrap {
  max-width: 1100px;
  margin: 16px auto 150px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1000px) {
  .article-wrap { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: none; }
}
.article-main {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.article-head { padding: 22px 34px 0; }
/* 标题 + “图文”注脚标签 同一行 */
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-tag {
  display: inline-block;
  flex: none;
  background: rgba(0, 161, 214, .12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 400;
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
}
.article-head h1 {
  font-size: 26px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}
.article-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-weight: 600;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a1d6, #5bcef5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}
.article-meta .m { display: inline-flex; align-items: center; gap: 5px; }

/* 图文正文 */
.article-content {
  padding: 18px 34px 0;
  font-size: 16px;
  line-height: 1.9;
  color: #232529;
  word-break: break-word;
}
.article-content p { margin: 14px 0; }
/* 与 Quill 编辑器保持一致（.ql-editor{white-space:pre-wrap}）：
   保留作者在后台敲的连续空格与纯空格段落，否则 HTML 会把它们折叠成一个/当空白丢掉。
   只给块级元素加，块与块之间的源码空白仍由容器的 normal 规则处理，不会多出空行。 */
.article-content p,
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6,
.article-content li,
.article-content blockquote,
.article-content td, .article-content th { white-space: pre-wrap; }
.article-content img {
  width: auto;                                    /* 按原图尺寸展示，不强行拉伸 */
  max-width: min(100%, var(--img-max, 760px));    /* 封顶：不超过正文宽度，也不超过 IMAGE_MAX_WIDTH */
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin: 20px auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  cursor: zoom-in;                                /* 点击看大图 */
}

/* Quill 字号下拉（小/大/超大）：与编辑器一致用 em，跟随正文缩放 */
.article-content .ql-size-small { font-size: .8em; }
.article-content .ql-size-large { font-size: 1.5em; }
.article-content .ql-size-huge  { font-size: 2.5em; line-height: 1.4; }

/* Quill 字体（衬线/等宽） */
.article-content .ql-font-serif  { font-family: Georgia, "Songti SC", serif; }
.article-content .ql-font-monospace { font-family: Consolas, "Courier New", monospace; }
.article-content a { color: var(--primary); }
.article-content > :last-child { margin-bottom: 0; }

/* Quill 富文本的排版类：博客侧也要定义，否则后台设的对齐/缩进在详情页不生效 */
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right  { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }
.article-content .ql-indent-1 { padding-left: 3em; }
.article-content .ql-indent-2 { padding-left: 6em; }
.article-content .ql-indent-3 { padding-left: 9em; }
.article-content .ql-indent-4 { padding-left: 12em; }
.article-content .ql-indent-5 { padding-left: 15em; }
.article-content .ql-indent-6 { padding-left: 18em; }

/* .avatar 里的图片 */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* 互动条 */
.article-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 16px 34px 22px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 14px;
  cursor: pointer;
  transition: .2s;
}
.act-btn:hover { border-color: var(--primary); color: var(--primary); }
.act-btn.on {
  background: rgba(0, 161, 214, .1);
  border-color: var(--primary);
  color: var(--primary);
}

/* 上一篇/下一篇 */
.pager-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 34px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.pager-nav a { color: var(--text-2); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-nav a:hover { color: var(--primary); }
.pager-nav .disabled { color: var(--text-3); opacity: .6; }

/* 侧栏 */
.article-side .side-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.side-card h4 {
  font-size: 15px;
  margin-bottom: 12px;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
}
.side-card .about {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.side-card .about .avatar { width: 46px; height: 46px; font-size: 20px; }
.side-card .about .name { font-weight: 600; }
.side-card .about .desc { font-size: 12px; color: var(--text-3); }
.side-card p { font-size: 13px; color: var(--text-2); line-height: 1.8; }
.side-list a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-list a:last-child { border-bottom: none; }
.side-list a:hover { color: var(--primary); }

/* 加载/错误 */
.page-status {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-3);
  font-size: 15px;
}
.page-status .icon { font-size: 44px; margin-bottom: 14px; }
.page-status .retry, .page-status .btn {
  margin-top: 16px;
  display: inline-block;
  padding: 8px 24px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  color: var(--primary);
  cursor: pointer;
}

/* 备案：后台“备注”展示块 */
.article-note {
  margin: 8px 34px 0;
  padding: 12px 16px;
  background: #f7f9fa;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  white-space: normal;   /* 容器不保留换行，否则 HTML 源码缩进会被渲染成空行 */
}
.article-note #artNoteText {
  white-space: pre-line;   /* 只在正文部分保留备注里的换行 */
}
.article-note .label {
  color: var(--primary);
  font-weight: 600;
  margin-right: 8px;
}

/* 留言分组展示 */
.msg-group {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.msg-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f7f9fa;
  border-bottom: 1px solid var(--line);
}
.msg-group-header .msg-visitor {
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}
.msg-group-header .msg-count-badge {
  font-size: 12px;
  color: var(--text-3);
  background: #e3e5e7;
  padding: 2px 8px;
  border-radius: 10px;
}
.msg-group-body {
  padding: 8px 16px;
}
.msg-content-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.6;
}
.msg-content-item:last-child {
  border-bottom: none;
}
.msg-content-item .msg-index {
  color: var(--text-3);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg-content-item .msg-text {
  flex: 1;
  color: var(--text);
  word-break: break-word;
}
.msg-content-item .msg-time {
  color: var(--text-3);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 点击图片看大图 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, .88);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 16px;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.lightbox .tip {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
}

/* ============ 多端适配：平板 / 手机 ============ */

/* 平板横屏及以上（≤1240px 时卡片已变 3 列，≤940px 变 2 列） */
@media (max-width: 1024px) {
  .site-subtitle { display: none; }
  .hero { padding-top: 26px; }
  .article-wrap { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .article-side { display: none; }          /* 平板上隐藏侧栏，正文全宽 */
}

/* 手机竖屏（≤768px） */
@media (max-width: 768px) {
  .site-header .inner { height: 54px; padding: 0 12px; }
  .site-title { font-size: 19px; }
  .back-link { left: 10px; padding: 6px 10px; font-size: 13px; }

  .hero { padding: 20px 14px 4px; }
  .hero .tagline { margin-bottom: 12px; font-size: 12px; }
  .search-box { padding-left: 14px; }
  .search-box input { font-size: 14px; padding: 7px 8px; }
  .search-box button { padding: 0 16px; height: 34px; font-size: 13px; }

  .feed { padding: 14px 12px 140px; }
  .grid { gap: 14px 12px; }
  .card .body { padding: 9px 11px 11px; }
  .card .title { font-size: 14px; }
  .card .note { font-size: 12px; margin-top: 3px; }

  /* 分页：压缩尺寸，手机上隐藏跳转输入框 */
  .pager { bottom: 60px; padding: 6px 8px; gap: 3px; overflow-x: auto; }
  .pager button { min-width: 30px; height: 30px; padding: 0 6px; font-size: 13px; }
  .pager .jump { display: none; }
  .pager .info { font-size: 12px; padding: 0 4px; }
  .to-top { right: 14px; bottom: 122px; width: 38px; height: 38px; }

  /* 详情页 */
  .article-wrap { margin: 10px auto 140px; padding: 0 10px; }
  .article-head { padding: 16px 16px 0; }
  .article-head h1 { font-size: 21px; }
  .title-row { gap: 8px; }
  .article-meta { gap: 10px; margin-top: 12px; padding-bottom: 12px; font-size: 12px; }
  .article-meta .author { font-size: 13px; }
  .avatar { width: 30px; height: 30px; font-size: 14px; }
  .article-content { padding: 14px 16px 0; font-size: 15px; line-height: 1.85; }
  .article-note { margin: 8px 16px 0; padding: 10px 12px; font-size: 13px; }
  .article-actions { padding: 14px 16px; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
  .act-btn { padding: 8px 16px; font-size: 13px; }
  .pager-nav { flex-direction: column; gap: 8px; padding: 14px 16px; }
  .pager-nav a { max-width: 100%; }
}

/* 小屏手机（≤480px）：卡片单列更舒展 */
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .pager .info { display: none; }           /* 极窄屏隐藏“共 N 篇” */
  .site-footer { font-size: 11px; padding-top: 9px; padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px)); }
}
