/* ==========================================================================
   Pixel Chili 4.0 —— "客家围屋 / HAKKA PIXEL" 版式重构
   --------------------------------------------------------------------------
   设计约定：
   1) 视觉语言：岭南客家（梅州/赣南）——围龙屋、半月池、石牌坊、大榕树、
      红灯笼、青瓦白墙；**白天**、写实、明亮，彻底去掉赛博/蒸汽波元素；
   2) 配色取自围屋实拍：青瓦 #5A5245、白粉墙 #E7DFCC、夯土 #C9AC83、
      红砖 #A56C4E、石 #ABA69A、朱漆门 #B3362C、匾额金 #C9A227、
      半月池 #5A8E94、远山 #6E9480；
   3) 字体：Fusion Pixel 12px（OFL，标题/UI，整数倍才清晰）+ Zpix（正文）；
   4) 一切造型用硬边像素与实色块，不用渐变辉光、不用毛玻璃；
   5) 动效舒缓：云影飘、白鹭滑、灯笼轻摇，遵循 prefers-reduced-motion。
   ========================================================================== */

@font-face {
  font-family: 'Zpix';
  src:
    url('../fonts/zpix.woff2') format('woff2'),
    url('../fonts/zpix.ttf') format('truetype');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}
/* 缝合像素字体 Fusion Pixel Font —— SIL OFL 1.1，泛中日韩 12px 点阵 */
@font-face {
  font-family: 'FusionPixel';
  src: url('../fonts/FusionPixel12px-zh_hans.woff2') format('woff2');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'FusionPixel8';
  src: url('../fonts/FusionPixel8px-latin.woff2') format('woff2');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root {
  /* 天色 */
  --sky-1: #9FD2EA;
  --sky-2: #C6E4EE;
  --sky-3: #E8F2EC;
  --cloud: #FFFFFF;

  /* 山 */
  --hill-far: #8FB29A;
  --hill-mid: #6E9480;
  --hill-near: #557C68;

  /* 围屋 */
  --roof-1: #5A5245;
  --roof-2: #6E6553;
  --roof-3: #7A715C;
  --wall-1: #EFE9DC;
  --wall-2: #DCD3BE;
  --earth-1: #C9AC83;
  --earth-2: #AE9068;
  --brick-1: #A56C4E;
  --brick-2: #85563E;
  --stone-1: #ABA69A;
  --stone-2: #8C8880;

  /* 点缀 */
  --red-1: #B3362C;
  --red-2: #8E2620;
  --gold-1: #C9A227;
  --gold-2: #A5841C;
  --jade-1: #5E8F7C;
  --jade-2: #47705F;

  /* 水与田 */
  --water-1: #5A8E94;
  --water-2: #3F6E75;
  --field-1: #86B255;
  --field-2: #5F8C3E;
  --leaf-1: #4E7A3C;
  --leaf-2: #3B6130;

  /* 纸墨 */
  --paper: #FBF7EE;
  --paper-2: #F3ECDC;
  --paper-3: #E8DEC8;
  --ink: #2B2620;
  --ink-2: #5C5348;
  --ink-3: #8B8275;
  --hair: #D8CCB4;
  --hair-2: #C2B394;

  /* 结构 */
  --bd: 2px;
  --nav-h: 60px;
  --ticker-h: 36px;
  --wrap: 1120px;
  --gutter: 32px;
  --hero-h: clamp(540px, 80vh, 720px);
  --shadow: rgba(43, 38, 32, 0.16);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--ticker-h) + 16px);
}

body {
  position: relative;
  isolation: isolate;
  background-color: var(--paper-2);
  /* 宣纸纤维：极淡的横竖纹 */
  background-image:
    linear-gradient(rgba(120, 100, 70, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 100, 70, 0.035) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  color: var(--ink);
  font-family: 'Zpix', 'FusionPixel', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 16px;
  line-height: 1.9;
  overflow-x: hidden;
}

/* 岭南远山底纹：首页各区块不透明、看不到这层；
   其余页面（归档 / 分类 / 标签 / 文章 / 404）米色纸面上留一层淡墨远山。
   构图取中国山水：远山在上、云气在中，下方留白给正文 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* 文件名带 -v2：CDN 按路径缓存且忽略 query，换文件名才能换掉旧图 */
  background: url('../images/hakka-mountains-v2.svg') no-repeat top center / max(100%, 860px) auto;
  opacity: 0.95;
}

body:has(> .hero) {
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-h) + var(--ticker-h));
}
body:not(:has(> .hero)) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > main { flex: 1 0 auto; }
body:has(> .hero) > .marquee { order: -1; }

img,
svg { image-rendering: pixelated; }

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

:focus-visible {
  outline: var(--bd) solid var(--red-1);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--red-1) var(--paper-3);
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-3); border-left: 2px solid var(--hair); }
::-webkit-scrollbar-thumb {
  background: var(--red-1);
  border: 2px solid var(--paper-3);
}
::-webkit-scrollbar-thumb:hover { background: var(--red-2); }

/* 英文/编号小字：8px 像素点阵，16px 渲染才清晰 */
.en {
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  letter-spacing: 0.08em;
}
.term {
  font-family: 'FusionPixel8', monospace;
  letter-spacing: 0.08em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 纸面板 */
.px-card {
  background: var(--paper);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}
.px-card.hover-lift {
  transition:
    transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.16s cubic-bezier(0.2, 0.9, 0.3, 1),
    border-color 0.16s linear;
}
.px-card.hover-lift:hover {
  transform: translate(-3px, -3px);
  border-color: var(--red-1);
  box-shadow: 7px 7px 0 rgba(179, 54, 44, 0.28);
}

/* 按钮：朱漆木牌 */
.px-btn {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 16px;
  line-height: 1.6;
  padding: 11px 20px;
  color: #FBF3E2;
  background: var(--red-1);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.14s linear,
    background-color 0.14s linear;
}
.px-btn:hover { background: var(--red-2); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.px-btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.px-btn.ghost {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.px-btn.ghost:hover { background: var(--gold-1); color: #2B2010; }

/* 入场 */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.55s cubic-bezier(0.2, 0.9, 0.3, 1),
    transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.js .reveal.on { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   3. 顶栏 —— 瓦檐
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 3px solid var(--roof-1);
  box-shadow: 0 3px 0 var(--gold-2), 0 6px 14px rgba(43, 38, 32, 0.08);
  transition: background-color 0.2s linear, box-shadow 0.2s linear, border-color 0.2s linear;
  animation: nav-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.site-nav.scrolled {
  background: var(--paper-2);
  border-bottom-color: var(--ink);
  box-shadow: 0 3px 0 var(--red-1), 0 6px 0 rgba(43, 38, 32, 0.18);
}
@keyframes nav-in {
  from { opacity: 0; transform: translate3d(0, -100%, 0); }
  to { opacity: 1; transform: none; }
}

.site-nav .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
}
.logo .chili-ico {
  width: 26px;
  height: 26px;
  flex: none;
}
.logo > span { display: block; line-height: 1.1; }
.logo b {
  display: block;
  font-weight: normal;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.logo .en {
  display: block;
  font-size: 8px;
  color: var(--ink-3);
  letter-spacing: 0.22em;
  margin-top: 5px;
  white-space: nowrap;
}
.logo:hover b { color: var(--red-1); }

.site-nav ul {
  display: flex;
  align-items: stretch;
  gap: 0;
  list-style: none;
  height: 100%;
}
.site-nav li { display: flex; align-items: stretch; }
a.nav-link {
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  border-left: 1px solid var(--hair);
  transition: color 0.14s linear, background-color 0.14s linear;
}
a.nav-link:last-child { border-right: 1px solid var(--hair); }
a.nav-link:hover { background: var(--gold-1); color: #2B2010; }

.nav-toggle {
  display: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  font-family: 'Zpix', monospace;
  font-size: 18px;
  line-height: 1;
  padding: 7px 11px;
  min-width: 42px;
  min-height: 38px;
  border-width: var(--bd);
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}
.site-nav .px-btn {
  box-shadow: 3px 3px 0 var(--ink);
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}
.site-nav .px-btn:hover { background: var(--gold-1); }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 190;
  flex-direction: column;
  background: var(--paper);
  border-bottom: 3px solid var(--roof-1);
  box-shadow: 0 12px 26px rgba(43, 38, 32, 0.16);
  padding: 6px 0 10px;
}
.mobile-menu:not([hidden]) { display: flex; }
.mobile-menu a.nav-link {
  padding: 13px 24px;
  font-size: 16px;
  border-left: 0;
  border-top: 1px solid var(--hair);
}
.mobile-menu a.nav-link:hover { padding-left: 32px; }

@media (max-width: 780px) {
  .site-nav ul { display: none; }
  .nav-toggle { display: inline-flex; }
  .logo b { font-size: 18px; }
  .logo .en { font-size: 8px; }
}
@media (min-width: 781px) {
  .mobile-menu,
  .mobile-menu:not([hidden]) { display: none !important; }
}

/* --------------------------------------------------------------------------
   4. 跑马灯 —— 竹简式横条
   -------------------------------------------------------------------------- */
.marquee {
  position: relative;
  z-index: 5;
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  background: var(--jade-1);
  color: var(--paper);
  border-bottom: var(--bd) solid var(--ink);
  overflow: hidden;
  white-space: nowrap;
}
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--jade-1), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--jade-1), transparent); }
.marquee .track {
  display: inline-block;
  width: max-content;
  animation: ticker 42s linear infinite;
  will-change: transform;
}
.marquee span {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 16px;
  letter-spacing: 0.14em;
  margin: 0 22px;
  color: #F3EADA;
}
.marquee .dot { color: var(--gold-1); }
@keyframes ticker {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 600px) {
  :root { --ticker-h: 32px; }
  .marquee span { font-size: 12px; margin: 0 14px; }
}

/* --------------------------------------------------------------------------
   5. Hero —— 客家围龙屋
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: var(--hero-h);
  padding: 0;
  overflow: hidden;
  background: var(--sky-2);
  border-bottom: 3px solid var(--roof-1);
  isolation: isolate;
}

.hero-grid {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 108px var(--gutter) 64px;
  display: flex;
  align-items: flex-end;
  gap: 40px;
}

/* --- 天空 --- */
.hk-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--sky-1) 0%,
    #B4DCEB 20%,
    #C8E6EE 38%,
    #DCEFE9 54%,
    #EAF2E6 70%,
    #F2F4E4 100%
  );
}

/* 白日 */
.hk-sun {
  position: absolute;
  left: 72%;
  top: 9%;
  width: clamp(70px, 8vw, 118px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #FFF6DC;
  box-shadow: 0 0 0 10px rgba(255, 246, 220, 0.22), 0 0 40px rgba(255, 240, 190, 0.5);
}

/* 云：像素云块，缓慢横移 */
.hk-clouds {
  position: absolute;
  inset: 0 0 52% 0;
  opacity: 0.92;
  background-image:
    radial-gradient(26px 13px at 60px 40px, #fff 60%, transparent 62%),
    radial-gradient(18px 10px at 86px 40px, #fff 60%, transparent 62%),
    radial-gradient(22px 11px at 300px 90px, #fff 60%, transparent 62%),
    radial-gradient(16px 9px at 322px 92px, #fff 60%, transparent 62%),
    radial-gradient(30px 14px at 520px 30px, #fff 60%, transparent 62%),
    radial-gradient(20px 11px at 548px 32px, #fff 60%, transparent 62%),
    radial-gradient(24px 12px at 760px 120px, #fff 60%, transparent 62%);
  background-size: 900px 200px;
  animation: cloud-drift 90s linear infinite;
}
@keyframes cloud-drift {
  from { background-position: 0 0; }
  to { background-position: 900px 0; }
}

/* 远山：多层青绿与丹霞剪影 */
.hk-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40%;
  will-change: transform;
}
.hk-hills.far {
  bottom: 38%;
  height: 12%;
  background: var(--hill-far);
  clip-path: polygon(
    0 100%, 0 72%, 8% 58%, 16% 66%, 26% 44%, 36% 60%, 46% 38%, 58% 62%,
    68% 46%, 78% 64%, 88% 50%, 100% 66%, 100% 100%
  );
}
.hk-hills.near {
  bottom: 34%;
  height: 11%;
  background: var(--hill-mid);
  clip-path: polygon(
    0 100%, 0 78%, 10% 62%, 20% 74%, 32% 52%, 44% 70%, 56% 56%, 66% 72%,
    78% 58%, 90% 72%, 100% 62%, 100% 100%
  );
}
/* 韶关丹霞 / 喀斯特：陡壁平顶的塔峰，暖赭色 */
.hk-hills.karst {
  bottom: 36%;
  height: 13%;
  background: #D6BC98;
  clip-path: polygon(
    0 100%, 0 90%, 5% 90%, 5% 46%, 10% 46%, 10% 90%, 16% 90%, 16% 28%,
    21% 28%, 21% 90%, 29% 90%, 29% 62%, 34% 62%, 34% 90%, 42% 90%, 42% 22%,
    47% 22%, 47% 90%, 56% 90%, 56% 54%, 61% 54%, 61% 90%, 69% 90%, 69% 66%,
    74% 66%, 74% 90%, 84% 90%, 84% 38%, 89% 38%, 89% 90%, 100% 90%, 100% 100%
  );
}

/* 围龙屋主景 */
.hk-house {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: max(100%, 1120px);
  height: auto;
  transform: translateX(-50%);
  z-index: 2;
}

/* 前景菜地 */
.hk-field {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  z-index: 3;
  background:
    repeating-linear-gradient(90deg, rgba(59, 97, 48, 0.5) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #74A84C 0 40%, #4E7A3C 40% 100%);
}

/* 石牌坊（左前景） */
.hk-paifang {
  position: absolute;
  left: 7%;
  bottom: 40px;
  width: clamp(70px, 8vw, 122px);
  height: auto;
  z-index: 4;
}

/* 红树林：滩涂上的支柱根（左前景，贴着半月池） */
.hk-hongshulin {
  position: absolute;
  left: -2%;
  bottom: 42px;
  width: clamp(96px, 10vw, 152px);
  height: auto;
  z-index: 3;
}

/* 客家豆腐花：摆在门前石坪上 */
.hk-doufu {
  position: absolute;
  left: 40%;
  bottom: 24%;
  width: clamp(54px, 5.4vw, 86px);
  height: auto;
  z-index: 5;
}

/* 大榕树（右前景） */
.hk-rong {
  position: absolute;
  right: 1%;
  bottom: 40px;
  width: clamp(84px, 10vw, 152px);
  height: auto;
  z-index: 4;
}

/* 白鹭 */
.hk-egret {
  position: absolute;
  width: 26px;
  height: auto;
  z-index: 2;
  animation: egret-fly 26s linear infinite;
}
.hk-egret.e1 { left: 18%; top: 16%; }
.hk-egret.e2 { left: 30%; top: 24%; animation-delay: 6s; width: 20px; }
.hk-egret.e3 { left: 10%; top: 30%; animation-delay: 12s; width: 16px; }
@keyframes egret-fly {
  0% { transform: translateX(0); }
  50% { transform: translateX(120px); }
  100% { transform: translateX(260px); }
}

/* 檐下红灯笼 */
.hk-lanterns {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.hk-lantern {
  position: absolute;
  width: 24px;
  height: auto;
  transform-origin: 50% 0;
  animation: lantern-sway 4.2s ease-in-out infinite;
}
.hk-lantern.l1 { left: 3%; top: 44%; }
.hk-lantern.l2 { left: 11%; top: 52%; width: 19px; animation-delay: 0.9s; }
.hk-lantern.l3 { right: 6%; top: 47%; width: 21px; animation-delay: 1.7s; }
@keyframes lantern-sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* --- 菜单盒：祠堂匾额 --- */
.hero-copy {
  position: relative;
  z-index: 6;
  width: min(100%, 356px);
  padding: 20px 22px 18px;
  color: #F7EBD2;
  background: linear-gradient(180deg, #A8332A, var(--red-2));
  border: 3px solid var(--gold-1);
  box-shadow:
    0 0 0 3px var(--ink),
    8px 8px 0 rgba(43, 38, 32, 0.28);
  animation: box-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.12s both;
}
@keyframes box-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: none; }
}

.hero-title-en {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 20px;
  letter-spacing: 0.16em;
  color: #FBF0D8;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(247, 235, 210, 0.35);
}
.hero-title-en .cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  background: var(--gold-1);
  margin-left: 4px;
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.hero .hero-btns {
  flex-direction: column;
  gap: 0;
  border-top: 1px dashed rgba(247, 235, 210, 0.3);
  padding-top: 10px;
}
.hero .hero-btns .px-btn {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 8px;
  font-family: 'Zpix', 'FusionPixel', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #F7EBD2;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-bottom: 1px dashed rgba(247, 235, 210, 0.22);
  transform: none;
  animation: none;
}
.hero .hero-btns .px-btn:last-child { border-bottom: 0; }
.hero .hero-btns .px-btn:hover,
.hero .hero-btns .px-btn:focus-visible {
  background: rgba(255, 240, 210, 0.14);
  color: #fff;
  box-shadow: inset 5px 0 0 var(--gold-1);
  padding-left: 15px;
  transform: none;
}
.hero .hero-btns .px-btn:active {
  transform: translate(2px, 2px);
}
.hero-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #FBF0D8;
  background: rgba(43, 38, 32, 0.28);
  border: 1px solid rgba(201, 162, 39, 0.45);
}
.hero-status .st-loc { color: var(--gold-1); }
.hero-status .st-sep { color: rgba(247, 235, 210, 0.45); }
.hero-copy::after {
  content: '▲▼ 择一篇   ● 翻开   ▸ 入屋';
  display: block;
  margin-top: 12px;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(247, 235, 210, 0.6);
}

@media (max-width: 860px) {
  .hero { min-height: 600px; }
  .hero-grid { padding: 116px var(--gutter) 46px; }
  .hero-copy { width: 100%; max-width: 400px; }
  .hk-house { width: max(100%, 760px); }
}

/* --------------------------------------------------------------------------
   6. 区块骨架
   -------------------------------------------------------------------------- */
section { position: relative; }

/* 印章式标签 */
.sec-tag {
  display: inline-block;
  align-self: start;
  justify-self: start;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  color: var(--paper);
  background: var(--red-1);
  border: var(--bd) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 5px 11px;
  margin-bottom: 16px;
}
.sec-tag.alt { background: var(--jade-1); }
.sec-tag.alt2 { background: var(--gold-1); color: #33270B; }

.sec-title {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 36px;
  line-height: 1.3;
  font-weight: normal;
  letter-spacing: 0.04em;
}
.sec-sub {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 52ch;
  margin-top: 10px;
}

/* 区块：半透明宣纸，让共享底纹的远山透上来 */
#posts {
  padding: 88px 0 96px;
  background: rgba(251, 247, 238, 0.78);
  border-top: 3px solid var(--roof-1);
  border-bottom: 3px solid var(--roof-1);
  box-shadow: inset 0 3px 0 var(--gold-2), inset 0 -3px 0 var(--gold-2);
}

#explore {
  padding: 80px 0 88px;
  background: rgba(243, 236, 220, 0.74);
  border-bottom: 3px solid var(--roof-1);
  box-shadow: inset 0 3px 0 var(--gold-2);
}

#story {
  padding: 88px 0 72px;
  background: rgba(232, 222, 200, 0.76);
  color: var(--ink);
  overflow: hidden;
}
#story::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 100, 70, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 100, 70, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}
#story > .wrap { position: relative; }

#posts .sec-title { color: var(--ink); }
#explore .sec-title { color: var(--ink); }
#story .sec-title { color: var(--ink); }

/* 首页三个区块：标题占左、标签占右上 */
#posts > .wrap,
#explore > .wrap,
#story > .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 28px;
  align-items: end;
}
#posts > .wrap > .sec-tag,
#explore > .wrap > .sec-tag,
#story > .wrap > .sec-tag {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin-bottom: 6px;
}
#posts > .wrap > .sec-title,
#explore > .wrap > .sec-title,
#story > .wrap > .sec-title { grid-column: 1; grid-row: 1; }
#posts > .wrap > .sec-sub,
#explore > .wrap > .sec-sub,
#story > .wrap > .sec-sub { grid-column: 1; grid-row: 2; }
#posts > .wrap > .posts-grid,
#posts > .wrap > .empty-state,
#posts > .wrap > .pagination,
#explore > .wrap > .cat-grid,
#explore > .wrap > .tag-cloud,
#explore > .wrap > .empty-state,
#story > .wrap > .timeline,
#story > .wrap > .empty-state,
#story > .wrap > .px-card { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   7. 最新文章 —— 册页
   -------------------------------------------------------------------------- */
.posts-grid {
  counter-reset: piece;
  display: flex;
  flex-direction: column;
  margin-top: 40px;
  border-top: var(--bd) solid var(--ink);
  border-bottom: var(--bd) solid var(--ink);
}

.post-card {
  counter-increment: piece;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--hair-2);
  box-shadow: none;
  transition: background-color 0.15s linear;
}
.post-card:last-child { border-bottom: 0; }

.post-card-link {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0 18px;
  padding: 24px 20px 22px 4px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.post-card-link::before {
  content: '第 ' counter(piece, decimal-leading-zero) ' 篇';
  grid-column: 1;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--red-1);
  padding-top: 10px;
}
.post-card .body { grid-column: 2; min-width: 0; }

.post-card .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.post-card .yr {
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: none;
  padding: 0;
}
.post-card .cat-tag {
  font-size: 12px;
  line-height: 1.7;
  padding: 1px 8px;
  border: 1px solid var(--jade-1);
  color: var(--jade-2);
  background: rgba(94, 143, 124, 0.1);
}
.post-card h3 {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 24px;
  font-weight: normal;
  line-height: 1.45;
  margin-bottom: 6px;
  transition: color 0.15s linear;
}
.post-card p {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 68ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.post-card .read-more { color: var(--red-1); }

.post-card:hover { background: rgba(201, 162, 39, 0.1); }
.post-card .post-card-link:active {
  transform: translate(2px, 2px);
}
.post-card:hover .post-card-link { transform: translateX(8px); }
.post-card:hover .post-card-link::before { color: var(--gold-2); }
.post-card:hover h3 { color: var(--red-1); }
.post-card:hover .cat-tag {
  background: var(--red-1);
  color: #fff;
  border-color: var(--red-1);
}
.post-card:hover .read-more { color: var(--red-2); }

.post-card-link:has(.post-cover) { grid-template-columns: 110px 132px minmax(0, 1fr); }
.post-card .post-cover {
  grid-column: 2;
  width: 132px;
  aspect-ratio: 1;
  border: var(--bd) solid var(--ink);
  background: var(--paper-3);
  box-shadow: 3px 3px 0 var(--shadow);
  overflow: hidden;
}
.post-card-link:has(.post-cover) .body { grid-column: 3; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.empty-state {
  margin-top: 36px;
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-2);
  border-style: dashed;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: 0.08em;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 44px;
}
.pagination .px-btn { font-size: 14px; padding: 10px 18px; }
.page-num {
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   8. 分类与标签 —— 门牌与贴纸
   -------------------------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
  align-items: stretch;
}
.cat-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  min-height: 96px;
  padding: 20px 22px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}
.cat-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--hair-2);
  pointer-events: none;
}
.cat-card h3 {
  position: relative;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 20px;
  font-weight: normal;
  line-height: 1.5;
}
.cat-card .count {
  position: static;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: var(--jade-1);
  padding: 4px 8px;
}
.cat-card p { position: relative; flex-basis: 100%; color: var(--ink-2); font-size: 13px; }
.cat-card:hover {
  border-color: var(--red-1);
  box-shadow: 4px 4px 0 rgba(179, 54, 44, 0.3);
}
.cat-card:hover h3 { color: var(--red-1); }
.cat-card:hover .count { background: var(--red-1); }
.cat-card:hover::before { border-color: rgba(179, 54, 44, 0.4); }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px dashed var(--hair-2);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.6;
  padding: 4px 11px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--bd) solid var(--hair-2);
  box-shadow: 2px 2px 0 var(--shadow);
  transform: rotate(-0.8deg);
  transition:
    transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.15s linear,
    background-color 0.15s linear,
    color 0.15s linear;
}
.tag:nth-child(3n) { background: rgba(179, 54, 44, 0.1); border-color: var(--red-1); transform: rotate(0.9deg); }
.tag:nth-child(3n + 1) { background: rgba(94, 143, 124, 0.12); border-color: var(--jade-1); transform: rotate(-1.1deg); }
.tag:nth-child(4n) { background: rgba(201, 162, 39, 0.18); border-color: var(--gold-2); transform: rotate(0.5deg); }
.tag:hover {
  background: var(--red-1);
  color: #fff;
  border-color: var(--red-2);
  transform: rotate(0) translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(43, 38, 32, 0.3);
}
.tag sup {
  font-family: 'FusionPixel8', monospace;
  font-size: 12px;
  color: var(--ink-3);
}
.tag:hover sup { color: #fff; }

/* --------------------------------------------------------------------------
   9. 世系 —— 族谱路线
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding: 60px 4px 16px;
  overflow-x: auto;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--roof-2) 0 12px, transparent 12px 22px);
  -webkit-mask-image: linear-gradient(90deg, #000 0 42%, rgba(0, 0, 0, 0.25) 78%, transparent 96%);
  mask-image: linear-gradient(90deg, #000 0 42%, rgba(0, 0, 0, 0.25) 78%, transparent 96%);
}
.t-item { position: relative; min-width: 300px; padding: 0; }
.t-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: -44px;
  width: 16px;
  height: 16px;
  background: var(--red-1);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--gold-2);
}
.t-item:nth-child(3n)::before { background: var(--jade-1); }
.t-item:nth-child(3n + 2)::before { background: var(--gold-1); }
.t-year {
  display: inline-block;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--paper);
  background: var(--ink);
  padding: 4px 10px;
  border: var(--bd) solid var(--ink);
  margin-bottom: 12px;
}
.t-item p { color: var(--ink-2); }
.t-item p b { color: var(--ink); font-weight: normal; display: block; margin-bottom: 8px; }
.month-chip {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 3px 11px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--bd) solid var(--hair-2);
  box-shadow: 2px 2px 0 var(--shadow);
  transition: background-color 0.15s linear, transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1), color 0.15s linear;
}
.month-chip:hover {
  background: var(--gold-1);
  color: #33270B;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow);
}

/* --------------------------------------------------------------------------
   10. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  background: var(--roof-1);
  color: #E8DFCB;
  border-top: 3px solid var(--gold-2);
  padding: 48px 0 36px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 223, 203, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 223, 203, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}
.site-footer .wrap { position: relative; }
.site-footer .foot-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.foot-logo { font-size: 24px; letter-spacing: 0.04em; }
.foot-logo .en {
  display: block;
  margin-top: 10px;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--gold-1);
}
.site-footer .small { color: #B9AE97; font-size: 13px; max-width: 460px; }
.site-footer a { color: var(--gold-1); text-decoration: none; border-bottom: 1px solid rgba(201, 162, 39, 0.5); }
.site-footer a:hover { color: #FBF3E2; border-color: #FBF3E2; }
.heart { color: var(--red-1); animation: beat 1.8s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 回到顶部 */
#top-btn {
  -webkit-appearance: none;
  appearance: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  width: 52px;
  height: 52px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--red-1);
  color: #FBF3E2;
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.18s linear, transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1), background-color 0.14s linear;
}
#top-btn.show { display: flex; opacity: 1; transform: none; }
#top-btn:hover { background: var(--red-2); }

/* --------------------------------------------------------------------------
   11. 列表页
   -------------------------------------------------------------------------- */
.list-page {
  padding: calc(var(--nav-h) + var(--ticker-h) + 60px) 0 92px;
  min-height: 72vh;
}
.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  align-items: end;
}
.page-header > .sec-tag { grid-column: 2; grid-row: 1; justify-self: end; margin-bottom: 6px; }
.page-header > h2.sec-title { grid-column: 1; grid-row: 1; }
.page-header > .sec-sub { grid-column: 1; }

.post-list {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
  border-top: var(--bd) solid var(--ink);
}
.list-item {
  display: block;
  padding: 20px 16px;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--hair-2);
  box-shadow: none;
  transition: background-color 0.15s linear;
}
.list-item .meta {
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--red-1);
  margin-bottom: 8px;
}
.list-item h3 {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 20px;
  font-weight: normal;
  line-height: 1.5;
  margin-bottom: 6px;
}
.list-item p {
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 70ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-item:hover { background: rgba(201, 162, 39, 0.12); }
.list-item:hover h3 { color: var(--red-1); }
.list-item:hover .meta { color: var(--gold-2); }
.list-item:hover p { color: var(--ink-2); }

.list-year-block {
  margin-bottom: 26px;
  background: var(--paper);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}
.list-year-block:last-child { margin-bottom: 0; }
.list-year-block > div:first-child { padding-bottom: 4px; }
.list-year-block .sec-tag { margin-bottom: 4px; }
.list-year-block .list-item { border-bottom: 1px dashed var(--hair-2); }
.list-year-block .list-item:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   12. 文章页
   -------------------------------------------------------------------------- */
.post-page { padding: calc(var(--nav-h) + var(--ticker-h) + 52px) 0 96px; }

.post-shell {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.post-header {
  position: relative;
  padding: 32px 34px 26px;
  margin-bottom: 36px;
  color: #F7EBD2;
  background: linear-gradient(180deg, #A8332A, var(--red-2));
  border: 3px solid var(--gold-1);
  box-shadow: 0 0 0 3px var(--ink), 8px 8px 0 rgba(43, 38, 32, 0.24);
}
.post-header::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(247, 235, 210, 0.3);
  pointer-events: none;
}
.post-header .sec-tag {
  position: relative;
  margin-bottom: 12px;
  background: var(--gold-1);
  color: #33270B;
  border-color: var(--ink);
}
.post-header h1 {
  position: relative;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 32px;
  font-weight: normal;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  color: #FDF6E6;
}
.post-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(247, 235, 210, 0.82);
}
.post-meta > span + span::before {
  content: '·';
  margin-right: 10px;
  color: var(--gold-1);
  font-size: 12px;
}
.post-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.post-tags .tag {
  background: rgba(255, 246, 226, 0.12);
  color: #F7EBD2;
  border-color: rgba(201, 162, 39, 0.7);
  box-shadow: 2px 2px 0 rgba(43, 38, 32, 0.4);
  transform: none;
  font-size: 13px;
  padding: 2px 10px;
}
.post-tags .tag:hover { background: var(--gold-1); color: #33270B; border-color: var(--gold-1); }

.post-body {
  position: relative;
  padding: 42px 44px 46px;
  background: var(--paper);
  color: var(--ink);
  border: var(--bd) solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  font-size: 16.5px;
  line-height: 2;
  counter-reset: h2n;
}

.post-body > p:first-of-type::first-letter {
  float: left;
  margin: 6px 8px 0 0;
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: 2.6em;
  line-height: 0.9;
  color: var(--red-1);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-weight: normal;
  line-height: 1.5;
  margin: 1.6em 0 0.7em;
}
.post-body h2 {
  counter-increment: h2n;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.45em;
  padding-bottom: 10px;
  border-bottom: var(--bd) solid var(--hair-2);
}
.post-body h2::before {
  content: counter(h2n, decimal-leading-zero);
  flex: none;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--red-1);
  padding: 4px 9px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.post-body h3 {
  font-size: 1.2em;
  color: var(--red-1);
  padding-left: 12px;
  border-left: 5px solid var(--gold-1);
}
.post-body p { margin: 0.9em 0; }
.post-body a {
  color: var(--red-1);
  text-decoration: none;
  border-bottom: 2px solid rgba(179, 54, 44, 0.45);
}
.post-body a:hover { color: var(--red-2); border-color: var(--red-2); }
.post-body strong { font-weight: normal; background: rgba(201, 162, 39, 0.25); padding: 0 4px; }

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4em auto;
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  image-rendering: pixelated;
}
.post-body ul,
.post-body ol { margin: 0.9em 0; padding-left: 1.5em; }
.post-body li { margin: 0.4em 0; }
.post-body li::marker { color: var(--red-1); }

.post-body blockquote {
  position: relative;
  margin: 1.4em 0;
  padding: 16px 20px 16px 24px;
  background: var(--paper-2);
  border: var(--bd) solid var(--hair-2);
  border-left: 8px solid var(--jade-1);
  box-shadow: 3px 3px 0 var(--shadow);
  color: var(--ink-2);
}
.post-body blockquote p:first-child { margin-top: 0; }
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body code {
  font-family: 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  background: rgba(94, 143, 124, 0.14);
  border: 1px solid var(--hair);
}
.post-body pre {
  position: relative;
  margin: 1.4em 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #2B2620;
  color: #E8DFCB;
  border: var(--bd) solid var(--ink);
  border-left: 8px solid var(--gold-1);
  box-shadow: 4px 4px 0 var(--shadow);
  line-height: 1.7;
}
.post-body pre code {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font-size: 13.5px;
}

.post-body table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 0.95em;
}
.post-body th,
.post-body td { border: 1px solid var(--hair); padding: 10px 12px; text-align: left; }
.post-body th { background: rgba(201, 162, 39, 0.18); font-weight: normal; }
.post-body tr:nth-child(even) td { background: rgba(120, 100, 70, 0.04); }

.post-body hr {
  margin: 2.2em 0;
  border: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--roof-2) 0 8px, transparent 8px 16px);
}
.post-body figure { margin: 1.4em 0; }
.post-body figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

.post-nav {
  display: flex;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.post-nav a {
  flex: 1;
  min-width: 240px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  background: var(--paper);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: border-color 0.15s linear, transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.post-nav a span {
  display: block;
  margin-bottom: 9px;
  font-family: 'FusionPixel8', 'FusionPixel', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--red-1);
}
.post-nav a:hover {
  border-color: var(--red-1);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(179, 54, 44, 0.28);
}

.comment-block {
  margin-top: 40px;
  padding: 28px;
  background: var(--paper);
  border: var(--bd) solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}
.comment-block .sec-title { font-size: 24px; margin-bottom: 16px; color: var(--ink); }

.page-shell { padding: calc(var(--nav-h) + var(--ticker-h) + 52px) 0 96px; }

/* --------------------------------------------------------------------------
   13. 404 —— 唔知路了
   -------------------------------------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 74vh;
  padding: calc(var(--nav-h) + var(--ticker-h) + 68px) var(--gutter) 84px;
  text-align: center;
}
.error-page .code {
  font-family: 'FusionPixel', 'Zpix', monospace;
  font-size: clamp(72px, 16vw, 140px);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: var(--red-1);
  padding: 10px 22px 16px;
  border: 3px solid var(--gold-1);
  box-shadow: 6px 6px 0 var(--ink);
}
.error-page .sec-title { color: var(--ink); }
.error-page .sec-sub { text-align: center; color: var(--ink-2); }
.error-page .hero-btns { align-items: center; justify-content: center; }
.error-page .hero-btns .px-btn { font-size: 16px; padding: 12px 22px; }

/* --------------------------------------------------------------------------
   14. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root { --wrap: 960px; }
  #posts { padding: 76px 0 84px; }
  #explore { padding: 68px 0 76px; }
  #story { padding: 76px 0 84px; }
  .post-body { padding: 34px 30px 38px; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .sec-title { font-size: 28px; }
  .sec-sub { font-size: 14px; }
  #posts > .wrap,
  #explore > .wrap,
  #story > .wrap,
  .page-header { grid-template-columns: minmax(0, 1fr); align-items: start; }
  #posts > .wrap > .sec-tag,
  #explore > .wrap > .sec-tag,
  #story > .wrap > .sec-tag,
  .page-header > .sec-tag {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-bottom: 14px;
  }
  #posts > .wrap > .sec-title,
  #explore > .wrap > .sec-title,
  #story > .wrap > .sec-title,
  .page-header > h2.sec-title,
  #posts > .wrap > .sec-sub,
  #explore > .wrap > .sec-sub,
  #story > .wrap > .sec-sub,
  .page-header > .sec-sub { grid-row: auto; }

  .post-card-link { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 6px; }
  .post-card-link::before { grid-column: 1; padding-top: 0; margin-bottom: 8px; }
  .post-card .body { grid-column: 1; }
  .post-card-link:has(.post-cover) { grid-template-columns: 88px minmax(0, 1fr); gap: 0 16px; }
  .post-card .post-cover { grid-column: 1; grid-row: 2; width: 88px; }
  .post-card-link:has(.post-cover)::before { grid-column: 1 / -1; }
  .post-card-link:has(.post-cover) .body { grid-column: 2; grid-row: 2; }

  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .cat-card { padding: 16px 16px; }
  .cat-card h3 { font-size: 18px; padding-right: 0; }
  .cat-card .count { position: static; display: inline-block; margin-top: 10px; }

  .timeline { gap: 28px; padding-top: 54px; }
  .t-item { min-width: 240px; }

  .post-header { padding: 22px 20px 20px; }
  .post-header h1 { font-size: 24px; }
  .post-body { padding: 24px 20px 30px; font-size: 16px; line-height: 1.95; }
  .post-meta { font-size: 13px; }
  .post-nav { gap: 14px; }
  .post-nav a { min-width: 100%; }
  .comment-block { padding: 20px; }
  .site-footer { padding: 40px 0 30px; }
  .foot-logo { font-size: 22px; }
}

@media (max-width: 560px) {
  :root { --nav-h: 54px; }
  body { font-size: 15.5px; }
  .logo .chili-ico { width: 22px; height: 22px; }
  .hero { min-height: 660px; align-items: flex-start; }
  .hero-grid { padding: 96px var(--gutter) 24px; align-items: flex-start; }
  .hero-copy { max-width: 280px; padding: 14px 13px 12px; box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 rgba(43, 38, 32, 0.24); }
  .hero-title-en { font-size: 16px; }
  .hero .hero-btns .px-btn { font-size: 14px; padding: 7px 4px; }
  .hero-copy::after { font-size: 10px; margin-top: 8px; }
  .hk-house { width: max(100%, 760px); bottom: 24px; }
  .hk-field { height: 64px; }
  .hk-paifang { width: 56px; bottom: 24px; left: 3%; }
  .hk-hongshulin { width: 82px; bottom: 26px; }
  .hk-doufu { width: 52px; left: 36%; bottom: 25%; }
  .hk-rong { width: 64px; bottom: 24px; }
  .hk-lantern { width: 17px; }
  .hk-lantern.l3 { display: none; }
  .post-card h3 { font-size: 20px; }
  .post-card p { font-size: 14px; }
  .post-body > p:first-of-type::first-letter { font-size: 2.4em; }
  .post-body h2 { font-size: 1.25em; }
  .foot-logo .en { font-size: 11px; letter-spacing: 0.1em; }
  #top-btn { width: 46px; height: 46px; right: 16px; bottom: 16px; }
}

/* --------------------------------------------------------------------------
   15. 无障碍：尊重减少动效
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .marquee .track { animation: none; }
  .hk-clouds { animation: none; }
  .hk-egret { animation: none; }
}
