/*
Theme Name: geekcraft
Theme URI: https://dkjsiogu.cn
Author: dkjsiogu
Description: 极简暗色个人博客 — 克制、安静、专注阅读。一点像素,一点绿色。
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: geekcraft
*/

:root {
  --bg: #0e1116;
  --bg-soft: #12161d;
  --panel: #161b23;
  --border: #232a35;
  --border-soft: #1b212b;
  --text: #e8ecf3;
  --muted: #9aa5b5;
  --faint: #5c6a7d;
  --accent: #4ade80;
  --accent-dim: #1f3d2c;
  --blue: #60a5fa;
  --yellow: #fbbf24;
  --pink: #f472b6;
  --red: #f87171;
  --purple: #a78bfa;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --content-width: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(74,222,128,.25); color: var(--text); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2e3a4c; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #7ce89c; }

img { max-width: 100%; height: auto; }

/* ============ 顶栏 ============ */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14,17,22,.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-logo {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--text);
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.site-logo::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(74,222,128,.2);
}
.site-logo:hover { color: var(--accent); }

.header-nav { display: flex; gap: 18px; font-size: 14px; }
.header-nav a { color: var(--muted); }
.header-nav a:hover { color: var(--accent); }
.header-nav .current a { color: var(--accent); }

.header-search {
  margin-left: auto;
  flex-shrink: 0;
}
.header-search form { display: flex; align-items: center; gap: 6px; }
.header-search input {
  width: 130px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 10px;
  font-family: var(--mono);
  outline: none;
  transition: border-color .15s, width .2s;
}
.header-search input:focus { border-color: var(--accent); width: 180px; }
.header-search input::placeholder { color: var(--faint); }
.header-search button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.header-search button:hover { color: var(--accent); }

/* ============ 首页 Hero ============ */
.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 64px 20px 40px;
  text-align: left;
}
.hero h1 {
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 14px;
}
.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 520px;
}
.hero .pixel-line {
  margin-top: 28px;
  height: 4px;
  width: 42px;
  background: var(--accent);
}

/* ============ 内容区 ============ */
.main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* 文章列表 */
.post-list { list-style: none; }
.post-item {
  padding: 26px 0;
  border-bottom: 1px solid var(--border-soft);
}
.post-item:first-child { padding-top: 8px; }
.post-item:last-child { border-bottom: none; }
.post-item .post-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.post-item .post-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}
.post-item .post-title a { color: var(--text); }
.post-item .post-title a:hover { color: var(--accent); }
.post-item .post-excerpt {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}
.post-item .post-excerpt code {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--blue);
  background: none;
  padding: 0;
}
.post-item .post-meta {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
  font-family: var(--mono);
}
.post-item .post-meta a { color: var(--faint); }
.post-item .post-meta a:hover { color: var(--accent); }
.post-item .post-meta .dot { margin: 0 8px; color: var(--border); }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 13px;
}
.pagination a, .pagination span {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { border-color: var(--accent); color: var(--accent); background: rgba(74,222,128,.08); }

/* ============ GitHub 日报 (装饰性小板块) ============ */
.daily-mini {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.daily-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.daily-mini-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.daily-mini-title::before {
  content: "▪";
  color: var(--accent);
  margin-right: 7px;
  font-size: 10px;
}
.daily-mini-more {
  font-size: 12.5px;
  color: var(--faint);
}
.daily-mini-more:hover { color: var(--accent); }
.daily-mini-list { list-style: none; }
.daily-mini-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
}
.daily-mini-list li:last-child { border-bottom: none; }
.daily-mini-list .dm-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  flex-shrink: 0;
  min-width: 40px;
}
.daily-mini-list a {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.daily-mini-list a:hover { color: var(--accent); }

/* ============ 仓库区块 ============ */
.repos-block {
  margin-top: 40px;
  border-top: 1px solid var(--border-soft);
  padding-top: 28px;
}
.repos-block h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.repos-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.repo-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  margin-right: 24px;
}
.repo-item:nth-child(odd) { margin-right: 24px; }
.repo-item:nth-child(even) { margin-right: 0; }
.repo-item a.name { color: var(--text); font-size: 14.5px; font-weight: 600; }
.repo-item a.name:hover { color: var(--accent); }
.repo-item .desc {
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.6;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repo-item .lang { color: var(--blue); }
.repo-item .meta { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 4px; }
@media (max-width: 640px) {
  .repos-list { grid-template-columns: 1fr; }
  .repo-item, .repo-item:nth-child(odd) { margin-right: 0; }
}

/* ============ 文章页 ============ */
.article-wrap { max-width: var(--content-width); margin: 0 auto; padding: 0 20px 80px; }
.article-head { padding: 48px 0 26px; }
.article-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.3px;
  margin-bottom: 16px;
}
.article-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.article-meta a { color: var(--faint); }
.article-meta a:hover { color: var(--accent); }
.article-meta .dot { margin: 0 12px; color: var(--border); }

.article-body {
  padding-top: 10px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
}
.article-body p { margin: 0 0 1.4em; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-weight: 700;
  line-height: 1.5;
  margin: 2.2em 0 .9em;
  letter-spacing: -.2px;
}
.article-body h2 { font-size: 23px; padding-bottom: .45em; border-bottom: 1px solid var(--border-soft); }
.article-body h3 { font-size: 19px; }
.article-body h4 { font-size: 16.5px; color: var(--accent); }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--accent-dim);
  background: var(--bg-soft);
  padding: 12px 20px;
  margin: 0 0 1.4em;
  color: var(--muted);
  border-radius: 0 4px 4px 0;
}
.article-body blockquote p { margin: 0; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { border-bottom: 1px solid rgba(74,222,128,.3); }
.article-body a:hover { border-bottom-color: var(--accent); }
.article-body img {
  display: block;
  border: 1px solid #2e3a4e;
  border-radius: 8px;
  margin: 1.4em auto;
  background: #0b0e13;
  box-shadow: 0 0 0 5px rgba(79,209,255,.05), 0 8px 28px rgba(0,0,0,.55);
  transition: border-color .2s, box-shadow .2s;
}
.article-body img:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(74,222,128,.12), 0 10px 32px rgba(0,0,0,.6);
}
.article-body .lightbox-wrapper { margin: 1.4em auto; text-align: center; }
.article-body .lightbox-wrapper img { margin: 0; display: inline-block; max-width: 100%; }
.article-body .lightbox { position: relative; display: inline-block; }
.article-body .lightbox::after {
  content: "⛶ 点击查看原图";
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,.72);
  padding: 3px 10px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.article-body .lightbox:hover::after { opacity: 1; }
.article-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 2.4em 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 14.5px;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 8px 14px;
  text-align: left;
}
.article-body th { background: var(--bg-soft); color: var(--text); font-weight: 600; }
.article-body tr:nth-child(even) td { background: rgba(22,27,35,.4); }

/* 代码块 — 安静的高亮 */
.article-body pre {
  background: #0b0e13;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 1.4em;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.8;
  color: #c9d4e3;
}
.article-body code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--bg-soft);
  color: var(--blue);
  padding: 1px 6px;
  border-radius: 3px;
}
.article-body pre code { background: none; padding: 0; color: inherit; border-radius: 0; }

.hl-kw { color: #f472b6; }
.hl-str { color: #86efac; }
.hl-com { color: #5c6a7d; font-style: italic; }
.hl-num { color: #fb923c; }
.hl-pre { color: #a78bfa; }
.hl-fn { color: #7dd3fc; }
.hl-type { color: #fbbf24; }

/* 文章底部导航 */
.article-foot {
  margin-top: 50px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.article-foot a { color: var(--muted); }
.article-foot a:hover { color: var(--accent); }
.article-foot .prev, .article-foot .next { max-width: 46%; }
.article-foot .next { text-align: right; margin-left: auto; }
.article-foot .label { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 3px; }

/* 评论 */
.comments-wrap { max-width: var(--content-width); margin: 0 auto; padding: 0 20px 80px; }
.comments-window { border-top: 1px solid var(--border-soft); padding-top: 26px; }
.comments-window h3 { font-size: 16px; margin-bottom: 18px; }
.comments-window h3::before { content: "▍"; color: var(--accent); margin-right: 6px; }
.comment-list { list-style: none; }
.comment-list .comment { border-bottom: 1px dashed var(--border-soft); padding: 14px 0; }
.comment-list .comment-author { font-weight: 600; font-size: 14.5px; }
.comment-list .comment-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin: 2px 0 8px; }
.comment-list .comment-content { font-size: 14.5px; color: var(--muted); }
.comment-form label { font-size: 13.5px; color: var(--muted); display: block; margin: 14px 0 5px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 9px 13px;
  outline: none;
  transition: border-color .15s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form .submit { margin-top: 16px; }
.comment-form .submit input {
  background: var(--accent);
  color: #06230f;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 24px;
  cursor: pointer;
  transition: background .15s;
}
.comment-form .submit input:hover { background: #7ce89c; }

/* ============ 归档/搜索页头 ============ */
.page-head { max-width: var(--content-width); margin: 0 auto; padding: 48px 20px 8px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head h1::before { content: "▍"; color: var(--accent); margin-right: 4px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 20px;
}
.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 30px 20px 40px;
  text-align: center;
}
.footer-inner .pixels {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 8px;
  margin-bottom: 12px;
}
.footer-inner .pixels .g { color: var(--accent); }
.footer-copy { font-size: 13px; color: var(--faint); }
.footer-copy b { color: var(--muted); font-weight: 600; }

/* ============ 404 ============ */
.err-wrap { max-width: var(--content-width); margin: 0 auto; padding: 90px 20px; text-align: center; }
.err-code { font-family: var(--pixel); font-size: 56px; color: var(--red); margin-bottom: 16px; text-shadow: 4px 4px 0 rgba(248,113,113,.12); }
.err-msg { color: var(--muted); font-size: 15px; margin-bottom: 30px; }
.err-actions { display: flex; justify-content: center; gap: 14px; }
.err-actions a, .err-actions button {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 22px;
  cursor: pointer;
  font-family: inherit;
}
.err-actions a:hover, .err-actions button:hover { border-color: var(--accent); color: var(--accent); }

/* ============ 滚动显现 (轻, 无 JS 时不影响阅读) ============ */
.reveal { transition: opacity .5s ease, transform .5s ease; }
html.js .reveal { opacity: 0; transform: translateY(12px); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .hero { padding: 44px 20px 30px; }
  .hero h1 { font-size: 18px; }
  .header-search { display: none; }
  .header-nav { gap: 14px; font-size: 13.5px; }
  .article-title { font-size: 22px; }
  .post-item .post-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
