/* ============================================================
   kofune.ink — 极简个人博客样式
   原则：只保留一种强调色，每一个像素都有理由
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --fg: #e8e8e6;
  --muted: #8a8a86;
  --faint: #55554f;
  --line: #1e1e20;
  --accent: #c8ff3e;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #0a0a0b; }

a { color: inherit; text-decoration: none; }

.container { max-width: 680px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--muted); }

/* ---------------- 鼠标光晕 ---------------- */
.glow {
  position: fixed;
  top: 0; left: 0;
  width: 560px; height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 255, 62, 0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}

/* ---------------- 顶栏 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  font-family: var(--mono);
  font-size: 13px;
}

.logo { display: flex; align-items: center; gap: 6px; color: var(--fg); }

.logo-caret {
  width: 7px; height: 14px;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.nav-links { display: flex; gap: 22px; }

.nav-links a {
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(96px, 18vh, 150px) 24px 72px;
}

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 22px;
  letter-spacing: 0.02em;
}

/* ---------------- 半透明背景图 ---------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35; /* 半透明度：想更明显调大，更淡调小 */
  filter: brightness(0.85) saturate(0.9);
}

/* 暗色渐变压暗，保证文字可读 */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.25) 0%, rgba(10, 10, 11, 0.45) 45%, rgba(10, 10, 11, 0.8) 100%);
}

.hero-title {
  font-size: clamp(2.3rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.grad {
  background: linear-gradient(100deg, var(--accent), #8fd600 60%, #3f7d00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--fg);
  min-height: 2.2em;
}

.caret {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-meta {
  color: var(--muted);
  font-size: 15px;
  margin-top: 8px;
}

.status-line {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(200, 255, 62, 0.4); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(200, 255, 62, 0); }
}

/* ---------------- 章节标题 ---------------- */
.sec-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 34px;
  letter-spacing: 0.05em;
}

/* ---------------- 文章列表 ---------------- */
.posts { padding-bottom: 96px; position: relative; z-index: 1; }

.post-list { display: flex; flex-direction: column; }

.post {
  border-top: 1px solid var(--line);
  padding: 26px 4px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.post:last-of-type { border-bottom: 1px solid var(--line); }

.post:hover { transform: translateX(6px); border-color: rgba(200, 255, 62, 0.35); }

.post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.badge {
  color: #0a0a0b;
  background: var(--accent);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.08em;
}

.post-title {
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color 0.25s var(--ease);
}

.post:hover .post-title { color: var(--accent); }

.post-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.85;
}

.post:hover .post-sub { opacity: 1; }

.post-sub .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.post:hover .post-sub .arrow { transform: translateX(4px); }

/* ---------------- 关于 ---------------- */
.about { padding-bottom: 100px; position: relative; z-index: 1; }

.about p { color: #c9c9c5; margin-bottom: 26px; max-width: 60ch; }

.contact { font-family: var(--mono); font-size: 13.5px; }

.contact a {
  color: var(--fg);
  border-bottom: 1px dashed var(--faint);
  padding-bottom: 2px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.contact a:hover { color: var(--accent); border-color: var(--accent); }

.sep { color: var(--faint); margin: 0 8px; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px 48px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.site-footer .muted { margin-top: 6px; font-size: 11.5px; }

/* ---------------- 滚动显现 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------------- 阅读浮层 ---------------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  padding: 0 24px 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}

.reader.open { opacity: 1; pointer-events: auto; }

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 0 14px;
  background: linear-gradient(var(--bg) 70%, rgba(10, 10, 11, 0));
}

.reader-meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.reader-close {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.reader-close:hover { color: var(--accent); border-color: rgba(200, 255, 62, 0.5); }

.reader-body {
  max-width: 680px;
  margin: 0 auto;
  padding-top: 20px;
}

.reader-body header { margin-bottom: 42px; }

.reader-body h1 {
  font-size: clamp(1.7rem, 4.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 14px;
}

.reader-body .post-meta { margin-bottom: 0; color: var(--faint); }

.reader-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}

.reader-body h2::before { content: "# "; color: var(--accent); font-family: var(--mono); }

.reader-body p { color: #c9c9c5; margin-bottom: 18px; }

.reader-body ul { color: #c9c9c5; margin: 0 0 18px 1.3em; }
.reader-body li { margin-bottom: 6px; }
.reader-body li::marker { color: var(--accent); }

.reader-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 26px 0;
  color: var(--muted);
  font-style: italic;
}

.reader-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--accent);
}

.reader-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 24px 0;
  overflow-x: auto;
  line-height: 1.7;
}

.reader-body pre code { background: none; border: none; padding: 0; color: #d6d6d2; }

.reader-body .reader-end {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 560px) {
  .nav-links { gap: 14px; }
  .post { padding: 22px 2px; }
  .post-title { font-size: 1.12rem; }
}

/* ---------------- 减弱动效 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .glow { display: none; }
  .reveal { opacity: 1; transform: none; }
}
