/* 高海拔内容管理系统 前台主题
   视觉参考：inis community v2.2.x（浅灰蓝底 + 白卡片 + 左侧资料栏 + 单列图文流）
   设计变量集中在 :root 与 html.dark，换主色只改 --accent 一处。 */

:root {
  --bg: #f7f9fe;
  --card: #ffffff;
  --text: #4e5358;
  --title: #363636;
  --muted: #8a8f9b;
  --muted-2: #b5b5c3;
  --line: #eff2f5;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: #eef6ff;
  --radius: 5px;
  --shadow: 0 0 10px hsla(0, 0%, 45%, .08);
  --shadow-lg: 0 6px 26px hsla(0, 0%, 45%, .12);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
}

html.dark {
  --bg: #282b34;
  --card: #363a44;
  --text: #d5dbe4;
  --title: #f2f6fc;
  --muted: #9ba0ab;
  --muted-2: #787884;
  --line: #3f434c;
  --accent-soft: rgba(59, 130, 246, .22);
  --shadow: 0 0 10px hsla(0, 0%, 9%, .1);
  --shadow-lg: 0 8px 30px hsla(0, 0%, 6%, .3);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; width: 100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--title); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, button { font-size: 14px; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.icon { width: 16px; height: 16px; flex: none; }

/* ---------------- 顶栏 ---------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.navbar .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 600;
  color: var(--title);
  letter-spacing: -.01em;
}

.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  flex: none;
  overflow: hidden;
}

.brand .mark img { width: 100%; height: 100%; object-fit: cover; }

.nav { display: flex; align-items: center; gap: 22px; margin-left: 6px; }

.nav a {
  position: relative;
  font-size: 14px;
  color: var(--text);
  padding: 18px 0;
  transition: color .16s;
}

.nav a:hover { color: var(--accent); }

.nav a.on { color: var(--accent); }

.nav a.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: background .16s, color .16s;
}

.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }

.head-right .write {
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .16s;
}

.head-right .write:hover { background: var(--accent-hover); }

.nav-toggle { display: none; }

/* ---------------- 两栏 ---------------- */

.layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0 44px;
}

.side {
  width: 250px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------------- 侧栏卡片 ---------------- */

.pcard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.pcard .cover {
  height: 110px;
  background: linear-gradient(135deg, #eef5ff 0%, #dbe8fb 52%, #c9dcfa 100%);
  position: relative;
}

.pcard .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, .55), transparent 46%),
    radial-gradient(circle at 78% 84%, rgba(255, 255, 255, .35), transparent 40%);
}

.pcard .avatar {
  position: absolute;
  left: 16px;
  top: 78px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 600;
  overflow: hidden;
}

.pcard .avatar img { width: 100%; height: 100%; object-fit: cover; }

html.dark .post-head .pa,
html.dark .comment .avatar { color: #93c5fd; }

html.dark .pcard .cover {
  background: linear-gradient(135deg, #2c3340 0%, #34415a 55%, #3a4a66 100%);
}

.pcard .body { padding: 38px 16px 14px; }

.pcard .name-row { display: flex; align-items: center; gap: 7px; }

.pcard .name { font-size: 15px; font-weight: 600; color: var(--title); }

.badge {
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.pcard .sign {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard .social { display: flex; gap: 14px; margin-top: 12px; color: var(--muted); }

.pcard .social a { transition: color .16s; display: grid; place-items: center; }
.pcard .social a:hover { color: var(--accent); }

.pcard .stats {
  display: flex;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pcard .stats div { flex: 1; text-align: center; }
.pcard .stats b { display: block; font-size: 15px; color: var(--title); font-weight: 600; }
.pcard .stats span { font-size: 12px; color: var(--muted-2); }

.scard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.scard h3 {
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.scard h3::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.scard h3 em { font-style: normal; font-size: 12px; color: var(--muted-2); font-weight: 400; }

/* 搜索 */
.search { display: flex; align-items: center; }

.search input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .16s;
}

.search input::placeholder { color: var(--muted-2); }
.search input:focus { border-color: var(--accent); }

.search button {
  width: 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: color .16s, border-color .16s;
}

.search button:hover { color: var(--accent); border-color: var(--accent); }

/* 分类 */
.cat-list li + li { margin-top: 2px; }

.cat-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 4px;
  font-size: 13.5px;
  transition: background .16s, color .16s;
}

.cat-list a:hover { background: var(--accent-soft); color: var(--accent); }
.cat-list em { font-style: normal; font-size: 12px; color: var(--muted-2); margin-left: auto; }
.cat-list .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: none;
}
.cat-list a:hover .dot { background: var(--accent); }

/* 标签 */
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }

.tagcloud a {
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
  transition: background .16s, color .16s;
}

.tagcloud a:hover { background: var(--accent); color: #fff; }

/* 子分类缩进 */
.cat-list li.cat-child a { padding-left: 24px; font-size: 13px; color: var(--muted); }
.cat-list li.cat-child a:hover { color: var(--accent); }

/* 站点公告条 */
.notice { background: linear-gradient(90deg, var(--accent), #60a5fa); color: #fff; }
.notice-in { max-width: 1200px; margin: 0 auto; padding: 8px 14px; display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.notice-in .icon { opacity: .95; }
.notice-txt { flex: 1; min-width: 0; }
.notice-txt a { color: #fff; text-decoration: underline; }
.notice-x { flex: none; background: rgba(255, 255, 255, .2); border: 0; color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.notice-x:hover { background: rgba(255, 255, 255, .34); }
html.dark .notice { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }

/* 友链分组 */
.link-group { margin-bottom: 26px; max-width: 860px; }
.link-group .lg-title { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; color: var(--title); }
.link-group .lg-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--accent); }
.link-group .lg-title span { font-size: 12.5px; color: var(--muted-2); font-weight: 400; }

/* 搜索筛选栏 */
.search-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.search-filter input, .search-filter select {
  flex: 1 1 150px; min-width: 0; padding: 8px 11px; font-size: 13.5px; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
}
.search-filter input:focus, .search-filter select:focus { border-color: var(--accent); outline: none; }
.search-filter .btn { flex: none; }

/* 最新 */
.recent li + li { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.recent a {
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .16s;
}

.recent a:hover { color: var(--accent); }
.recent time { display: block; margin-top: 4px; font-size: 12px; color: var(--muted-2); }

/* 工具 */
.tools { display: flex; gap: 8px; }

.tools a {
  flex: 1;
  height: 34px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .16s, color .16s;
}

.tools a:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------------- 列表头部 ---------------- */

.list-head {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.list-head .lh-main { flex: 1; min-width: 0; }
.list-head .crumb { font-size: 12.5px; color: var(--muted-2); margin-bottom: 3px; }
.list-head h1 { font-size: 18px; letter-spacing: -.01em; }
.list-head .count { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.list-head .back {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 14px;
  background: var(--bg);
  transition: color .16s, background .16s;
}

.list-head .back:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------------- 文章卡片 ---------------- */

.post {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .22s, transform .22s;
}

.post:hover { box-shadow: var(--shadow-lg); }

/* 卡头：头像 + 作者/日期 + 右侧置顶与分类 */
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 11px;
  border-bottom: 1px solid var(--line);
}

.post-head .pa {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
  overflow: hidden;
}

.post-head .pa img { width: 100%; height: 100%; object-fit: cover; }

.post-head .who { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.post-head .who b { font-size: 13.5px; font-weight: 600; color: var(--title); }
.post-head .who time { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.post-head .ph-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }

.post-head .cat {
  color: var(--accent);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--accent-soft);
  transition: background .16s, color .16s;
}

.post-head .cat:hover { background: var(--accent); color: #fff; }

.post-head .top-post {
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}

/* 封面：200px 定高，标题压在图上（对齐 inis community 的 post-cover + post-link） */
.post-cover {
  display: block;
  position: relative;
  margin: 12px 16px 0;
  height: 200px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}

.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post:hover .post-cover img { transform: scale(1.04); }

.post-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .58) 12%, transparent);
  pointer-events: none;
}

.post-title {
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post > .post-title { padding: 14px 16px 0; }

.post-title.ov {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 13px;
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
  font-size: 17px;
}

.post:hover .post-title a { color: var(--accent); }
.post-title a:hover { color: var(--accent); }

.post-body { padding: 9px 16px 0; }
.post-cover + .post-body { padding-top: 12px; }

.post-sum {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.post-tags a {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background .16s, color .16s;
}

.post-tags a:hover { background: var(--accent); color: #fff; }

.post-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 16px 0;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-2);
}

.post-foot .st { display: inline-flex; align-items: center; gap: 4px; }

.post-foot .more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  transition: color .16s;
}

.post-foot .more:hover { color: var(--accent); }

/* ---------------- 分页 ---------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
  flex-wrap: wrap;
}

.pager a, .pager span {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .16s, color .16s;
}

.pager a:hover { background: var(--accent); color: #fff; }
.pager .cur { background: var(--accent); color: #fff; }
.pager .off { color: var(--muted-2); }

/* ---------------- 文章页 ---------------- */

.article {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px 30px;
}

.article-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }

.article-head .a-cat {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.article-head h1 {
  font-size: 25px;
  line-height: 1.45;
  letter-spacing: -.015em;
  margin-bottom: 12px;
}

.article-head .a-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted-2);
}

.article-head .a-meta .sep { width: 1px; height: 12px; background: var(--line); }

.article-head .a-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.article-head .a-tags a {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
}

.article-head .a-tags a:hover { color: var(--accent); background: var(--accent-soft); }

/* 正文排版 */
.prose { font-size: 15.5px; line-height: 1.9; color: var(--text); word-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 20px;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.4;
}
.prose h3 { font-size: 17px; margin: 26px 0 10px; }
.prose h4 { font-size: 15.5px; margin: 22px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent); border-bottom: 1px solid rgba(59, 130, 246, .35); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; list-style: revert; }
.prose li { margin: 5px 0; }

.prose blockquote {
  margin: 18px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 4px 4px 0;
  color: var(--muted);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
}

.prose pre {
  margin: 18px 0;
  padding: 16px 18px;
  background: #2b2f38;
  color: #e6e8ec;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}

.prose pre code { background: none; color: inherit; padding: 0; font-size: 13px; }
.prose img { border-radius: 4px; margin: 18px auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg); font-weight: 600; color: var(--title); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

.a-foot {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.a-foot a {
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--muted);
  transition: color .16s, background .16s;
}

.a-foot a:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------------- 评论 ---------------- */

.comments {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 26px 24px;
}

.comments h2 {
  font-size: 15px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments h2::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.comments h2 span { color: var(--muted-2); font-weight: 400; font-size: 13px; }

.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: 0; }

.comment .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.comment .cm-body { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.cm-head b { font-size: 13.5px; color: var(--title); font-weight: 600; }
.cm-head time { font-size: 12px; color: var(--muted-2); }
.cm-text { font-size: 13.5px; line-height: 1.75; color: var(--text); white-space: pre-wrap; }
.comment.reply { margin-top: 10px; padding: 10px 0 0; border-top: 1px dashed var(--line); }
.comment.reply .avatar { width: 26px; height: 26px; font-size: 12px; }

.cm-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cm-form .row { display: flex; gap: 10px; margin-bottom: 10px; }

.cm-form input, .cm-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  font-family: inherit;
}

.cm-form input:focus, .cm-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.cm-form textarea { resize: vertical; min-height: 92px; }
.cm-form .between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.cm-form button {
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  transition: background .16s;
}

.cm-form button:hover { background: var(--accent-hover); }

.dim { color: var(--muted-2); font-size: 12.5px; }

/* ---------------- 归档 ---------------- */

.archive { padding: 20px 26px 24px; }
.archive .year + .year { margin-top: 22px; }

.archive .year-title {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.archive .year-title span {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 400;
}

.archive li { display: flex; align-items: baseline; gap: 14px; padding: 7px 0; }
.archive li + li { border-top: 1px dashed var(--line); }
.archive time { font-size: 12.5px; color: var(--muted-2); flex: 0 0 84px; font-variant-numeric: tabular-nums; }
.archive li a { font-size: 14px; flex: 1; min-width: 0; }
.archive li a:hover { color: var(--accent); }

/* ---------------- 空状态 / 404 ---------------- */

.state {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 20px;
  text-align: center;
}

.state .code { font-size: 52px; font-weight: 700; color: var(--accent-soft); line-height: 1; margin-bottom: 10px; }
.state h1 { font-size: 19px; margin-bottom: 8px; }
.state p { color: var(--muted); font-size: 13.5px; }

.state .btn {
  display: inline-block;
  margin-top: 16px;
  padding: 7px 18px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}

/* ---------------- 页脚 ---------------- */

.site-foot {
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 24px 10px 20px;
  text-align: center;
}

.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.foot-links a { font-size: 13px; color: var(--muted); transition: color .16s; }
.foot-links a:hover { color: var(--accent); }

.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.badges a, .badges span {
  display: inline-flex;
  border-radius: 3px;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.badges b { padding: 4px 7px; background: #2f3440; color: #fff; font-weight: 400; }
.badges i { padding: 4px 7px; font-style: normal; color: #fff; }

.foot-copy { font-size: 12.5px; color: var(--muted-2); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  /* 竖排时改回 stretch，否则 main-col 会被 fit-content 撑到正文最宽处 */
  .layout { flex-direction: column; align-items: stretch; gap: 10px; }
  .side { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .side .pcard { width: 100%; }
  .side .scard { flex: 1 1 220px; }
  /* 手机上收起次要侧栏模块，避免文章列表被推到很下面 */
  .side .scard.aux { display: none; }
  .pcard .cover { height: 84px; }
  .pcard .avatar { width: 52px; height: 52px; top: 58px; font-size: 19px; left: 14px; }
  .pcard .body { padding: 30px 14px 12px; }
  .pcard .sign { -webkit-line-clamp: 2; }

  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 2px 16px 10px;
    box-shadow: var(--shadow);
    margin: 0;
  }
  .nav.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav.open a:last-child { border-bottom: 0; }
  .nav.open a.on::after { display: none; }
  .nav-toggle { display: grid; }
}

@media (max-width: 640px) {
  .navbar .inner { gap: 10px; }
  .brand { font-size: 16px; }
  .head-right .write span { display: none; }
  .head-right .write { padding: 0 11px; }
  .article { padding: 18px 16px 22px; }
  .article-head h1 { font-size: 20px; }
  .prose { font-size: 15px; }
  .comments, .archive { padding: 16px; }
  .post-head { padding: 10px 12px 9px; gap: 8px; }
  .post-head .pa { width: 28px; height: 28px; font-size: 12px; }
  .post > .post-title { padding: 12px 12px 0; font-size: 16.5px; }
  .post-cover { height: 150px; margin: 10px 12px 0; }
  .post-title.ov { font-size: 15.5px; left: 12px; right: 12px; bottom: 10px; }
  .post-body { padding: 8px 12px 0; }
  .post-foot { margin: 10px 12px 0; gap: 12px; }
  .cm-form .row { flex-direction: column; }
  .archive li { gap: 10px; }
  .archive time { flex: 0 0 74px; }
  .pager a, .pager span { min-width: 30px; height: 30px; padding: 0 8px; }
}

/* ---------------- 代码高亮（深色代码块，独立于页面主题） ---------------- */
.prose pre { position: relative; }
.prose pre code.hljs { background: transparent; padding: 0; color: #e6e8ec; }
.prose pre code .hljs-comment, .prose pre code .hljs-quote, .prose pre code .hljs-doctag { color: #8b949e; font-style: italic; }
.prose pre code .hljs-keyword, .prose pre code .hljs-selector-tag, .prose pre code .hljs-built_in, .prose pre code .hljs-name, .prose pre code .hljs-tag, .prose pre code .hljs-type { color: #ff7b72; }
.prose pre code .hljs-string, .prose pre code .hljs-attr, .prose pre code .hljs-char, .prose pre code .hljs-regexp, .prose pre code .hljs-addition { color: #a5d6ff; }
.prose pre code .hljs-number, .prose pre code .hljs-literal, .prose pre code .hljs-variable, .prose pre code .hljs-symbol, .prose pre code .hljs-meta { color: #79c0ff; }
.prose pre code .hljs-title, .prose pre code .hljs-title.function_, .prose pre code .hljs-section, .prose pre code .hljs-class .hljs-title { color: #d2a8ff; }
.prose pre code .hljs-built_in, .prose pre code .hljs-params { color: #ffa657; }
.prose pre code .hljs-deletion { color: #ffdcd7; }
.prose pre code .hljs-emphasis { font-style: italic; }
.prose pre code .hljs-strong { font-weight: 700; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  color: #c9d1d9; font-size: 12px; line-height: 1; padding: 4px 9px; border-radius: 5px;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,.14); }

/* ---------------- 文章目录 ---------------- */
.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 22px; box-shadow: var(--shadow);
}
.toc-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--title); letter-spacing: .04em; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { line-height: 1.5; }
.toc li.lvl-2 a { padding-left: 0; }
.toc li.lvl-3 a { padding-left: 16px; font-size: 13px; }
.toc a { display: block; padding: 4px 6px; border-radius: 5px; color: var(--muted); font-size: 13.5px; transition: background .15s, color .15s; }
.toc a:hover { background: var(--accent-soft); color: var(--accent); }
.toc a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------------- 阅读进度条 ---------------- */
.readbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 120;
  background: linear-gradient(90deg, var(--accent), #93c5fd); transition: width .08s linear;
}

/* ---------------- 图片灯箱 ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
  background: rgba(15,17,21,.82); padding: 32px; cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* ---------------- 相关文章 ---------------- */
.related { margin-top: 26px; }
.related h2 { font-size: 17px; color: var(--title); margin: 0 0 12px; padding-left: 11px; position: relative; }
.related h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 2px; background: var(--accent); }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: box-shadow .18s, transform .18s; }
.related li:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.related a { display: block; color: var(--title); font-size: 14.5px; font-weight: 600; line-height: 1.5; margin-bottom: 4px; }
.related a:hover { color: var(--accent); }
.related .r-meta { font-size: 12px; color: var(--muted-2); }
@media (max-width: 640px){ .related ul { grid-template-columns: 1fr; } }

/* ---------------- 点赞按钮 ---------------- */
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 7px 16px; border-radius: 20px; font-size: 13.5px; cursor: pointer; transition: all .18s;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.like-btn .icon { width: 16px; height: 16px; }
.a-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.a-foot-links { display: flex; gap: 14px; }
.a-foot-links a { color: var(--muted); font-size: 13.5px; }
.a-foot-links a:hover { color: var(--accent); }

/* ---------------- 友情链接 ---------------- */
.links-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 4px; }
.lcard {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.lcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); border-color: var(--accent); }
.l-logo {
  width: 42px; height: 42px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
}
.l-logo img { width: 100%; height: 100%; object-fit: cover; }
.l-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l-body b { font-size: 14.5px; color: var(--title); }
.l-body span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px){ .links-grid { grid-template-columns: 1fr; } }

/* ---------------- 面包屑 ---------------- */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb i { color: var(--muted-2); font-style: normal; }
.breadcrumb span { color: var(--text); }

/* ---------------- 分享 ---------------- */
.share { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.share-lbl { font-size: 12.5px; color: var(--muted); }
.share-btn {
  font-size: 12.5px; padding: 5px 11px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  cursor: pointer; transition: color .16s, background .16s, border-color .16s;
}
.share-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------------- 作者卡片 / 版权 ---------------- */
.author-card {
  display: flex; align-items: center; gap: 14px; margin-top: 26px;
  padding: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.author-card .ac-avatar {
  width: 54px; height: 54px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.author-card .ac-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card .ac-body { min-width: 0; }
.author-card .ac-body b { font-size: 15px; color: var(--title); }
.author-card .ac-body p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.copyright {
  margin: 14px 0 0; font-size: 12.5px; color: var(--muted-2);
  padding: 10px 14px; background: var(--bg); border-radius: var(--radius);
  border: 1px dashed var(--line);
}
.copyright b { color: var(--text); }

/* ---------------- 上/下篇导航 ---------------- */
.post-nav { display: flex; gap: 14px; margin-top: 18px; }
.post-nav .pn {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .18s, transform .18s;
}
.post-nav .pn:hover { border-color: var(--accent); transform: translateY(-1px); }
.post-nav .pn.next { text-align: right; align-items: flex-end; }
.post-nav .pn span { font-size: 12px; color: var(--muted-2); }
.post-nav .pn b {
  font-size: 14px; color: var(--title); font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------------- 悬浮栏 ---------------- */
.floatbar { position: fixed; right: 18px; bottom: 22px; z-index: 110; display: flex; flex-direction: column; gap: 10px; }
.fb-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: color .16s, background .16s, transform .16s;
}
.fb-btn:hover { color: #fff; background: var(--accent); transform: translateY(-2px); }
.fb-btn .icon { width: 20px; height: 20px; }
/* ---------------- 评论：排序 / 点赞 / 神评论 ---------------- */
.cm-sortbar { margin-left: auto; display: inline-flex; gap: 4px; }
.cm-sort { font-size: 12px; padding: 3px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; transition: all .16s; }
.cm-sort.on, .cm-sort:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.cm-like {
  margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 2px 4px; border-radius: 10px; transition: color .16s, background .16s;
}
.cm-like .icon { width: 14px; height: 14px; }
.cm-like:hover { color: var(--accent); background: var(--accent-soft); }
.cm-like.done { color: var(--accent); }
.cm-like-n { font-variant-numeric: tabular-nums; }
.hot-badge { margin-left: 6px; font-size: 11px; font-weight: 600; color: #e8590c; background: #fff1e6; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
html.dark .hot-badge { background: rgba(232,89,12,.18); }
