/* =========================================================
   字母 去水印 · 资源站布局（清爽浅色工具风）
   主蓝 #2563eb / 白底 / 浅灰衬底
   ========================================================= */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --text: #1f2937;
  --sub: #6b7280;
  --soft: #f8fafc;
  --border: #e5e7eb;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.65;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 + 分类导航 ---------- */
.site-top { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 40; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; }
.logo { display: flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 30px; width: auto; display: block; }
.logo-ph {
  width: 36px; height: 36px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  background: var(--soft);
  color: #9ca3af;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.cat-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-nav a {
  position: relative;
  padding: 8px 4px;
  margin: 0 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cat-nav a:hover { color: var(--blue); }
.cat-nav a.active { color: var(--blue); }
.cat-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.25s ease, left 0.25s ease;
}
.cat-nav a:hover::after,
.cat-nav a.active::after {
  left: 0;
  width: 100%;
}

/* ---------- 主区 7:3 ---------- */
.layout {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  padding-top: 22px;
  padding-bottom: 40px;
}
.content-main {
  flex: 1 1 70%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.sidebar { flex: 0 0 300px; width: 300px; }

.page-title {
  font-size: 17px;
  line-height: 1.2;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 4px solid var(--blue);
}
.cat-intro { color: var(--sub); font-size: 14px; margin: -6px 0 16px; }
.empty { color: var(--sub); }

/* ---------- 文章列表：卡片 + 横线分割 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.post-item.pinned { background: linear-gradient(90deg, var(--blue-light), #fff 70%); border-radius: 8px; padding: 12px 14px; }
.post-card { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.pin-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  padding: 1px 9px;
  border-radius: 0 6px 0 8px;
  z-index: 2;
}
.post-thumb { flex: 0 0 30%; max-width: 200px; }
.post-thumb img, .thumb-ph {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: #9ca3af;
  font-size: 13px;
  border-style: dashed;
}
.post-body { flex: 1 1 70%; min-width: 0; padding-right: 46px; }
.post-title { font-size: 18px; line-height: 1.4; margin: 0 0 6px; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--blue); }
.post-summary {
  color: var(--sub);
  font-size: 14px;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta { font-size: 12px; color: #9ca3af; display: flex; gap: 14px; flex-wrap: wrap; }
.meta-cat { color: var(--blue); }
.meta-cat:hover { text-decoration: underline; }

/* 「点击查看更多」 */
.more-wrap { text-align: center; margin: 20px 0 0; }
.btn-more {
  border: 1px solid var(--blue);
  color: var(--blue);
  background: #fff;
  border-radius: 999px;
  padding: 8px 34px;
  font-size: 14px;
  cursor: pointer;
}
.btn-more:hover { background: var(--blue-light); }

/* ---------- 右侧边栏 ---------- */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 70px; }
.widget {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.widget-title {
  font-size: 15px;
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--blue);
  line-height: 1.2;
}
.owner-box { text-align: center; }
.owner-avatar {
  width: 74px; height: 74px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px dashed #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 12px;
  overflow: hidden;
}
.owner-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.owner-tagline { color: var(--sub); font-size: 13px; margin: 0 0 10px; }
.owner-contact { list-style: none; margin: 0; padding: 0; text-align: left; font-size: 13px; color: var(--sub); }
.owner-contact li { padding: 3px 0; }
.qr-ph {
  width: 150px; height: 150px;
  margin: 0 auto;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: var(--soft);
  color: #9ca3af;
  font-size: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.7;
}

/* 下载 / 获取模块按钮 */
.dl-links { display: flex; flex-direction: column; gap: 10px; }
.btn-dl {
  display: block;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid transparent;
}
.btn-dl.primary { background: var(--blue); color: #fff !important; }
.btn-dl.primary:hover { background: var(--blue-dark); }
.btn-dl.ghost { border-color: var(--blue); color: var(--blue) !important; background: #fff; }
.btn-dl.ghost:hover { background: var(--blue-light); }

/* =========================================================
   ⭐ 站长信息卡「上下漂浮」动效（2026-09-09 需求 v4 最终）
   效果：卡片垂直上下漂 ±12px / 7s 缓动循环；悬停暂停
   撤销：整段删除本注释到下一个分隔线之间规则；或还原备份
   static/css/blog.css.bak-20260909-012652
   ========================================================= */
.sidebar > .widget:first-child {
  animation: ownerFloat 7s ease-in-out infinite;
  will-change: transform;
}
.sidebar > .widget:first-child:hover {
  animation-play-state: paused;
}
@keyframes ownerFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(20px); }
}
/* ============ 站长信息卡漂浮结束 ============ */

/* ---------- 文章详情（精修版）---------- */
.article-page { padding: 26px 0 44px; }
.article { max-width: 820px; margin: 0 auto; font-size: 16px; line-height: 1.85; color: var(--text); word-break: break-word; }

/* 标题头 */
.article-head h1 { font-size: 30px; margin: 0 0 8px; line-height: 1.35; }
.article-meta { font-size: 13px; color: var(--sub); display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.article-meta a { color: var(--blue); }

/* 正文基础 */
.article p { margin: 0 0 1em; }
/* 中文首行缩进 2 字符：只作用于正文顶层段落；列表/引用内段落不受影响 */
.article > p { text-indent: 2em; }
/* 例外：纯图片段落不缩进（避免图片被推右） */
.article > p:has(> img:only-child) { text-indent: 0; }
/* 手动取消缩进：正文里用原生 HTML 写 <p class="no-indent">……</p> */
.article > p.no-indent { text-indent: 0; }
.article a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(37, 99, 235, 0.35); }
.article a:hover { color: var(--blue-dark); text-decoration-color: currentColor; }
.article strong { font-weight: 700; }
.article em { font-style: italic; }
.article del { color: var(--sub); }
.article hr {
  border: 0; height: 1px; background: var(--border);
  margin: 2em auto; max-width: 60%;
}

/* 标题层级节奏（正文内 h1 少见，仍兜底） */
.article h1, .article h2, .article h3, .article h4 { line-height: 1.4; font-weight: 700; color: var(--text); }
.article h1 { font-size: 26px; margin: 1.6em 0 0.7em; }
.article h2 { font-size: 22px; margin: 1.8em 0 0.7em; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article h3 { font-size: 18px; margin: 1.6em 0 0.6em; }
.article h4 { font-size: 16px; margin: 1.4em 0 0.5em; color: var(--blue-dark); }
.article h2:first-child, .article h3:first-child { margin-top: 0; }

/* 列表 */
.article ul, .article ol { margin: 0 0 1em; padding-left: 1.6em; }
.article li { margin: 0.35em 0; }
.article li > ul, .article li > ol { margin-bottom: 0.2em; }
.article ul li::marker { color: var(--blue); }
.article ol li::marker { font-weight: 600; color: var(--blue-dark); }
/* 任务列表（- [x] 需开启 goldmark taskList 扩展方输出） */
.article li.task-list-item { list-style: none; margin-left: -1.6em; }
.article li.task-list-item input[type="checkbox"] { margin-right: 0.5em; accent-color: var(--blue); }

/* 行内代码 */
.article code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  font-size: 0.88em;
  white-space: break-spaces;
}
.article a code { color: inherit; }

/* 代码块（含 chroma 高亮容器） */
.article pre {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 17px;
  overflow-x: auto;
  margin: 0 0 1.1em;
  line-height: 1.65;
  font-size: 13.5px;
  tab-size: 4;
}
.article pre code { background: none; color: #24292f; padding: 0; border-radius: 0; font-size: inherit; white-space: pre; }
.article pre::-webkit-scrollbar { height: 8px; }
.article pre::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 4px; }
/* 代码块无语言标注时的语言提示条（有数据-lang时） */
.article pre:not([class]) { position: relative; }

/* 引用 */
.article blockquote {
  border-left: 4px solid var(--blue);
  margin: 1.2em 0;
  padding: 6px 18px;
  color: #4b5563;
  background: var(--blue-light);
  border-radius: 0 10px 10px 0;
}
.article blockquote > *:last-child { margin-bottom: 0.4em; }
.article blockquote blockquote { background: rgba(255,255,255,0.6); border-left-color: #93c5fd; margin-left: 0.5em; }

/* 表格：窄屏横向滚动 */
.article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 14.5px;
  border-spacing: 0;
}
.article thead { display: table-header-group; }
.article th, .article td { border: 1px solid var(--border); padding: 8px 13px; text-align: left; white-space: nowrap; }
.article th { background: var(--soft); font-weight: 600; color: var(--text); }
.article tbody tr:nth-child(even) { background: var(--soft); }

/* 图片 */
.article img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin: 1.2em auto;
}
.article p > img:only-child { margin: 1.4em auto; }
.article img[src$=".svg"] { border: none; }

/* 键盘键位 / 代码中标签 */
.article kbd {
  display: inline-block;
  padding: 0.15em 0.5em;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82em;
  background: #fff;
  border: 1px solid #d0d7de;
  border-bottom-width: 2px;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* 脚注 */
.article .footnotes { font-size: 13.5px; color: var(--sub); border-top: 1px solid var(--border); margin-top: 2.4em; padding-top: 0.8em; }
.article .footnotes ol { padding-left: 1.4em; }
.article sup a { text-decoration: none; }

/* details / summary（raw HTML 折叠块） */
.article details { border: 1px solid var(--border); border-radius: 10px; padding: 4px 16px; margin: 1.1em 0; background: #fff; }
.article summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.article details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* 文章内下载模块（shortcode dl-card） */
.article .dlcard {
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  padding: 14px 18px;
  margin: 1.4em 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.06);
}
.dlcard-title { font-size: 15px; font-weight: 700; color: var(--text); }
.dlcard-desc { display: block; font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.dlcard-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.dlcard .btn-dl { display: inline-block; width: auto; padding: 8px 24px; }

.back-link { max-width: 820px; margin: 18px auto 0; font-size: 14px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--soft); padding: 20px 0; font-size: 13px; color: var(--sub); }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-left { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-left a { color: var(--sub); }
.footer-left a:hover { color: var(--blue); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { flex: 1 1 auto; width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .widget { flex: 1 1 240px; }
  .top-inner { flex-direction: column; align-items: flex-start; padding: 10px 20px; }
  .cat-nav { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .post-thumb { flex-basis: 38%; }
  .post-body { padding-right: 0; }
  .footer-inner { flex-direction: column; }
}
