/* ============================================================
   个人博客 · 极简主题
   纯 CSS，无任何框架。通过 html[data-theme] 切换深浅色。
   ============================================================ */

@import url("fonts.css");

/* ---------- 1. 变量 ---------- */
:root {
  --bg: #f5f7fa;
  --bg-soft: #eceff4;
  --card: #ffffff;
  --border: #dfe4ec;
  --text: #1b2432;
  --text-2: #5c6675;
  --text-3: #9aa4b2;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --code-bg: #edf0f5;
  --mark: rgba(56, 189, 248, 0.4);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.1);
  --serif: "UKIJ Ekran", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "UKIJ Ekran", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI",
    system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  --radius: 14px;
  --container: 1080px;
  --narrow: 720px;
  --header-h: 64px;
}

html[data-theme="dark"] {
  --bg: #16161a;
  --bg-soft: #1d1d22;
  --card: #1e1e24;
  --border: #2b2b33;
  --text: #e9e7e3;
  --text-2: #a19c94;
  --text-3: #6f6a63;
  --accent: #7c96ff;
  --accent-soft: rgba(124, 150, 255, 0.1);
  --code-bg: #26262d;
  --mark: rgba(214, 158, 46, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection {
  background: var(--mark);
}

/* ---------- 3. 布局 ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 48px 0 80px;
}

/* .container/.narrow 的 padding:0 24px 优先级更高会覆盖 main 的上下内边距，这里补回来 */
main.container,
main.narrow {
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  direction: rtl;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: 8px;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

/* 桌面端精简导航：留言/关于 收进页脚和移动端菜单，避免 iPad 上拥挤 */
@media (min-width: 769px) {
  .nav-links .nav-extra { display: none; }
}

/* 中屏（iPad 等）收紧导航间距 */
@media (min-width: 769px) and (max-width: 1100px) {
  .header-inner { gap: 8px; }
  .logo { font-size: 18px; }
  .nav-links a { padding: 8px 10px; font-size: 14px; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
  transform: rotate(12deg);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* 深浅色图标切换 */
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* 移动端汉堡按钮 */
.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  position: relative;
}

.menu-btn span {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.menu-btn span:nth-child(1) { top: 13px; }
.menu-btn span:nth-child(2) { top: 21px; }

.menu-btn.open span:nth-child(1) {
  top: 17px;
  transform: rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
  top: 17px;
  transform: rotate(-45deg);
}

/* ---------- 5. 首页 Hero ---------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
  direction: rtl;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 17px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  direction: rtl;
}

.hero-line {
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  margin: 28px auto 0;
}

/* ---------- 6. 区块标题 ---------- */
.section {
  padding: 32px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  direction: rtl;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head h2::before {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.section-head .more {
  font-size: 14px;
  color: var(--text-2);
}

.section-head .more:hover {
  color: var(--accent);
}

/* ---------- 7. 文章卡片列表 ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
}

.post-card {
  display: block;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s ease;
}

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

.post-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.post-card-top .badge {
  font-size: 12px;
  position: relative;
  z-index: 2;
}

.post-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}

.post-card:hover h3 {
  color: var(--accent);
}

/* 卡片内"整卡可点"的主链接：伪元素铺满卡片，标签链接层级更高可独立点击 */
.post-card .card-link::after,
.res-card .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card .tags,
.res-card .tags {
  position: relative;
  z-index: 2;
}

.res-card .res-link {
  position: relative;
  z-index: 2;
}

.post-card .excerpt {
  color: var(--text-2);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 8. 标签 / 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.badge.diary {
  background: rgba(16, 152, 122, 0.1);
  color: #0f9271;
}

.badge.note {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.badge.res {
  background: rgba(199, 106, 32, 0.1);
  color: #c76a20;
}

.badge.other {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

html[data-theme="dark"] .badge.diary { color: #3ec9a5; }
html[data-theme="dark"] .badge.note { color: #8fa4ff; }
html[data-theme="dark"] .badge.res { color: #e8a05c; }
html[data-theme="dark"] .badge.other { color: #a78bfa; }

/* ---------- 帖子（朋友圈风格信息流） ---------- */
.moment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
}

.moment-card {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.moment-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  user-select: none;
}

.moment-body { flex: 1; min-width: 0; }

.moment-author {
  font-weight: 600;
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 6px;
}

.moment-content {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
}

.moment-time {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.moment-more,
.moment-end {
  text-align: center;
  padding: 22px 0 8px;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ---------- 首页名言 ---------- */
.quote-section { padding-top: 8px; }

.quote-card {
  position: relative;
  text-align: center;
  padding: 46px 32px 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quote-mark {
  position: absolute;
  top: 8px;
  left: 24px;
  font-family: var(--serif);
  font-size: 72px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.16;
  user-select: none;
}

.quote-card p {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.9;
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  direction: rtl;
}

.quote-card cite {
  display: block;
  margin-top: 14px;
  font-style: normal;
  font-size: 13.5px;
  color: var(--text-3);
}

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

.tag {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag:hover,
.tag.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 9. 筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  direction: rtl;
}

/* ---------- 搜索 ---------- */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.search-form .input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-form .btn {
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.search-form .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.search-form .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.search-form .btn.primary:hover {
  filter: brightness(1.08);
}
.search-stats {
  color: var(--text-2);
  font-size: 14px;
  margin: 4px 0 8px;
  direction: rtl;
}
.search-stats b {
  color: var(--accent);
}
mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------- 留言板 ---------- */
.gb-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  direction: rtl;
}
.gb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gb-field { margin-bottom: 18px; }
.gb-field label {
  display: block;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 7px;
}
.gb-field .input,
.gb-field .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gb-field .input:focus,
.gb-field .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gb-field .textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
}
.gb-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.gb-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.gb-actions .btn {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.gb-actions .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gb-actions .btn.primary:hover { filter: brightness(1.08); }
.gb-msg { font-size: 14px; }
.gb-msg.ok { color: #0f9271; }
.gb-msg.err { color: var(--danger, #d64545); }

/* 留言列表 */
.gb-list {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gb-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  gap: 14px;
}

.gb-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.gb-body { flex: 1; min-width: 0; }

.gb-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.gb-name {
  font-weight: 600;
  font-size: 15px;
}

.gb-time {
  font-size: 12.5px;
  color: var(--text-3);
}

.gb-content {
  font-size: 15px;
  line-height: 1.8;
  color: color-mix(in srgb, var(--text) 92%, var(--text-2));
  word-break: break-word;
}

@media (max-width: 600px) { .gb-row { grid-template-columns: 1fr; } }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 0 8px;
  flex-wrap: wrap;
}
.pagination .pg-btn,
.pagination .pg-num {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  transition: background .2s, border-color .2s, color .2s;
  cursor: pointer;
}
.pagination .pg-btn:hover,
.pagination .pg-num:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pagination .pg-btn.disabled,
.pagination .pg-num.current {
  cursor: default;
  pointer-events: none;
}
.pagination .pg-num.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pagination .pg-btn.disabled {
  color: var(--text-3);
  background: var(--bg-soft);
  border-color: var(--border);
}
.pagination .pg-dots {
  color: var(--text-3);
  font-size: 14px;
  padding: 6px 4px;
  user-select: none;
}

/* ---------- 10. 资源卡片网格 ---------- */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  direction: rtl;
}

.res-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s ease;
}

.res-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.res-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.res-card h3 {
  font-family: var(--serif);
  font-size: 17.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.res-card .desc {
  color: var(--text-2);
  font-size: 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-card .res-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
}

.res-card .res-link {
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.res-card .res-link:hover {
  text-decoration: underline;
}

/* ---------- 11. 页面标题 ---------- */
.page-title {
  padding: 16px 0 36px;
  text-align: center;
  direction: rtl;
}

.page-title h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
}

.page-title p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15.5px;
}

/* ---------- 12. 文章详情 ---------- */
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px 32px;
  direction: rtl;
}

/* 清除富文本里浮动图片/段落的溢出，防止卡片高度塌陷 */
.article-card::after {
  content: "";
  display: block;
  clear: both;
}

.article-content {
  overflow-wrap: break-word;
}

.article-card .article-header {
  padding: 0 0 26px;
}

.article-header {
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.4;
}

.article-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text-3);
}

.article-meta .dot::before {
  content: "";
  margin-right: 14px;
}

.article-content {
  font-size: 16.5px;
  line-height: 1.9;
}

.article-content h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 40px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
  line-height: 1.4;
}

.article-content h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 32px 0 12px;
}

.article-content p {
  margin: 14px 0;
  color: color-mix(in srgb, var(--text) 92%, var(--text-2));
}

.article-content ul,
.article-content ol {
  margin: 14px 0;
  padding-left: 26px;
}

.article-content li {
  margin: 6px 0;
}

.article-content blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  background: var(--bg-soft);
  border-right: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--text-2);
  font-style: normal;
}

.article-content code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 6px;
}

.article-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.7;
  direction: ltr;
    padding: 5px !important;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: 14px;
}

/* highlight.js · atom-one-dark：代码块底色与高亮主题统一 */
.article-content pre {
  background: #282c34;
  border-color: #282c34;
}
.article-content pre code.hljs,
.article-content pre.hljs {
  background: transparent;
  padding: 0;
}

.article-content img {
  border-radius: 12px;
  margin: 20px auto;
  max-width: 100%;
  height: auto;
}

.article-content video {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px auto;
  display: block;
  background: #000;
}

/* 富文本编辑器产出的表格 */
.article-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0;
  font-size: 15px;
}

.article-content th,
.article-content td {
  border: 1px solid var(--border);
  padding: 9px 14px;
  text-align: left;
}

.article-content th {
  background: var(--bg-soft);
  font-weight: 600;
}

.article-content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 36px 0;
}

.article-content a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.article-content a:hover {
  border-bottom-color: var(--accent);
}

/* 文内标签 & 上下篇 */
.article-tags {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.post-nav {
  margin-top: 36px;
  clear: both;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.post-nav a {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.post-nav a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.post-nav .label {
  font-size: 12.5px;
  color: var(--text-3);
  display: block;
  margin-bottom: 6px;
}

.post-nav .title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav .next {
  text-align: right;
}

/* ---------- 13. 关于页 ---------- */
.about-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 20px;
  direction: rtl;
}

.about-block h2 {
  font-family: var(--serif);
  font-size: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-block p {
  color: var(--text-2);
  font-size: 15px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- 14. 空状态 ---------- */
.empty {
  text-align: center;
  padding: 64px 0;
  color: var(--text-3);
}

.empty .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* ---------- 15. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

.site-footer .footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-2);
  direction: rtl;
}

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

/* ---------- 16. 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 99;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 17. 入场动画 ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.5s ease both;
}

.fade-up:nth-child(2) { animation-delay: 0.06s; }
.fade-up:nth-child(3) { animation-delay: 0.12s; }
.fade-up:nth-child(4) { animation-delay: 0.18s; }
.fade-up:nth-child(5) { animation-delay: 0.24s; }
.fade-up:nth-child(6) { animation-delay: 0.3s; }

/* ---------- 18. 响应式 ---------- */
@media (max-width: 768px) {
  :root {
    --header-h: 58px;
  }

  /* 小屏两边留一点距离 */
  .container,
  .narrow,
  .header-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .menu-btn {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }

  .nav-links.open {
    display: flex;
    animation: fadeUp 0.25s ease both;
  }

  .nav-links a {
    padding: 12px 14px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  main {
    padding: 32px 0 60px;
  }

  .post-card {
    padding: 18px 20px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav .next {
    text-align: left;
  }

  .article-card {
    padding: 20px 18px 24px;
    border-radius: 12px;
  }

  .article-header {
    margin-bottom: 22px;
  }

  .article-content {
    font-size: 16px;
    line-height: 1.85;
  }

  .article-content h2 {
    font-size: 20px;
    margin: 28px 0 12px;
    padding-left: 10px;
  }

  .article-content h3 {
    font-size: 18px;
    margin: 22px 0 10px;
  }

  .article-content pre {
    padding: 14px 16px;
    border-radius: 10px;
  }

  .article-content img,
  .article-content video {
    border-radius: 10px;
    margin: 14px 0;
  }

  .article-tags {
    margin-top: 28px;
    padding-top: 18px;
  }

  .back-top {
    right: 16px;
    bottom: 16px;
  }
}
