/* ===== 变量与重置（与主页一致） ===== */
:root {
  --bg: #ECECEC;
  --ink: #111;
  --pink: #FF5FA8;
  --blue: #4D7DFE;
  --cream: #F3EBDD;
  --card: #FFFFFF;
  --border: 3px solid var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius-card: 24px;
  --radius-pill: 999px;
  --mono: ui-monospace, "Courier New", monospace;
  /* 丝滑慢缓动：expo-out，长减速尾，无回弹 */
  --ease-silk: cubic-bezier(.16, 1, .3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* 保证 hidden 属性始终生效（防止自定义 display 覆盖） */
[hidden] { display: none !important; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
section { scroll-margin-top: 110px; }

/* ===== 吸顶胶囊导航（与主页一致） ===== */
.nav-wrap {
  position: sticky; top: 16px; z-index: 100;
  display: flex; justify-content: center; padding: 0 16px;
}
.nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--card); border: var(--border); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm); padding: 8px 14px;
  max-width: 100%; overflow-x: auto;
}
.nav-logo, .nav-gh, .nav-mail {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 2px solid var(--ink); border-radius: 10px; font-weight: 900;
}
.nav-logo { background: var(--pink); }
.nav-gh { background: var(--cream); }
.nav-mail { background: var(--blue); color:#fff; }
.nav-link {
  padding: 6px 14px; border: 2px solid transparent; border-radius: 12px;
  font-weight: 700; white-space: nowrap;
}
.nav-link.is-active { border-color: var(--ink); background: #fff; box-shadow: 2px 2px 0 var(--ink); }

/* ===== 博客首屏 ===== */
.blog-hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px;
  align-items: center; padding: 72px 24px 56px;
}
.blog-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 900;
  line-height: 1.35; text-shadow: 4px 4px 0 #d2d2d2;
}
.hl {
  display: inline-block; padding: .05em .25em;
  border: var(--border); box-shadow: var(--shadow-sm); text-shadow: none;
}
.hl-pink { background: var(--pink); }
.hl-blue { background: var(--blue); color: #fff; }
.blog-hero-sub { margin-top: 28px; font-family: var(--mono); font-size: .92rem; line-height: 1.9; }

.blog-mascot {
  background: var(--cream); border: var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: 18px; aspect-ratio: 1 / 1;
  display: grid; place-items: center; font-size: 4rem;
}

/* 搜索框 */
.blog-search {
  display: flex; align-items: center; gap: 10px; margin-top: 28px;
  background: #fff; border: var(--border); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm); padding: 10px 18px; max-width: 440px;
}
.blog-search .ico { font-weight: 900; font-size: 1.05rem; }
.blog-search input {
  border: none; outline: none; background: transparent; flex: 1;
  font-family: var(--mono); font-size: .95rem; color: var(--ink); min-width: 0;
}
.blog-search input::placeholder { color: #9a9a9a; }
.blog-search kbd {
  font-family: var(--mono); font-size: .72rem; border: 2px solid var(--ink);
  border-radius: 6px; padding: 1px 6px; background: var(--cream);
}

/* ===== 通用区块与卡片（与主页一致） ===== */
.section { padding: 40px 0 72px; }
.section h2 { display: inline-block; font-size: 1.9rem; font-weight: 900; margin-bottom: 28px; }

.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: 26px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
  background: var(--ink); color: #fff; border: var(--border);
  border-radius: var(--radius-pill); padding: 12px 26px;
  font-weight: 700; box-shadow: 4px 4px 0 #c6c6c6; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #c6c6c6; }

.btn-mini {
  display: inline-block; margin-top: 16px; padding: 6px 16px;
  border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: var(--pink); font-weight: 700; font-size: .85rem;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease;
}
.btn-mini:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ===== 标签云（与主页一致） ===== */
.tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.tag {
  padding: 4px 14px; border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: .85rem; font-weight: 700;
}
.tag--pink { background: var(--pink); }
.tag--blue { background: var(--blue); color: #fff; }

/* ===== 博客专属：工具栏 / 筛选 ===== */
.blog-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  justify-content: space-between; margin-bottom: 30px;
}
.blog-count { font-family: var(--mono); font-size: .85rem; opacity: .7; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter {
  cursor: pointer; user-select: none;
  padding: 5px 15px; border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: #fff; box-shadow: 2px 2px 0 var(--ink);
  font-size: .85rem; font-weight: 700;
  transition: transform .1s ease, box-shadow .1s ease;
}
.filter:hover { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.filter.is-sel { background: var(--ink); color: #fff; }
.filter--pink.is-sel { background: var(--ink); color: #fff; }
.filter--blue.is-sel { background: var(--ink); color: #fff; }

/* 精选大卡 */
.featured { margin-bottom: 40px; }
.featured .card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center;
  padding: 30px; cursor: pointer;
}
.featured .f-cover {
  aspect-ratio: 16 / 10; border: 2px solid var(--ink); border-radius: 18px;
  background: var(--cream); display: grid; place-items: center; font-size: 3.4rem;
  box-shadow: var(--shadow-sm);
}
.featured .f-tag { display: inline-block; }
.featured h3 { font-size: 1.55rem; margin: 14px 0 10px; }
.featured .f-excerpt { font-size: .98rem; }

/* 文章卡 */
.post-card {
  cursor: pointer; display: flex; flex-direction: column;
}
.post-card .p-cover {
  aspect-ratio: 16 / 9; border: 2px solid var(--ink); border-radius: 16px;
  background: var(--cream); display: grid; place-items: center; font-size: 2.4rem;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.post-card .p-meta { font-family: var(--mono); font-size: .8rem; opacity: .65; margin-bottom: 8px; }
.post-card h3 { margin-bottom: 8px; }
.post-card .p-excerpt { flex: 1; font-size: .95rem; }
.post-card .p-foot { margin-top: 16px; }

/* ===== 详情视图 ===== */
.blog-post { display: none; }
body.is-detail .blog-list { display: none; }
body.is-detail .blog-post { display: block; }

.post-back {
  display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 22px;
  padding: 8px 18px; border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: #fff; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.post-back:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }

.post-head { text-align: center; max-width: 780px; margin: 0 auto 14px; }
.post-head .p-meta { font-family: var(--mono); font-size: .85rem; opacity: .7; margin-bottom: 12px; }
.post-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.3; }
.post-head .post-tags { margin-top: 18px; }

.post-body { max-width: 760px; margin: 18px auto 0; }
.post-body h2 { font-size: 1.55rem; font-weight: 900; margin: 38px 0 14px; }
.post-body h3 { font-size: 1.2rem; font-weight: 900; margin: 26px 0 10px; }
.post-body p { margin: 14px 0; font-size: 1.03rem; }
.post-body ul, .post-body ol { margin: 14px 0 14px 22px; }
.post-body li { margin: 6px 0; }
.post-body strong { background: linear-gradient(transparent 60%, var(--pink) 60%); padding: 0 2px; }
.post-body pre {
  background: var(--ink); color: #fff; border-radius: 16px; padding: 18px 20px;
  overflow-x: auto; font-family: var(--mono); font-size: .9rem; line-height: 1.7;
  margin: 18px 0; box-shadow: var(--shadow-sm);
}
.post-body code { font-family: var(--mono); }
.post-body :not(pre) > code {
  background: var(--cream); border: 2px solid var(--ink); border-radius: 8px;
  padding: 1px 6px; font-size: .9em;
}
.post-body blockquote {
  border-left: 6px solid var(--pink); background: #fff; border-radius: 0 16px 16px 0;
  padding: 14px 20px; margin: 18px 0; box-shadow: var(--shadow-sm);
}
.post-body blockquote p { margin: 4px 0; }
.post-body .callout {
  border: var(--border); border-radius: 16px; padding: 16px 20px; margin: 18px 0;
  background: var(--blue); color: #fff; box-shadow: var(--shadow-sm);
}
.post-body .callout b { color: #fff; }
.post-body img { border: var(--border); border-radius: 16px; margin: 18px 0; box-shadow: var(--shadow-sm); }
.post-body img.post-img { cursor: zoom-in; }

/* ===== 正文图片点击放大（lightbox） ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17, 17, 17, .88);
  display: grid; place-items: center; padding: 4vw; cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 92vh; border: var(--border);
  border-radius: 16px; box-shadow: 6px 6px 0 var(--pink);
}

.post-foot {
  margin-top: 44px; padding-top: 24px; border-top: var(--border);
  font-family: var(--mono); font-size: .9rem; text-align: center; opacity: .8;
}

/* 关于区块 */
#about .about-card { max-width: 820px; margin: 0 auto; }
#about .about-card p { font-size: 1rem; }

/* 空状态 */
.empty {
  text-align: center; padding: 60px 20px; font-family: var(--mono); opacity: .7;
}

/* ===== 滚动浮现（与主页一致） ===== */
.js .reveal { opacity: 0; }
.js .reveal.is-in {
  opacity: 1;
  animation: rise .95s var(--ease-silk) var(--d, 0s) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(64px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
[data-parallax] { will-change: transform; }

/* ===== 页脚（与主页一致） ===== */
footer {
  border-top: var(--border); margin-top: 40px; padding: 44px 24px 56px;
  text-align: center; font-family: var(--mono); font-size: .9rem; line-height: 2;
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .blog-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; }
  .blog-mascot { width: 100%; max-width: 360px; margin-inline: auto; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .featured .card { grid-template-columns: 1fr; }
  .featured .f-cover { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; animation: none; }
  [data-parallax] { transform: none !important; will-change: auto; }
}
