/* Snowline - Z-BlogPHP theme
   version 1.0.1 */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --text: #1c1b1a;
  --text-2: #57534e;
  --text-3: #8f8a84;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --accent: #0f7a5f;
  --accent-soft: #e6f4ef;
  --accent-text: #0b5f4a;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 12px rgba(28, 25, 23, .04);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --header-h: 60px;
}

html[data-theme="dark"] {
  --bg: #16171a;
  --surface: #1d1f23;
  --surface-2: #23262b;
  --text: #e8e6e3;
  --text-2: #a8a29e;
  --text-3: #78716c;
  --border: #2c2f34;
  --border-strong: #3a3e44;
  --accent: #35b78c;
  --accent-soft: #17302a;
  --accent-text: #5fd0a8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }

::selection { background: var(--accent); color: #fff; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}

.logo span { color: var(--accent); }

.header-panel {
  order: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.main-nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }

/* Z-BlogPHP 内置 navbar 模块输出的是没有 ul 包裹的裸 <li>，必须显式清掉标记 */
.main-nav ul,
.main-nav li { list-style: none; margin: 0; padding: 0; }

.main-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

.main-nav a:hover { background: var(--surface-2); color: var(--text); }

.main-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.header-tools { order: 3; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  transition: color .18s ease, border-color .18s ease;
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }

html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

.search-box {
  flex: none;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-3);
  transition: border-color .18s ease;
}

.search-box:focus-within { border-color: var(--accent); }
.search-box input { width: 120px; border: 0; background: none; outline: none; font-family: inherit; font-size: 14px; color: var(--text); }
.search-box input::placeholder { color: var(--text-3); }
.search-box > svg { flex: none; }
.search-box button { border: 0; background: none; padding: 0; color: var(--text-3); font-family: inherit; font-size: 13px; }
.search-box button:hover { color: var(--accent); }

/* 汉堡按钮（仅窄屏出现） */
.nav-toggle { display: none; }
.nav-toggle svg { width: 17px; height: 17px; }
.icon-close { display: none; }
.nav-toggle.is-open .icon-menu { display: none; }
.nav-toggle.is-open .icon-close { display: block; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
  padding: 36px 0 60px;
  align-items: start;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14.5px;
  color: var(--text-2);
}

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

.archive-head {
  padding: 0 4px 14px;
  font-size: 14px;
  color: var(--text-3);
}

.archive-head b { color: var(--text); font-size: 17px; font-weight: 600; }
.archive-head span { margin-left: 6px; }

/* ---------- post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-card.is-top { border-color: var(--accent); background: var(--accent-soft); }

.post-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .2px;
}

.post-card h2 a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .3s ease, color .18s ease;
}

.post-card:hover h2 a { color: var(--accent); background-size: 100% 1.5px; }

.post-card .excerpt {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-3);
}

.post-meta .cat {
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12.5px;
}

.post-meta .cat:hover { background: var(--accent); color: #fff; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

.tag-pin {
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11.5px;
  line-height: 17px;
}

.empty-tip {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- pagination ---------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pager a, .pager span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface);
  transition: all .18s ease;
}

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

/* ---------- sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.widget-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* 模块输出的基础列表
   注意：Z-BlogPHP 内置模块输出的是没有 ul 包裹的裸 <li>，继承 UA 默认 disc 标记，必须逐个清 */
.widget ul,
.widget li { list-style: none; margin: 0; padding: 0; }
.widget > li { padding: 7px 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.widget li a:hover { color: var(--accent); }
.widget table { width: 100%; font-size: 13px; text-align: center; border-collapse: collapse; }
.widget table td, .widget table th { padding: 4px; font-weight: 400; }

/* --- 站点信息 --- */
#divStatistics > li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
#divStatistics > li:last-child { border-bottom: 0; padding-bottom: 0; }

/* --- 网站分类 / 归档 / 友情链接 --- */
#divCatalog > li > a,
#divArchives > li > a { display: block; padding: 8px 0; border-bottom: 1px dashed var(--border); }
#divCatalog > li:last-child > a,
#divArchives > li:last-child > a { border-bottom: 0; }

/* --- 标签云 --- */
#divTags > li { display: inline-block; padding: 0; margin: 0 6px 6px 0; }
#divTags li a {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-2);
}
#divTags li a:hover { border-color: var(--accent); color: var(--accent); }

/* 最新留言的正式样式见下方「最新留言」段（由 app.js 重排后生效） */
.widget input[type="text"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.hot-list { list-style: none; counter-reset: hot; }

.hot-list li {
  counter-increment: hot;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14.5px;
  line-height: 1.6;
}

.hot-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.hot-list li:first-child { padding-top: 0; }

.hot-list li::before {
  content: counter(hot);
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
  display: grid;
  place-items: center;
}

.hot-list li:nth-child(-n+3)::before { background: var(--accent); color: #fff; }
.hot-list a { transition: color .18s ease; }
.hot-list a:hover { color: var(--accent); }
.hot-list small { display: block; color: var(--text-3); font-size: 12px; }

/* ---------- 最新留言 ----------
   系统模块输出的是 <li><a title="作者 @ 时间">内容</a></li>，
   由 app.js 重排成「头像 + 名字 + 日期 + 内容」 */
.msg-list { list-style: none; }

.msg-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}

.msg-item:first-child { padding-top: 0; }
.msg-item:last-child { border-bottom: 0; padding-bottom: 0; }

.msg-item .avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  user-select: none;
}

.msg-body { flex: 1; min-width: 0; }
.msg-body .who { font-size: 12.5px; color: var(--text-3); }
.msg-body .who b { color: var(--text); font-weight: 500; }

.msg-text {
  margin: 2px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-item:hover .msg-text { color: var(--text); }
.msg-link { position: absolute; inset: 0; }

/* JS 未执行时的兜底：单行省略，别让长评论把侧栏撑爆 */
#divComments > li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 日历 ----------
   系统输出：有文章的日子是 <a href="/date-2026-9-5.html" title="2026-9-5 (1)">5</a>，
   没文章的日子是纯数字文本。所以「高亮 + 可点击」只需要给 td a 上样式就够了。 */
#divCalendar table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  text-align: center;
}

#divCalendar caption {
  padding-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

#divCalendar caption a { color: var(--text); }
#divCalendar caption a:hover { color: var(--accent); }

/* 上/下月箭头（这两个带 title） */
#divCalendar caption a[title] {
  padding: 0 4px;
  font-weight: 400;
  color: var(--text-3);
}

#divCalendar th {
  padding: 2px 0 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}

#divCalendar td {
  height: 30px;
  padding: 0;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

#divCalendar td a {
  display: block;
  height: 30px;
  line-height: 30px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}

#divCalendar td a:hover {
  background: var(--accent);
  color: #fff;
}

#divCalendar td.is-today {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

/* ---------- TOC ---------- */
.toc-list { list-style: none; font-size: 14px; }
.toc-list a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--border);
  color: var(--text-2);
  line-height: 1.5;
  transition: all .18s ease;
}

.toc-list a:hover { color: var(--accent); }
.toc-list a.active { border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
.toc-list .lv3 a { padding-left: 26px; font-size: 13.5px; }

/* ---------- article ---------- */
.article-head { margin-bottom: 28px; }

.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.crumbs a:hover { color: var(--accent); }

.article-head h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .5px;
}

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.article-tags a {
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}

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

.article-content {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--text);
  word-wrap: break-word;
}

.article-content p { margin: 0 0 1.25em; }

.article-content h2,
.article-content h3 {
  margin: 2em 0 1em;
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.article-content h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 18px; }

.article-content a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.article-content a:hover { border-bottom-style: solid; }

.article-content blockquote {
  margin: 1.5em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}

.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin: 0 0 1.25em; }
.article-content li { margin-bottom: .4em; }

.article-content img { border-radius: var(--radius-sm); margin: 1.5em auto; cursor: zoom-in; }

.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 12px; }
.article-content th { background: var(--surface-2); }

.article-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent-text);
}

.article-content pre {
  margin: 1.5em 0;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.7;
  position: relative;
}

.article-content pre code { background: none; padding: 0; font-size: 14px; color: var(--text); }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-3);
  opacity: 0;
  transition: opacity .18s ease, color .18s ease;
}

pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.license {
  margin: 36px 0 0;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-3);
  background: var(--surface);
}

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }

.post-nav a {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text-2);
  transition: all .18s ease;
}

.post-nav a:hover { border-color: var(--accent); color: var(--accent); }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }

.related { margin-top: 32px; }

.related ul { list-style: none; }

.related li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14.5px;
}

.related li:last-child { border-bottom: 0; }
.related li a:hover { color: var(--accent); }
.related .count { float: right; color: var(--text-3); font-size: 12.5px; }

/* ---------- comments ---------- */
.comments {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.comments h3 { margin: 0 0 18px; font-size: 17px; font-weight: 600; }
.comments h3 span { color: var(--text-3); font-weight: 400; font-size: 14px; margin-left: 6px; }

.cmt-list { list-style: none; }

.cmt-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.cmt-list > .cmt-item:first-child { border-top: 0; padding-top: 0; }

.cmt-item .avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cmt-head b { font-weight: 600; font-size: 15px; }
.cmt-head time { color: var(--text-3); font-size: 12.5px; }
.cmt-head .reply { margin-left: auto; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.cmt-head .reply:hover { color: var(--accent); }
.cmt-body p { margin: 4px 0 0; font-size: 15px; color: var(--text-2); line-height: 1.75; word-wrap: break-word; }
.cmt-body p img { max-width: 100%; }

.cmt-children {
  list-style: none;
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.cmt-children .cmt-item { padding: 10px 0; border-top: 1px dashed var(--border); }
.cmt-children .cmt-item:first-child { padding-top: 0; border-top: 0; }
.cmt-children .avatar { width: 30px; height: 30px; }

.cmt-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.cmt-form h4 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

/* 提交结果提示：系统默认链路出错时是完全静默的，由主题补上反馈 */
.cmt-msg {
  display: none;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
}

.cmt-msg.show { display: block; }
.cmt-msg.is-err { background: #fdecea; border-color: #f3c4bd; color: #a3281e; }
.cmt-msg.is-ok { background: #e7f5ef; border-color: #bfe3d5; color: #0d6b52; }

html[data-theme="dark"] .cmt-msg.is-err {
  background: rgba(217, 90, 80, .14);
  border-color: rgba(217, 90, 80, .3);
  color: #ff9d92;
}

html[data-theme="dark"] .cmt-msg.is-ok {
  background: rgba(53, 183, 140, .14);
  border-color: rgba(53, 183, 140, .3);
  color: #4fd0a7;
}

.cmt-form .submit[disabled] { opacity: .65; cursor: not-allowed; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }

.cmt-form input, .cmt-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color .18s ease, background-color .18s ease;
}

.cmt-form input:focus, .cmt-form textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.cmt-form textarea { min-height: 96px; resize: vertical; margin-bottom: 10px; }

.verify-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.verify-row input { flex: 1; }

.verify-row img {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}

.cmt-form .submit {
  padding: 9px 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  transition: opacity .18s ease;
}

.cmt-form .submit:hover { opacity: .88; }
.cmt-form .hint { margin-left: 12px; font-size: 13px; color: var(--text-3); }

/* ---------- 友情链接（页脚上方通栏） ---------- */
.linker {
  margin-top: 44px;
  padding: 22px 0 6px;
  border-top: 1px solid var(--border);
}

.linker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
}

.linker-head strong { font-weight: 600; color: var(--text); }
.linker-rss { font-size: 13px; color: var(--text-3); }
.linker-rss:hover { color: var(--accent); }

/* 模块可能输出裸 <li>，也可能带 <ul> 包裹，两种都要能横排 */
.linker-list { display: flex; flex-wrap: wrap; gap: 10px; }

.linker-list > ul,
.linker-list > ol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.linker-list li { list-style: none; margin: 0; padding: 0; }

.linker-list a {
  display: inline-block;
  padding: 4px 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-2);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.linker-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  font-size: 13.5px;
  color: var(--text-3);
}

.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer a:hover { color: var(--accent); }
.friend-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.site-footer p { margin: 0; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, color .18s ease;
  z-index: 50;
}

.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, .92);
  display: grid;
  place-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  cursor: zoom-out;
}

.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 24px; }
.notfound .code { font-size: 64px; font-weight: 600; color: var(--accent); line-height: 1; }
.notfound p { color: var(--text-2); }

/* ---------- hljs ---------- */
.hljs-comment, .hljs-quote { color: var(--text-3); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #a855f7; }
.hljs-string, .hljs-attr { color: #0a7c5a; }
.hljs-number, .hljs-symbol { color: #d97706; }
.hljs-title, .hljs-name { color: #2563eb; }
.hljs-type, .hljs-built_in { color: #0891b2; }
.hljs-meta { color: var(--text-3); }

html[data-theme="dark"] .hljs-keyword,
html[data-theme="dark"] .hljs-selector-tag,
html[data-theme="dark"] .hljs-literal { color: #c792ea; }
html[data-theme="dark"] .hljs-string,
html[data-theme="dark"] .hljs-attr { color: #7ee2b8; }
html[data-theme="dark"] .hljs-number,
html[data-theme="dark"] .hljs-symbol { color: #f59e0b; }
html[data-theme="dark"] .hljs-title,
html[data-theme="dark"] .hljs-name { color: #82aaff; }
html[data-theme="dark"] .hljs-type,
html[data-theme="dark"] .hljs-built_in { color: #5ad1e6; }

/* ---------- responsive ---------- */

/* 窄屏：导航折叠成汉堡下拉面板 */
@media (max-width: 880px) {
  .site-header .container { gap: 12px; }
  .nav-toggle { display: grid; }

  .header-panel {
    order: 3;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height .26s ease;
  }

  .header-panel.open { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }

  .main-nav { overflow: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
  .nav-list li { width: 100%; }

  .main-nav a {
    padding: 12px 2px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 15.5px;
    white-space: normal;
  }
  .main-nav a.is-active {
    background: none;
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .nav-list li:last-child a { border-bottom: 0; }

  .search-box { margin: 14px 0 18px; }
  .search-box input { flex: 1; width: auto; }
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
  .sidebar { position: static; }
}

@media (max-width: 640px) {
  .header-panel { padding: 0 16px; }
  .post-card { padding: 18px 16px; }
  .post-card h2 { font-size: 17.5px; }
  .field-row { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
  .comments { padding: 18px 16px; }
  .to-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
