/* ===========================================================
   simple — 浅色极简主题
   无动画 / 无渐变 / 无阴影，只有排版
   =========================================================== */

:root {
  --bg:            #fcfcfb;
  --fg:            #24292f;
  --fg-soft:       #3d444d;
  --muted:         #6b7280;
  --faint:         #9aa1ab;
  --border:        #e6e7ea;
  --border-strong: #d4d7dc;
  --link:          #1a5fb4;
  --link-hover:    #0d3f80;
  --inline-bg:     #f1f2f4;
  --select:        #dbeafe;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
               "DejaVu Sans Mono", "Courier New", monospace;

  --width: 1100px;   /* 页面外框 */
  --prose: 900px;    /* 文章正文阅读宽度，在宽容器里居中 */
  --radius: 6px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection { background: var(--select); }

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 24px;
}

main.wrap {
  flex: 1 0 auto;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--fg);
  letter-spacing: 0;
}
.site-title:hover { color: var(--fg); text-decoration: none; }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
}
.site-nav a {
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.site-nav a.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* ---------- post list ---------- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  padding: 0 0 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: 0; margin-bottom: 0; }

.post-item-title {
  margin: 0 0 0.45rem;
  font-size: 1.4rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0;
}
.post-item-title a { color: var(--fg); }
.post-item-title a:hover { color: var(--link); text-decoration: none; }

.post-item-meta {
  font-size: 0.82rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.7rem;
}
.post-item-meta a { color: var(--faint); }
.post-item-meta a:hover { color: var(--link); text-decoration: none; }

.sep { margin: 0 0.45em; color: var(--border-strong); }

.post-item-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.72;
}

/* ---------- page header ---------- */
.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: 0;
}
.page-desc {
  margin: 0;
  color: var(--faint);
  font-size: 0.85rem;
}

/* ---------- archive / tag lists ---------- */
.archive-year {
  margin: 2.5rem 0 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.archive-year:first-of-type { margin-top: 0; }

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.archive-list li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
}
.archive-list li:last-child { border-bottom: 0; }
.archive-list time {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.archive-list a { color: var(--fg-soft); }
.archive-list a:hover { color: var(--link); text-decoration: none; }

/* ---------- tag cloud ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tag-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  line-height: 1.45;
  background: #f2f3f5;
}

/* 尺寸跟着文章数走，排出来自然高低不齐 */
.tag-chip.s-sm { font-size: 0.82rem; padding: 3px 9px; }
.tag-chip.s-md { font-size: 0.92rem; padding: 5px 12px; }
.tag-chip.s-lg { font-size: 1.05rem; padding: 7px 15px; font-weight: 600; }

/* 8 组柔和配色：浅底深字，对比度够，不抢正文 */
.tag-chip.c0 { background: #eef4ff; color: #1a4f9e; border-color: #dbe7fc; }
.tag-chip.c1 { background: #edfaf1; color: #15693e; border-color: #d3f0df; }
.tag-chip.c2 { background: #f5f0ff; color: #5533a6; border-color: #e6dcfb; }
.tag-chip.c3 { background: #fff4e9; color: #9c4f16; border-color: #fae3cc; }
.tag-chip.c4 { background: #e9f8f7; color: #0d6666; border-color: #cfeeec; }
.tag-chip.c5 { background: #fdeff4; color: #a02a58; border-color: #f8d9e4; }
.tag-chip.c6 { background: #fdf7e3; color: #7f6209; border-color: #f5eac4; }
.tag-chip.c7 { background: #eff3f7; color: #3a5568; border-color: #dde6ee; }

.tag-chip:hover { filter: brightness(0.955); text-decoration: none; }

.tag-count {
  font-size: 0.72em;
  opacity: 0.6;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ---------- article ---------- */
/* 文章正文比页面外框窄，但明显宽于传统博客的 700px ；居中读起来才平衡 */
.post,
.post-nav {
  width: 100%;
  max-width: var(--prose);
  margin-left: auto;
  margin-right: auto;
}

.post-header { margin-bottom: 2.5rem; }

.post-title {
  margin: 0 0 0.7rem;
  font-size: 2.05rem;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.post-meta {
  font-size: 0.84rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.post-meta a { color: var(--faint); }
.post-meta a:hover { color: var(--link); text-decoration: none; }

.post-content {
  font-size: 1rem;
  line-height: 1.85;
}

.post-content > *:first-child { margin-top: 0; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--fg);
}

.post-content h1 { font-size: 1.7rem;  margin: 2.8rem 0 1.1rem; }
.post-content h2 { font-size: 1.45rem; margin: 2.8rem 0 1.1rem; font-weight: 650; }
.post-content h3 { font-size: 1.18rem; margin: 2.2rem 0 0.85rem; font-weight: 650; }
.post-content h4 { font-size: 1rem;    margin: 1.6rem 0 0.6rem; font-weight: 650; color: var(--fg-soft); }

.post-content h2 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* 标题锚点：平时不显示，悬停才出现 */
.post-content .headerlink {
  margin-left: 0.35em;
  color: var(--border-strong);
  text-decoration: none;
  opacity: 0;
}
.post-content .headerlink::before { content: '#'; }
.post-content h1:hover .headerlink,
.post-content h2:hover .headerlink,
.post-content h3:hover .headerlink,
.post-content h4:hover .headerlink { opacity: 1; }

.post-content p { margin: 0 0 1.4rem; }

.post-content ul,
.post-content ol { margin: 0 0 1.4rem; padding-left: 1.5rem; }
.post-content li { margin: 0.35rem 0; }
.post-content li > ul,
.post-content li > ol { margin: 0.35rem 0 0.35rem; }

.post-content blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}
.post-content blockquote > *:last-child { margin-bottom: 0; }

.post-content a { text-decoration: underline; text-decoration-color: var(--border-strong); }
.post-content a:hover { text-decoration-color: var(--link-hover); }

/* 行内代码 */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--inline-bg);
  color: #b02a37;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  word-break: break-word;
}

/* 表格 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.post-content th {
  background: #f7f7f6;
  font-weight: 620;
  color: var(--fg-soft);
}

/* ---------- 介绍页截图 ---------- */
.post-content .shot {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 1.6rem auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}

.post-content .shots {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  justify-content: center;
  margin: 1.9rem 0;
}
.post-content .shots .shot {
  flex: 0 1 165px;
  max-width: 165px;
  margin: 0;
}

@media (max-width: 640px) {
  .post-content .shots .shot { flex: 0 1 30%; max-width: 30%; }
}

/* 小程序码：白底方图，不要框 */
.post-content .shot.qr {
  max-width: 160px;
  border: none;
  border-radius: 0;
  background: #fff;
  margin: 2rem auto 1rem;
}

/* 二维码 + 说明：左图右文，别让图独占一行 */
.post-content .qr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 2rem 0;
}
.post-content .qr-row .shot.qr {
  flex: 0 0 160px;
  margin: 0;
}
.post-content .qr-row > div {
  flex: 0 1 330px;
}
.post-content .qr-row p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.post-content .qr-row p:last-child { margin-bottom: 0; }
.post-content .qr-row strong { color: var(--fg); }

/* 图片注脚 */
.post-content img + em,
.post-content p > img:only-child { display: block; }

/* ---------- post tags / nav ---------- */
.post-tags {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
}
.post-tags a { color: var(--muted); }
.post-tags a:hover { color: var(--link); text-decoration: none; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}
.post-nav a { color: var(--muted); display: block; }
.post-nav a:hover { color: var(--link); text-decoration: none; }
.post-nav-next { text-align: right; }
.post-nav-label { display: block; font-size: 0.76rem; color: var(--faint); margin-bottom: 0.15rem; }
.post-nav-title { display: block; color: var(--fg-soft); line-height: 1.5; }
.post-nav a:hover .post-nav-title { color: var(--link); }

/* ---------- pager ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.pager a {
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--fg-soft);
}
.pager a:hover {
  border-color: var(--link);
  color: var(--link);
  text-decoration: none;
}
.pager-info {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  font-size: 0.82rem;
  color: var(--faint);
  flex-shrink: 0;
}
.site-footer p { margin: 0 0 0.3rem; }
.site-footer a { color: var(--faint); }
.site-footer a:hover { color: var(--link); text-decoration: none; }
.site-footer .icp { font-size: 0.76rem; }

/* ---------- responsive ---------- */
/* 中等屏幕：外框收进来，正文仍占满可用宽度 */
@media (max-width: 1024px) {
  .wrap { padding: 0 28px; }
  .post, .post-nav { max-width: 100%; }
  .post-content { line-height: 1.82; }
}

/* 超宽屏：正文两侧留白更多，但外框不再变宽 */
@media (min-width: 1400px) {
  main.wrap { padding-top: 3.5rem; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 20px; }
  main.wrap { padding-top: 2rem; padding-bottom: 3.5rem; }

  .header-inner { padding-top: 1.2rem; padding-bottom: 1.2rem; gap: 12px; }
  .site-nav { gap: 16px; }

  .post-title { font-size: 1.45rem; }
  .post-item-title { font-size: 1.12rem; }
  .post-content h2 { font-size: 1.18rem; }
  .post-content h3 { font-size: 1.05rem; }
  .post-content { line-height: 1.8; }

  .post-nav { grid-template-columns: 1fr; gap: 14px; }
  .post-nav-next { text-align: left; }

  .archive-list li { flex-wrap: wrap; gap: 6px; }
}

@media print {
  .site-header, .site-footer, .post-nav, .pager, .post-tags { display: none; }
  body { background: #fff; color: #000; }
}
