/* ============================================================
   灰白极简 · 个人博客
   配色: 深灰 #4a4a4a / 奶白 #faf8f3 / 灰阶 #777 #999 #eee #f6f6f6
   ============================================================ */

/* 得意黑 SmileySans：斜切粗体标题字体（本地化，离线可用） */
@font-face {
  font-family: "SmileySans";
  src: url("../fonts/SmileySans-Oblique.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --black: #4a4a4a;      /* 深灰（替代原黑色） */
  --white: #faf8f3;      /* 奶白（替代原纯白） */
  --gray-900: #222222;
  --gray-600: #555555;
  --gray-400: #999999;
  --gray-200: #dddddd;
  --gray-100: #eeeeee;
  --gray-50:  #f6f6f6;
  --border: 1px solid var(--black);
  --display: "SmileySans", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--black); color: var(--white); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

img { max-width: 100%; display: block; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  border-bottom: var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}
.logo span { color: var(--gray-400); }

.site-nav { display: flex; gap: 28px; }

.site-nav a {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--gray-600);
  padding: 6px 0;
  position: relative;
}
.site-nav a:hover { color: var(--black); text-decoration: none; }
.site-nav a.active { color: var(--black); font-weight: 700; }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--black);
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: var(--border);
  margin-top: 96px;
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
  letter-spacing: 1px;
}

/* ---------- 主页 Hero ---------- */
.hero {
  border-bottom: var(--border);
  padding: 72px 0 64px;
  text-align: center;
  background-color: var(--gray-50);
  position: relative;
}
/* 纸张噪点质感 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.45;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero .mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--gray-400);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 700;
  letter-spacing: 6px;
  line-height: 1.2;
}

.hero .subtitle {
  margin-top: 24px;
  font-size: 15px;
  color: var(--gray-600);
  letter-spacing: 2px;
}

/* 实体按钮：印刷质感硬阴影 + 按压反馈 */
.btn-solid {
  display: inline-block;
  margin-top: 52px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  padding: 15px 42px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 4px;
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(74, 74, 74, 0.85);
  transition: all 0.15s ease;
  user-select: none;
}
.btn-solid:hover {
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(74, 74, 74, 0.85);
}
.btn-solid:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 rgba(74, 74, 74, 0.85);
}

/* ---------- 主页个人信息板块 ---------- */
.profile-section { padding: 72px 0 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  border-bottom: var(--border);
  padding-bottom: 12px;
}
.section-head .no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white);
  background: var(--black);
  padding: 3px 8px;
  letter-spacing: 1px;
  line-height: 1.2;
  border-radius: 5px;
  box-shadow: 2px 2px 0 rgba(74, 74, 74, 0.35);
}
.section-head h2 {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 3px;
}
.section-head .en {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gray-400);
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.profile-item {
  border-left: var(--border);
  padding: 40px 20px 36px;
  text-align: center;
  background-image: var(--grain);
  background-color: var(--white);
  background-blend-mode: multiply;
  color: var(--black);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.02);
  transition: background-color 0.25s, box-shadow 0.25s;
  position: relative;
}

/* hover：背景加深 + 底部印刷投影 */
.profile-item:hover {
  background-color: var(--gray-50);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 0 rgba(74, 74, 74, 0.9);
}

.profile-item .idx {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--white);
  background: var(--black);
  padding: 2px 7px;
  line-height: 1.3;
  border-radius: 5px;
}

.profile-item .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gray-400);
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
  transition: color 0.25s;
}
.profile-item:hover .label { color: var(--black); }

.profile-item .value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}

.hobby-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.hobby-tags span {
  border: 1px solid var(--black);
  padding: 4px 14px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--black);
  background: var(--white);
  border-radius: 999px;
}
.hobby-tags span:nth-child(even) { background: var(--black); color: var(--white); }

/* ---------- 文章列表 ---------- */
.posts-section { padding: 48px 0; }

.post-list { list-style: none; }

.post-item {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 28px 4px;
  border-bottom: 1px solid var(--gray-200);
  transition: padding-left 0.25s;
}
.post-item:hover { padding-left: 12px; }

.post-item .date {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-400);
  letter-spacing: 1px;
  width: 96px;
}

.post-item .title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.4;
}
.post-item .title:hover { text-decoration: underline; }

.post-item .excerpt {
  margin-top: 6px;
  font-size: 14px;
  color: var(--gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-item .meta {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--gray-400);
}
.post-item .meta .tag {
  border: 1px solid var(--gray-200);
  padding: 1px 10px;
  letter-spacing: 1px;
}
.post-item .meta .tag:hover {
  border-color: var(--black);
  color: var(--black);
  text-decoration: none;
}

.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--gray-400);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--gray-200);
}

/* ---------- 标签筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.filter-bar button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 16px;
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-bar button:hover { border-color: var(--black); color: var(--black); }
.filter-bar button.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ---------- 文章详情 ---------- */
.article-hero {
  padding: 64px 0 40px;
  border-bottom: var(--border);
}
.article-hero .kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gray-400);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.article-hero h1 {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.3;
  letter-spacing: 2px;
}
.article-hero .article-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-400);
  letter-spacing: 1px;
}
.article-hero .article-meta .tag { color: var(--gray-600); border: 1px solid var(--gray-200); padding: 1px 10px; }

/* Markdown 正文排版 */
.article-body {
  padding: 48px 0 24px;
  max-width: 720px;
}

.article-body h1, .article-body h2, .article-body h3 {
  font-family: var(--display);
font-family: var(--serif);
letter-spacing: 1px;
line-height: 1.4;
margin: 2em 0 0.8em;
position: relative;
}
.article-body h4, .article-body h5, .article-body h6 {
  font-family: var(--serif);
font-family: var(--serif);
letter-spacing: 1px;
line-height: 1.4;
margin: 2em 0 0.8em;
position: relative;
}
.article-body h1 { font-size: 30px; border-bottom: 1px solid var(--gray-200); padding-bottom: 10px; }
.article-body h2 { font-size: 24px; border-bottom: 1px solid var(--gray-200); padding-bottom: 8px; }
.article-body h3 { font-size: 20px; }
.article-body h4 { font-size: 17px; }
.article-body h5, .article-body h6 { font-size: 15px; color: var(--gray-600); }

.article-body p { margin: 1.2em 0; font-size: 16px; }

.article-body strong { font-weight: 700; }

.article-body em { font-style: italic; }

.article-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--black);
  color: var(--gray-600);
  font-family: var(--serif);
  font-style: italic;
}
.article-body blockquote p { margin: 0.4em 0; }

.article-body ul, .article-body ol {
  margin: 1.2em 0;
  padding-left: 28px;
}
.article-body li { margin: 0.4em 0; }

.article-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--gray-100);
  padding: 2px 6px;
  border: 1px solid var(--gray-200);
}

.article-body pre {
  margin: 1.6em 0;
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { background: var(--black); color: var(--white); text-decoration: none; }

.article-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2.4em 0;
}

.article-body img {
  margin: 1.6em auto;
  border: 1px solid var(--gray-200);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 14px;
}
.article-body th, .article-body td {
  border: 1px solid var(--gray-200);
  padding: 8px 12px;
  text-align: left;
}
.article-body th {
  background: var(--gray-50);
  font-family: var(--serif);
  letter-spacing: 1px;
}

/* 文章导航 */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 56px 0 0;
  padding-top: 24px;
  border-top: var(--border);
  font-size: 14px;
}
.article-nav a { color: var(--gray-600); letter-spacing: 1px; }
.article-nav a:hover { color: var(--black); }

/* ---------- 标签分类页 ---------- */
.tags-hero { padding: 72px 0 40px; border-bottom: var(--border); }
.tags-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: 4px;
}

.tag-cloud {
  padding: 48px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: var(--border);
}
.tag-cloud a {
  border: 1px solid var(--gray-400);
  padding: 8px 22px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--gray-600);
  transition: all 0.2s;
}
.tag-cloud a:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
  text-decoration: none;
}
.tag-cloud a .count { font-family: var(--mono); font-size: 11px; margin-left: 6px; opacity: 0.7; }

.tag-group { padding: 40px 0; border-bottom: 1px solid var(--gray-200); }
.tag-group h3 {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.tag-group h3::before { content: "# "; color: var(--gray-400); }
.tag-group ul { list-style: none; }
.tag-group li { padding: 10px 0; border-bottom: 1px dashed var(--gray-200); }
.tag-group li a { display: flex; gap: 20px; align-items: baseline; }
.tag-group .d { font-family: var(--mono); font-size: 12px; color: var(--gray-400); flex-shrink: 0; }
.tag-group .t { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; }

/* ---------- 关于页 ---------- */
.about-hero { padding: 72px 0 40px; border-bottom: var(--border); }
.about-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: 4px;
}

.about-card {
  margin: 48px 0;
  border: var(--border);
  display: grid;
  grid-template-columns: 220px 1fr;
  background-image: var(--grain);
  background-color: var(--white);
  background-blend-mode: multiply;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  overflow: hidden;
}
.about-avatar {
  border-right: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 64px;
  background: var(--gray-50);
  padding: 40px 0;
}
.about-info { padding: 40px; }
.about-info h2 {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.about-info .role {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gray-400);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.about-table { width: 100%; border-collapse: collapse; }
.about-table th {
  width: 88px;
  text-align: left;
  font-weight: 400;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gray-400);
  padding: 10px 0;
  vertical-align: top;
}
.about-table td { padding: 10px 0; font-size: 15px; }
.about-table td .hobby {
  display: inline-block;
  border: 1px solid var(--black);
  padding: 2px 12px;
  margin: 2px 6px 2px 0;
  font-size: 13px;
  border-radius: 999px;
}

.about-text {
  max-width: 720px;
  padding-bottom: 40px;
}
.about-text p { margin: 1.4em 0; font-size: 16px; color: var(--gray-900); }
.about-text h2 {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 2px;
  margin: 2em 0 0.6em;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
}
.about-text ul { margin: 1em 0; padding-left: 28px; }
.about-text li { margin: 0.4em 0; color: var(--gray-900); }

/* ---------- 简笔画小动物装饰 ---------- */
.doodle {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  animation: floaty 6s ease-in-out infinite;
}
.doodle svg { width: 100%; height: 100%; display: block; }

/* 位置 */
.doodle-cat-l  { top: 26px;   left: 4%;  width: 86px; }
.doodle-rabbit-r { bottom: 26px; right: 4%;  width: 82px; }
.doodle-rabbit-l { top: 26px;   left: 4%;  width: 80px; }
.doodle-dog-r  { top: 38px;   right: 4%;  width: 92px; }
.doodle-cat-r  { bottom: 30px; right: 5%;  width: 84px; }
.doodle-dog-br { bottom: 36px; right: 5%;  width: 96px; }
.doodle-bird-l { bottom: 34px; left: 4%;  width: 84px; }
.doodle-fox-l  { top: 26px;   left: 4%;  width: 90px; }
.doodle-panda-r { top: 26px;  right: 4%;  width: 86px; }
.doodle-butterfly-r { top: 66px; right: 6%; width: 72px; }
.doodle-turtle-l { bottom: 36px; left: 5%; width: 98px; }
.doodle-hedgehog-r { bottom: 40px; right: 5%; width: 102px; }
.doodle-frog-tl { top: 34px;  left: 4%; width: 88px; }
.doodle-bee-br { bottom: 34px; right: 4%; width: 78px; }
.doodle-duck-br { bottom: 34px; right: 4%; width: 86px; }
.doodle-squirrel-bl { bottom: 34px; left: 4%; width: 84px; }
.doodle-penguin-br { bottom: 34px; right: 4%; width: 74px; }

.profile-section { position: relative; }
.about-hero { position: relative; }
.about-section { position: relative; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--black);
  background: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 90;
}
.back-top:hover { background: var(--black); color: var(--white); }
.back-top.show { display: flex; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .doodle { display: none; }

  .site-header .container { height: 56px; }
  .logo { font-size: 18px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }

  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-item { border-top: var(--border); }
  .profile-item:nth-child(-n+2) { border-top: none; }
  .profile-item:nth-child(odd) { border-left: none; }

  .post-item { flex-direction: column; gap: 8px; }
  .post-item .date { width: auto; }

  .about-card { grid-template-columns: 1fr; }
  .about-avatar { border-right: none; border-bottom: var(--border); padding: 32px 0; }

  .article-nav { flex-direction: column; }
}
