/*
  Pixel Home · Blog
  与首页 index.html 共用视觉语言：Fusion Pixel + NES 暗色面板
*/

@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-12px-proportional-latin.ttf.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2190-21FF;
}
@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-12px-proportional-zh_hans.ttf.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg-0: #1a1c2c;
  --bg-1: #262b44;
  --ink: #eaeaea;
  --mute: #8b9bb4;
  --green: #38b764;
  --lime: #a7f070;
  --cyan: #41a6f6;
  --pink: #b55088;
  --gold: #f4b41b;
  --orange: #ef7d57;
  --frame: #212123;
  --font: "Fusion Pixel", "PingFang SC", "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font) !important;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  -webkit-font-smoothing: none;
  font-smooth: never;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(65, 166, 246, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 80%, rgba(181, 80, 136, 0.15), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 100%, rgba(56, 183, 100, 0.12), transparent 45%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 10px 10px, 10px 10px;
  image-rendering: pixelated;
}

a { color: var(--cyan); }
a:hover { color: var(--lime); }

.nes-container {
  padding: 14px 16px !important;
  margin: 0 !important;
  font-family: var(--font) !important;
}
.nes-container.is-dark { background: var(--bg-1); }
button, input, .nes-btn { font-family: var(--font) !important; }

.wrap {
  width: min(920px, 98vw);
  margin: 0 auto;
  padding: 10px 12px 12px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--frame);
  border: 4px solid #0d0d0f;
  box-shadow: 0 0 0 3px var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  text-decoration: none !important;
}
.brand h1 {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 20px);
  color: var(--lime);
  text-shadow: 3px 3px 0 #0d0d0f;
  white-space: nowrap;
}
.brand .sub {
  color: var(--mute);
  font-size: 13px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topnav a {
  text-decoration: none !important;
  color: var(--ink) !important;
  background: var(--bg-1);
  border: 3px solid #0d0d0f;
  padding: 8px 10px;
  font-size: 13px;
  box-shadow: 3px 3px 0 #0d0d0f;
  flex-shrink: 0;
}
.topnav a:hover,
.topnav a.is-active {
  color: var(--lime) !important;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #0d0d0f;
}
.topnav a.is-active {
  background: #1a2035;
  border-color: var(--cyan);
}

.panel {
  position: relative;
  background: var(--bg-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px -8px 14px;
  padding: 10px 12px;
  background: var(--frame);
  border-bottom: 4px solid #0d0d0f;
  color: var(--gold);
  font-size: 14px;
}
.panel-head .tag { color: var(--mute); font-size: 13px; }

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--lime);
  opacity: 0.35;
  pointer-events: none;
}
.panel::before { top: 8px; left: 8px; }
.panel::after { bottom: 8px; right: 8px; }

.blog-intro {
  color: var(--mute);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.8;
}
.blog-intro strong { color: var(--lime); font-weight: normal; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  background: #0d0d0f;
  border: 3px solid #3c3c41;
  padding: 14px 14px 12px;
  box-shadow: 3px 3px 0 #0d0d0f;
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2), border-color 0.1s steps(2);
}
.post-card:hover {
  border-color: var(--gold);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #0d0d0f;
  color: inherit !important;
}

.post-card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--mute);
}
.post-card .date {
  color: var(--cyan);
}
.post-card .chip {
  display: inline-block;
  padding: 2px 7px;
  border: 2px solid #0d0d0f;
  background: #3c3c41;
  color: var(--gold);
  font-size: 11px;
}
.post-card h2 {
  margin: 0 0 8px;
  font-size: clamp(16px, 2vw, 20px);
  color: #fff;
  line-height: 1.45;
}
.post-card:hover h2 { color: var(--lime); }
.post-card .excerpt {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.7;
}
.post-card .go {
  display: inline-block;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 12px;
}

.empty-log {
  padding: 24px 16px;
  text-align: center;
  color: var(--mute);
  border: 3px dashed #3c3c41;
  background: #0d0d0f;
}

/* —— 文章页 —— */
.post-page .panel-head { margin-bottom: 10px; }

.post-hero {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 3px solid #3c3c41;
}
.post-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--mute);
}
.post-hero .date { color: var(--cyan); }
.post-hero .chip {
  display: inline-block;
  padding: 2px 7px;
  border: 2px solid #0d0d0f;
  background: #3c3c41;
  color: var(--gold);
  font-size: 11px;
}
.post-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3vw, 28px);
  color: #fff;
  line-height: 1.4;
  text-shadow: 2px 2px 0 #0d0d0f;
}
.post-hero .lead {
  margin: 0;
  color: var(--mute);
  font-size: 14px;
  line-height: 1.8;
}

.article {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.85;
}
.article > *:first-child { margin-top: 0; }
.article h2 {
  margin: 1.6em 0 0.6em;
  font-size: 18px;
  color: var(--gold);
  border-left: 4px solid var(--lime);
  padding-left: 10px;
}
.article h3 {
  margin: 1.3em 0 0.5em;
  font-size: 16px;
  color: var(--cyan);
}
.article p { margin: 0 0 1em; }
.article ul,
.article ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
.article li { margin: 0.35em 0; }
.article a { word-break: break-word; }
.article strong { color: var(--lime); font-weight: normal; }
.article em { color: var(--gold); font-style: normal; }
.article blockquote {
  margin: 0 0 1em;
  padding: 12px 14px;
  background: #0d0d0f;
  border: 3px solid #3c3c41;
  border-left: 4px solid var(--cyan);
  color: var(--mute);
}
.article code {
  font-family: var(--font);
  font-size: 0.92em;
  color: var(--lime);
  background: #0d0d0f;
  border: 2px solid #3c3c41;
  padding: 1px 6px;
}
.article pre {
  margin: 0 0 1em;
  padding: 14px;
  overflow-x: auto;
  background: #0d0d0f;
  border: 3px solid #3c3c41;
  box-shadow: inset 2px 2px 0 #0a0a0f;
}
.article pre code {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
}
.article hr {
  border: 0;
  height: 3px;
  margin: 1.6em 0;
  background: repeating-linear-gradient(90deg, #3c3c41 0 8px, transparent 8px 14px);
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 3px solid #3c3c41;
}
.post-nav a {
  text-decoration: none !important;
  color: #0d0d0f !important;
  background: var(--cyan);
  border: 3px solid #0d0d0f;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 3px 3px 0 #0d0d0f;
}
.post-nav a:hover {
  background: var(--lime);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #0d0d0f;
}
.post-nav a.ghost {
  background: var(--bg-1);
  color: var(--ink) !important;
}

footer.site-foot {
  margin-top: 14px;
  text-align: center;
  color: var(--mute);
  font-size: 13px;
}
footer.site-foot .coin {
  display: inline-block;
  animation: bob 1.5s steps(2) infinite;
  color: var(--gold);
}
footer.site-foot .hint { opacity: 0.7; margin-left: 8px; }
footer.site-foot a {
  color: var(--cyan);
  text-decoration: none;
}
footer.site-foot a:hover { color: var(--lime); }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .topnav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
}
