/* 1hour.win — clean modern Chinese blog theme.
   system-ui stack, single 720px column, responsive, automatic dark mode. */

:root {
  --max-w: 720px;
  --fg: #1f2328;
  --fg-soft: #59636e;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --border: #d8dee4;
  --accent: #0969da;
  --accent-soft: #ddf4ff;
  --code-bg: #f6f8fa;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6edf3;
    --fg-soft: #9198a1;
    --bg: #0d1117;
    --bg-soft: #161b22;
    --border: #30363d;
    --accent: #4493f8;
    --accent-soft: #121d2f;
    --code-bg: #161b22;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg);
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Screen-reader-only content (e.g. the home listing's h1). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header / footer ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
  margin-bottom: 32px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.site-title:hover { color: var(--accent); text-decoration: none; }

.site-desc { margin: 4px 0 0; color: var(--fg-soft); font-size: 0.95rem; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding: 20px 0 32px;
  color: var(--fg-soft);
  font-size: 0.9rem;
}
.site-links { display: flex; gap: 10px; flex-wrap: wrap; }
.site-copy { margin: 8px 0 0; }

/* ---------- post list ---------- */

.post-card { padding: 20px 0 16px; border-bottom: 1px solid var(--border); }
.post-list > .post-card:first-child { padding-top: 0; }

.post-card-title { margin: 0; font-size: 1.25rem; line-height: 1.5; }
.post-card-title a { color: var(--fg); }
.post-card-title a:hover { color: var(--accent); }

.post-card-meta { margin: 4px 0 8px; color: var(--fg-soft); font-size: 0.88rem; }

.post-card-excerpt { margin: 0; color: var(--fg-soft); font-size: 0.95rem; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 8px;
}
.pagination a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pagination a:hover { background: var(--bg-soft); text-decoration: none; }
.pg-num { color: var(--fg-soft); font-size: 0.9rem; }

/* ---------- archive head ---------- */

.archive-head { margin-bottom: 12px; }
.archive-title { margin: 0; font-size: 1.4rem; }
.archive-count { margin: 4px 0 0; color: var(--fg-soft); font-size: 0.9rem; }

/* ---------- post page ---------- */

.post-title { margin: 0 0 12px; font-size: 1.65rem; line-height: 1.45; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--fg-soft);
  font-size: 0.88rem;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tag-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 0 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.7;
}
.tag-chip:hover { border-color: var(--accent); text-decoration: none; }

.post-content { word-wrap: break-word; overflow-wrap: break-word; }
.post-content img { max-width: 100%; height: auto; }
/* Underline in-body links so they stay distinguishable from body text,
   especially in dark mode where the accent blue sits close to the fg grey. */
.post-content a { text-decoration: underline; }
.post-content a:hover { text-decoration: underline; }
.post-content blockquote {
  margin: 1.2em 0;
  padding: 2px 16px;
  border-left: 4px solid var(--border);
  color: var(--fg-soft);
  background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
}
.post-content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 6px 10px; }

/* code blocks (highlight.js theme colors apply via hl-* classes) */
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
.post-content :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
}
.post-content pre code { background: none; border: 0; padding: 0; }
/* highlight.js themes ship `pre code.hljs { padding: 1em }`, which ties with
   the rule above and loads later — that stacked the <pre> padding on top of
   the theme padding. Out-specify it so padding lives on <pre> only. */
.post-content pre code.hljs { padding: 0; }

/* ---------- telegram box ---------- */

.tg-box {
  margin-top: 40px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 0.92rem;
}

/* ---------- comments ---------- */

.comments { margin-top: 48px; }
.comments-title { font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-meta { color: var(--fg-soft); font-size: 0.85rem; display: flex; gap: 10px; flex-wrap: wrap; }
.comment-author { color: var(--fg); font-weight: 600; }
/* Long pingback titles / URLs must not overflow the 720px column. */
.comment-author, .comment-content, .post-card-excerpt { overflow-wrap: anywhere; }
.c-kind {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 0.78rem;
}
.comment-content { margin-top: 6px; font-size: 0.95rem; }
.comment.pingback .comment-content { color: var(--fg-soft); font-size: 0.88rem; }

/* ---------- 404 ---------- */

.notfound { text-align: center; padding: 48px 0; }
.notfound-code { font-size: 4.5rem; margin: 0; color: var(--fg-soft); }
.notfound-text { color: var(--fg-soft); }
.notfound-home {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.notfound-home:hover { background: var(--bg-soft); text-decoration: none; }
