/* =========================================================
   像素志 PIXEL LOG — 像素风博客设计系统
   参考子比(Zibll)布局 · 8-bit 复古 UI
   ========================================================= */

/* --- 字体 --- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* 中文像素字体（渐进增强，加载失败自动回退系统字体） */
@font-face {
  font-family: 'Zpix';
  src: url('https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font@v3.1.9/dist/Zpix.woff2') format('woff2');
  font-display: swap;
}

:root {
  /* 亮色主题色板 */
  --bg:        #f4efe1;
  --bg-grid:   rgba(0,0,0,0.04);
  --surface:   #ffffff;
  --surface-2: #fbf7ec;
  --ink:       #1d1b2e;          /* 主描边/文字 */
  --ink-soft:  #5a5670;
  --primary:   #4a7cff;          /* 主色 蓝 */
  --primary-d: #2f5be0;
  --accent:    #ff5a5f;          /* 强调 红 */
  --gold:      #ffd23f;          /* 金 */
  --green:     #2ecc71;
  --shadow:    #1d1b2e;          /* 硬阴影色 */
  --line:      #1d1b2e;

  --font-pixel: 'Press Start 2P', 'Zpix', 'Courier New', monospace;
  --font-body:  'Zpix', 'PingFang SC', 'Microsoft YaHei', 'Courier New', monospace;

  --bd: 3px;                /* 标准边框粗细 */
  --sp: 4px;                /* 像素阴影偏移 */
  --radius: 0px;            /* 像素风：零圆角 */
  --maxw: 1180px;
}

[data-theme="dark"] {
  --bg:        #161427;
  --bg-grid:   rgba(255,255,255,0.05);
  --surface:   #211d3a;
  --surface-2: #1a1730;
  --ink:       #ece9ff;
  --ink-soft:  #a39fc4;
  --primary:   #6c8cff;
  --primary-d: #4a7cff;
  --accent:    #ff6b70;
  --gold:      #ffd23f;
  --green:     #36d27e;
  --shadow:    #000000;
  --line:      #ece9ff;
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  line-height: 1.9;
  font-size: 15px;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  transition: background-color .2s, color .2s;
}

img, svg { image-rendering: pixelated; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

::selection { background: var(--gold); color: var(--ink); }

/* --- 布局容器 --- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* --- 像素通用组件 --- */
.pixel-box {
  background: var(--surface);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
  background: var(--surface);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
  padding: 10px 14px;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform .06s, box-shadow .06s;
  user-select: none;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: calc(var(--sp) + 1px) calc(var(--sp) + 1px) 0 var(--shadow); }
.btn:active { transform: translate(var(--sp), var(--sp)); box-shadow: 0 0 0 var(--shadow); }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--ink); }
.btn--accent  { background: var(--accent);  color: #fff; border-color: var(--ink); }
.btn--gold    { background: var(--gold); }

.tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 5px 8px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  color: var(--ink-soft);
  text-transform: uppercase;
}
.tag:hover { background: var(--gold); color: var(--ink); }

/* =========================================================
   顶部导航
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: var(--bd) solid var(--line);
  box-shadow: 0 var(--sp) 0 var(--shadow);
}
.navbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
}
.brand__mark {
  width: 34px; height: 34px;
  background: var(--primary);
  border: 3px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  grid-template-rows: repeat(4,1fr);
}
.brand__mark i { background: var(--gold); }
.brand__mark i:nth-child(1),
.brand__mark i:nth-child(4),
.brand__mark i:nth-child(6),
.brand__mark i:nth-child(7),
.brand__mark i:nth-child(10),
.brand__mark i:nth-child(11),
.brand__mark i:nth-child(13),
.brand__mark i:nth-child(16) { background: var(--surface); }
.brand__logo {
  height: 34px !important;
  width: auto !important;
  max-width: 140px !important;
  max-height: 34px !important;
  image-rendering: pixelated;
  border: 3px solid var(--ink);
  background: var(--surface-2);
  display: block;
  object-fit: contain;
  box-sizing: border-box;
}

/* --- 网站布局变体 --- */
[data-layout="wide"]    { --maxw: 1400px; }
[data-layout="compact"] { --maxw: 980px; }

/* --- 全局加载动画 --- */
.page-loading{
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .25s ease;
}
.page-loading.hide{ opacity: 0; pointer-events: none; }
.page-loading__box{ display: flex; gap: 7px; }
.page-loading__box span{
  width: 15px; height: 15px; background: var(--primary);
  image-rendering: pixelated;
  animation: plb 0.9s infinite ease-in-out;
}
.page-loading__box span:nth-child(2){ animation-delay: .15s; }
.page-loading__box span:nth-child(3){ animation-delay: .30s; }
@keyframes plb{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-14px); }
}

.nav__links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin-left: 8px;
}
.nav__links a {
  display: block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--ink);
  padding: 10px 12px;
  border: 2px solid transparent;
  text-transform: uppercase;
}
.nav__links a:hover,
.nav__links a.is-active {
  background: var(--gold);
  border-color: var(--ink);
}

.nav__tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: var(--bd) solid var(--line);
}
.search input {
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
  width: 150px;
  color: var(--ink);
  outline: none;
}
.search input::placeholder { color: var(--ink-soft); }
.search button {
  border: 0;
  border-left: var(--bd) solid var(--line);
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 10px;
}
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: var(--bd) solid var(--line);
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:active { transform: translate(2px,2px); }
.avatar-btn {
  width: 40px; height: 40px;
  border: var(--bd) solid var(--line);
  background: var(--green);
  cursor: pointer;
  padding: 0;
  image-rendering: pixelated;
  overflow: hidden;
}
.avatar-btn svg { width: 100%; height: 100%; display: block; }
.nav__toggle { display: none; }
/* 桌面端：导航面板=行内链接；移动端内容(.nav__mobile)默认隐藏 */
.nav__panel { display: flex; align-items: center; gap: 4px; }
.nav__mobile { display: none; }
.nav__backdrop { display: none; }

/* =========================================================
   公告条
   ========================================================= */
.announce {
  background: var(--gold);
  border-bottom: var(--bd) solid var(--line);
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 9px 0;
}
.announce .container { display: flex; align-items: center; gap: 10px; }
.announce b { color: var(--accent); }
.announce marquee, .announce__text { color: var(--ink); }

/* =========================================================
   首页主体（两栏）
   ========================================================= */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  padding: 26px 0 50px;
}
/* 允许网格子项收缩到内容之下，避免文章内宽图/表格把整页撑宽（移动端需缩放的根因） */
.layout > * { min-width: 0; }

.section-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 14px; height: 14px;
  background: var(--accent);
  border: 2px solid var(--ink);
}

/* 分类筛选标签 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 11px;
  background: var(--surface);
  border: var(--bd) solid var(--line);
  cursor: pointer;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.filter.is-active, .filter:hover { background: var(--primary); color: #fff; }

/* 文章卡片网格 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.post-card {
  background: var(--surface);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .08s;
  overflow: hidden;
}
.post-card:hover { transform: translate(-2px,-2px); box-shadow: calc(var(--sp)+2px) calc(var(--sp)+2px) 0 var(--shadow); }
.post-card__cover {
  position: relative;
  aspect-ratio: 16/9;
  border-bottom: var(--bd) solid var(--line);
  overflow: hidden;
}
.post-card__cover svg { width: 100%; height: 100%; display: block; }
.post-card__cat {
  position: absolute;
  top: 8px; left: 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 5px 7px;
  background: var(--ink);
  color: var(--gold);
  border: 2px solid var(--gold);
}
.post-card__body { padding: 13px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.post-card__title {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--ink);
}
.post-card__title a:hover { color: var(--primary); }
.post-card__excerpt { color: var(--ink-soft); font-size: 13px; line-height: 1.7; flex: 1; }
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px dashed var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}
.post-card__meta span { display: inline-flex; align-items: center; gap: 4px; }

/* =========================================================
   侧边栏
   ========================================================= */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar > * { min-width: 0; }
.sidebar img,
.sidebar video,
.sidebar iframe { max-width: 100%; height: auto; }
.widget {
  background: var(--surface);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
}
.widget__head {
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 11px 13px;
  background: var(--ink);
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget__body { padding: 14px 13px; }

/* 个人卡 */
.profile { text-align: center; }
.profile__avatar { width: 86px; height: 86px; margin: 4px auto 10px; border: var(--bd) solid var(--line); image-rendering: pixelated; }
.profile__avatar svg { width: 100%; height: 100%; display: block; }
.profile__name { font-family: var(--font-pixel); font-size: 12px; color: var(--ink); }
.profile__bio { font-size: 12px; color: var(--ink-soft); margin: 8px 0 12px; line-height: 1.7; }
.profile__stats { display: flex; justify-content: center; gap: 18px; margin-bottom: 12px; }
.profile__stats b { display: block; font-family: var(--font-pixel); font-size: 13px; color: var(--primary); }
.profile__stats small { font-size: 11px; color: var(--ink-soft); }

/* 热门文章 */
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li { counter-increment: hot; display: flex; gap: 10px; padding: 9px 0; border-bottom: 2px dashed var(--line); }
.hot-list li:last-child { border-bottom: 0; }
.hot-list li::before {
  content: counter(hot);
  font-family: var(--font-pixel);
  font-size: 12px;
  width: 24px; height: 24px;
  flex: 0 0 24px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--line);
  color: var(--accent);
}
.hot-list li:nth-child(1)::before { background: var(--gold); color: var(--ink); }
.hot-list a { font-size: 13px; line-height: 1.5; color: var(--ink); }
.hot-list a:hover { color: var(--primary); }
.hot-list .views { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* 标签云 */
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud .tag { cursor: pointer; }

/* 分类导航 */
.cat-list { list-style: none; }
.cat-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 2px dashed var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { color: var(--ink); font-size: 13px; }
.cat-list a:hover { color: var(--primary); }
.cat-list span { font-family: var(--font-pixel); font-size: 9px; color: var(--ink-soft); }

/* =========================================================
   文章详情页
   ========================================================= */
.crumb {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 18px 0 4px;
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
}
.crumb a { color: var(--primary); }
.crumb span { color: var(--ink); }

.post {
  background: var(--surface);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
  margin-bottom: 22px;
}
.post__hero { border-bottom: var(--bd) solid var(--line); aspect-ratio: 21/9; overflow: hidden; }
.post__hero svg { width: 100%; height: 100%; display: block; }
.post__inner { padding: 22px 26px 26px; }
.post__title { font-family: var(--font-pixel); font-size: 18px; line-height: 1.7; color: var(--ink); margin-bottom: 14px; }
.post__meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--ink-soft); padding-bottom: 16px; border-bottom: 2px dashed var(--line); }
.post__meta span { display: inline-flex; gap: 4px; align-items: center; }

.post__body { padding-top: 18px; font-size: 15px; line-height: 2; color: var(--ink); }
.post__body h2 { font-family: var(--font-pixel); font-size: 14px; margin: 26px 0 12px; padding-left: 12px; border-left: 8px solid var(--primary); }
.post__body h3 { font-size: 16px; margin: 20px 0 10px; font-weight: bold; }
.post__body p { margin: 12px 0; }
.post__body ul, .post__body ol { margin: 12px 0 12px 22px; }
.post__body li { margin: 6px 0; }
.post__body strong { color: var(--accent); }
.post__body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface-2);
  border-left: 8px solid var(--gold);
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  color: var(--ink-soft);
}
.post__body code {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  padding: 2px 6px;
  color: var(--accent);
}
.post__body pre {
  margin: 16px 0;
  padding: 16px;
  background: var(--ink);
  border: var(--bd) solid var(--line);
  overflow-x: auto;
}
.post__body pre code { background: none; border: 0; color: var(--green); font-size: 11px; line-height: 1.9; }

/* 文章正文响应式：图片/视频/表格/长链接不得撑破移动端视口 */
.post__body img,
.post__body video,
.post__body iframe { max-width: 100%; height: auto; }
.post__body table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.post__body td,
.post__body th { word-break: break-word; overflow-wrap: break-word; }
.post__body { overflow-wrap: break-word; word-wrap: break-word; }

/* 互动条 */
.post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 2px dashed var(--line);
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 11px 15px;
  background: var(--surface-2);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
  cursor: pointer;
  color: var(--ink);
  text-transform: uppercase;
}
.act-btn:active { transform: translate(var(--sp),var(--sp)); box-shadow: 0 0 0 var(--shadow); }
.act-btn.is-on { background: var(--accent); color: #fff; }
.act-btn .cnt { background: var(--ink); color: var(--gold); padding: 2px 6px; }

/* 作者卡 */
.author-card { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--surface-2); border: var(--bd) solid var(--line); }
.author-card img, .author-card svg { width: 64px; height: 64px; border: var(--bd) solid var(--line); image-rendering: pixelated; flex: 0 0 64px; }
.author-card h4 { font-family: var(--font-pixel); font-size: 12px; color: var(--ink); }
.author-card p { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* 评论区 */
.comments__head { font-family: var(--font-pixel); font-size: 13px; margin: 28px 0 16px; color: var(--ink); }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 2px dashed var(--line); }
.comment__avatar { width: 46px; height: 46px; flex: 0 0 46px; border: var(--bd) solid var(--line); image-rendering: pixelated; overflow: hidden; }
.comment__avatar svg { width: 100%; height: 100%; display: block; }
.comment__name { font-family: var(--font-pixel); font-size: 10px; color: var(--primary); }
.comment__time { font-size: 11px; color: var(--ink-soft); margin-left: 8px; }
.comment__text { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.7; }

.comment-form { margin-top: 18px; }
.comment-form textarea {
  width: 100%;
  min-height: 90px;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: var(--bd) solid var(--line);
  color: var(--ink);
  outline: none;
  resize: vertical;
}
.comment-form .row { display: flex; justify-content: flex-end; margin-top: 10px; }

/* 相关文章 */
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 14px; }
.related-card { border: var(--bd) solid var(--line); background: var(--surface); box-shadow: var(--sp) var(--sp) 0 var(--shadow); overflow: hidden; }
.related-card .cover { aspect-ratio: 16/9; border-bottom: var(--bd) solid var(--line); }
.related-card .cover svg { width: 100%; height: 100%; }
.related-card .t { padding: 10px 11px; font-size: 13px; font-weight: bold; line-height: 1.5; }
.related-card .t a { color: var(--ink); }
.related-card .t a:hover { color: var(--primary); }

/* =========================================================
   页脚
   ========================================================= */
.footer {
  background: var(--ink);
  color: var(--bg);
  border-top: var(--bd) solid var(--line);
  margin-top: 30px;
}
.footer .container { padding: 26px 16px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer__brand { font-family: var(--font-pixel); font-size: 13px; color: var(--gold); }
.footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__links a { color: var(--bg); font-size: 12px; }
.footer__links a:hover { color: var(--gold); }
.footer__copy { width: 100%; text-align: center; font-size: 11px; color: var(--ink-soft); padding-top: 14px; border-top: 2px dashed var(--bg-grid); font-family: var(--font-pixel); font-size: 9px; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .related-grid { grid-template-columns: repeat(2,1fr); }
  /* 文章页：移动端先显示正文，再显示侧栏（评论/相关/广告） */
  .layout--post .sidebar { order: 0; }
}
@media (max-width: 720px) {
  .nav__tools { display: none; }
  .nav__toggle { display: grid; place-items: center; width: 40px; height: 40px; border: var(--bd) solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 20px; margin-left: auto; }
  .nav__panel {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: var(--bd) solid var(--line);
    padding: 10px 14px; max-height: calc(100vh - 64px); overflow: auto;
    box-shadow: 0 var(--sp) 0 var(--shadow);
  }
  .nav__panel.is-open { display: flex; }
  .nav__links { flex-direction: column; width: 100%; gap: 0; margin-left: 0; }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; width: 100%; padding: 13px 10px; border: 0; border-bottom: 2px solid var(--line); }
  .nav__links a.is-active { background: var(--gold); border-bottom-color: var(--ink); color: var(--ink); }
  .nav__mobile { display: block; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
  .nav__mobile .search { width: 100%; margin-bottom: 10px; }
  .nav__mobile .search input { flex: 1; width: auto; }
  .nav__mobile-account { display: flex; gap: 8px; margin-bottom: 10px; }
  .nav__mobile-account .btn { flex: 1; text-align: center; }
  .nav__mobile-item { display: block; width: 100%; padding: 12px; border: var(--bd) solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 13px; }
  .nav__mobile-item + .nav__mobile-item { margin-top: 8px; }
  .nav__mobile-utils { display: flex; gap: 8px; }
  .nav__mobile-utils .icon-btn, .nav__mobile-utils .lang-switch { flex: 1; height: 42px; font-size: 12px; }
  .nav__backdrop { display: block; position: fixed; inset: 64px 0 0 0; background: rgba(0,0,0,.35); z-index: 40; }
  .nav__backdrop[hidden] { display: none; }
  .post-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .post__inner { padding: 16px 14px 18px; }
  .post__title { font-size: 17px; }
  .post__meta { gap: 8px 14px; font-size: 11px; }
  .post__body { font-size: 15px; }
  .post__actions { gap: 8px; }
  .post__actions .act-btn { flex: 1 1 auto; justify-content: center; }
  .post__title { font-size: 14px; }
}

/* =========================================================
   Phase 2 — 文章体验全套
   ========================================================= */

/* --- 目录树 TOC --- */
.toc {
  background: var(--surface-2);
  border: var(--bd) solid var(--line);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow);
  padding: 14px 16px;
  margin: 18px 0 22px;
}
.toc__head { font-family: var(--font-pixel); font-size: 11px; color: var(--primary); margin-bottom: 10px; }
.toc__list { list-style: none; counter-reset: toc; }
.toc__item { margin: 6px 0; }
.toc__item a { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.toc__item a:hover, .toc__item a.is-active { color: var(--primary); }
.toc__lv3 { padding-left: 16px; }
.toc__lv3 a { font-size: 12px; }

/* --- 长文折叠 --- */
.post__body.is-fold { max-height: 600px; overflow: hidden; position: relative; }
.post__body.is-fold::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}
.read-more-btn {
  display: block; margin: 14px auto 0; font-family: var(--font-pixel); font-size: 10px;
  padding: 10px 16px; background: var(--primary); color: #fff; border: var(--bd) solid var(--ink);
  box-shadow: var(--sp) var(--sp) 0 var(--shadow); cursor: pointer;
}
.read-more-btn:active { transform: translate(var(--sp), var(--sp)); box-shadow: 0 0 0 var(--shadow); }

/* --- 灯箱 --- */
.lightbox {
  position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.86);
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border: var(--bd) solid var(--line); image-rendering: auto; background: #fff; }
.lightbox__close {
  position: absolute; top: 16px; right: 18px; width: 44px; height: 44px;
  background: var(--surface); border: var(--bd) solid var(--line); font-size: 18px; cursor: pointer; color: var(--ink);
}

/* --- 分享海报 --- */
.poster-modal {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.8);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.poster-modal.is-open { display: flex; }
.poster-modal__box { background: var(--surface); border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); padding: 16px; max-width: 92vw; }
.poster-modal__box canvas { display: block; width: 300px; height: 400px; max-width: 80vw; image-rendering: auto; border: var(--bd) solid var(--line); }
.poster-modal__actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }

/* --- 头图 / 幻灯片 --- */
.post__hero-img { width: 100%; display: block; aspect-ratio: 21/9; object-fit: cover; image-rendering: auto; }
.post__hero--video .post__video { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.hero-slider, .home-hero { position: relative; border-bottom: var(--bd) solid var(--line); overflow: hidden; }
.hero-slider { aspect-ratio: 21/9; background: var(--surface-2); }
.home-hero { aspect-ratio: 21/9; margin-bottom: 4px; border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); }
.hero-slider .slide, .home-hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.hero-slider .slide.is-active, .home-hero__slide.is-active { opacity: 1; position: relative; }
.hero-slider .slide img, .home-hero__slide img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; display: block; }
.home-hero__slide { display: block; }
.home-hero__title {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-family: var(--font-pixel); font-size: 12px;
}
.hero-slider__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 48px; background: var(--surface); border: var(--bd) solid var(--line);
  color: var(--ink); font-size: 22px; cursor: pointer; opacity: .85;
}
.hero-slider__nav.prev { left: 8px; } .hero-slider__nav.next { right: 8px; }
.hero-slider__dots { position: absolute; bottom: 10px; left: 0; right: 0; z-index: 3; display: flex; gap: 7px; justify-content: center; }
.hero-slider__dots span { width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--line); cursor: pointer; }
.hero-slider__dots span.is-active { background: var(--primary); }

/* --- 列表模式 --- */
.post-card--list { flex-direction: row; }
.post-card--list .post-card__cover { width: 38%; flex: 0 0 38%; border-bottom: 0; border-right: var(--bd) solid var(--line); aspect-ratio: auto; }
.post-card--list .post-card__body { padding: 14px; }
.post-card--slide { border: 0; box-shadow: none; background: transparent; overflow: visible; }
.post-card--slide .post-card__cover { aspect-ratio: 16/9; border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); position: relative; }
.post-card__slidetitle {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); border-top: 2px solid var(--line);
}
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.feed-head .section-title { margin-bottom: 0; }
.list-modes { display: flex; gap: 6px; }
.list-mode {
  font-family: var(--font-pixel); font-size: 9px; padding: 8px 10px; background: var(--surface);
  border: var(--bd) solid var(--line); cursor: pointer; color: var(--ink-soft); text-transform: uppercase;
}
.list-mode.is-active, .list-mode:hover { background: var(--primary); color: #fff; }

/* --- 首页分区 / 专题 --- */
.home-section { margin-top: 30px; }
.section-title .dot { width: 12px; height: 12px; background: var(--accent); border: 2px solid var(--ink); display: inline-block; margin-right: 8px; }
.home-section__more { display: inline-block; margin-top: 12px; font-family: var(--font-pixel); font-size: 10px; color: var(--primary); }
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.topic-card { border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); background: var(--surface); overflow: hidden; color: var(--ink); }
.topic-card__cover { aspect-ratio: 16/9; display: block; width: 100%; }
.topic-card__cover img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; display: block; }
.topic-card__name { font-family: var(--font-pixel); font-size: 11px; padding: 10px 11px 4px; }
.topic-card__desc { font-size: 12px; color: var(--ink-soft); padding: 0 11px 12px; line-height: 1.6; }
.topic-card:hover { transform: translate(-2px,-2px); box-shadow: calc(var(--sp)+2px) calc(var(--sp)+2px) 0 var(--shadow); }

/* --- 热门搜索 --- */
.hot-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.hot-search__label { font-family: var(--font-pixel); font-size: 9px; color: var(--accent); }
.hot-search__tag { font-size: 12px; padding: 5px 9px; border: 2px solid var(--line); color: var(--ink-soft); }
.hot-search__tag:hover { background: var(--gold); color: var(--ink); }
.search-hot {
  position: absolute; top: 100%; right: 0; margin-top: 4px; z-index: 60; min-width: 220px;
  background: var(--surface); border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); padding: 10px;
}
.search-hot.is-open { display: block; }
.search-hot__title { font-family: var(--font-pixel); font-size: 9px; color: var(--ink-soft); margin-bottom: 8px; display: block; }
.search-hot a { display: block; padding: 7px 8px; font-size: 13px; color: var(--ink); border-bottom: 2px dashed var(--line); }
.search-hot a:last-child { border-bottom: 0; }
.search-hot a:hover { background: var(--surface-2); color: var(--primary); }

/* --- 弹窗通知 --- */
.popup-notice { position: fixed; inset: 0; z-index: 9997; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup-notice__box { position: relative; max-width: 460px; width: 100%; background: var(--surface); border: var(--bd) solid var(--line); box-shadow: var(--sp) var(--sp) 0 var(--shadow); padding: 24px; }
.popup-notice__close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; background: var(--surface-2); border: var(--bd) solid var(--line); cursor: pointer; font-size: 14px; }
.popup-notice__content { font-size: 14px; line-height: 1.9; color: var(--ink); }
.popup-notice__content :first-child { margin-top: 0; }

/* --- 一言 --- */
.hitokoto { font-size: 13px; line-height: 1.9; color: var(--ink); min-height: 48px; }
.hitokoto::before { content: "“"; color: var(--primary); font-size: 20px; }
.hitokoto::after { content: "”"; color: var(--primary); font-size: 20px; }

/* --- 图片格式画廊 --- */
.format-image .post__body img { width: 100%; height: auto; border: var(--bd) solid var(--line); image-rendering: auto; margin: 14px 0; }
.format-gallery .post__body img { border: var(--bd) solid var(--line); image-rendering: auto; }

/* --- 懒加载占位 --- */
img.lazyload { filter: blur(6px); transition: filter .3s; }
img.lazyload.loaded { filter: none; }

/* --- 响应式 --- */
@media (max-width: 920px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .topic-grid { grid-template-columns: 1fr; }
  .post-card--list { flex-direction: column; }
  .post-card--list .post-card__cover { width: 100%; flex: none; border-right: 0; border-bottom: var(--bd) solid var(--line); aspect-ratio: 16/9; }
  .search-hot { left: 0; right: 0; min-width: 0; }
}
