/* ============================================================
   geekh个人随笔集
   意象：一叠红格稿纸，一支蘸着蓝黑墨水的笔
   ============================================================ */

:root {
  --paper:     #f6f7f1;  /* 月白纸 */
  --ink:       #263a48;  /* 蓝黑墨水 */
  --ink-faint: #5f6e7a;  /* 淡墨 */
  --red:       #b23b2e;  /* 稿纸朱格 */
  --line:      #d9dcd0;  /* 铅灰细线 */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --sans:  "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --kai:   "Kaiti SC", "KaiTi", "STKaiti", "DFKai-SB", serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(178, 59, 46, .16); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  position: fixed; top: 12px; left: 12px; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 8px 16px; font-size: .9rem; text-decoration: none;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 20px; }

/* ---------- 页眉 ---------- */

.site-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 30px;
}
.site-name {
  font-family: var(--serif); font-weight: 700; font-size: 1.1rem;
  letter-spacing: .04em; text-decoration: none;
}
.site-nav a {
  margin-left: 24px; font-size: .95rem;
  color: var(--ink-faint); text-decoration: none;
}
.site-nav a:hover { color: var(--red); }
.site-nav a[aria-current] {
  color: var(--ink);
  border-bottom: 2px solid var(--red); padding-bottom: 2px;
}

/* ---------- 首页：稿纸题头 ---------- */

.hero {
  position: relative;
  margin-top: 30px;
  padding: clamp(34px, 6vw, 54px) clamp(26px, 5vw, 50px);
  border: 1px solid rgba(178, 59, 46, .5);
  outline: 1px solid rgba(178, 59, 46, .2);
  outline-offset: -8px;
  background-color: rgba(178, 59, 46, .024);
  background-image:
    linear-gradient(rgba(178, 59, 46, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(178, 59, 46, .09) 1px, transparent 1px);
  background-size: 26px 26px;
}
.hero-title {
  margin: 0; max-width: 11em;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.7rem, 4.4vw, 2.35rem);
  line-height: 1.6; letter-spacing: .05em;
}
.hero-text {
  margin: 18px 0 0; max-width: 30em;
  font-size: .98rem; color: var(--ink-faint);
}
.hero-count { margin: 26px 0 0; font-size: .88rem; color: var(--ink-faint); }
.hero-note {
  position: absolute;
  top: clamp(34px, 6vw, 54px); right: clamp(26px, 5vw, 50px);
  writing-mode: vertical-rl;
  font-family: var(--kai); font-size: 1.02rem;
  letter-spacing: .55em; color: var(--red);
}
@media (max-width: 700px) { .hero-note { display: none; } }

/* ---------- 首页：文章列表 ---------- */

.post-list { list-style: none; margin: 54px 0 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a {
  display: flex; gap: 30px;
  padding: 26px 4px; text-decoration: none;
}
.post-meta { flex: none; width: 9em; padding-top: .3em; }
.post-date { font-size: .85rem; color: var(--ink-faint); }
.post-cat {
  display: block; margin-top: 5px;
  font-family: var(--kai); font-size: .85rem; color: var(--red);
}
.post-body { min-width: 0; }
.post-title {
  display: block;
  font-family: var(--serif); font-weight: 700;
  font-size: 1.2rem; line-height: 1.55;
  transition: color .15s;
}
.post-list a:hover .post-title { color: var(--red); }
.post-excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px; font-size: .92rem; line-height: 1.8; color: var(--ink-faint);
}
@media (max-width: 700px) {
  .post-list a { flex-direction: column; gap: 8px; padding: 22px 2px; }
  .post-meta { width: auto; padding-top: 0; display: flex; align-items: baseline; gap: 14px; }
  .post-cat { margin-top: 0; }
}

/* ---------- 文章页 ---------- */

.article { padding-top: 46px; }
.back {
  display: inline-block; margin-bottom: 38px;
  font-size: .9rem; color: var(--ink-faint); text-decoration: none;
}
.back:hover { color: var(--red); }
.a-cat { margin: 0; font-family: var(--kai); font-size: .95rem; color: var(--red); }
.a-title {
  margin: 12px 0 14px;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.5; letter-spacing: .02em;
}
.a-date { margin: 0; font-size: .9rem; color: var(--ink-faint); }
.a-head { border-bottom: 1px solid var(--line); padding-bottom: 30px; }
.a-body { margin-top: 42px; font-size: 1.03rem; }
.a-body p { margin: 0 0 1.35em; text-indent: 2em; line-height: 2.05; }
.a-body blockquote {
  margin: 2em 0; padding: .2em 0 .2em 1.2em;
  border-left: 3px solid rgba(178, 59, 46, .55);
  font-family: var(--kai); color: rgba(38, 58, 72, .82); text-indent: 0;
}
.a-end {
  margin-top: 3.4em; text-align: center;
  font-size: .9rem; letter-spacing: .4em; color: var(--ink-faint);
}
.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 60px; padding-top: 26px;
  border-top: 1px solid var(--line); font-size: .95rem;
}
.pager a { color: var(--ink); text-decoration: none; }
.pager a:hover { color: var(--red); }
.pager .off { color: var(--ink-faint); }

/* ---------- 关于页 ---------- */

.cat-list { margin: 1.6em 0 0; padding: 0; }
.cat-list dt { font-family: var(--kai); color: var(--red); }
.cat-list dd { margin: 2px 0 14px; color: var(--ink-faint); font-size: .95rem; line-height: 1.8; }

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 76px; border-top: 1px solid var(--line);
  padding: 22px 20px 46px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .85rem; color: var(--ink-faint);
}

/* ---------- 动效（仅一处） ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero { animation: rise .55s ease-out both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* footer 备案号链接 */
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--red); }
