:root {
  --bg: #050c17;
  --bg-alt: #0f1f30;
  --text: #d0e6ff;
  --muted: #7f94b0;
  --accent: #5ac8ff;
  --accent-strong: #ffb347;
  --border: rgba(255, 255, 255, 0.08);
  --mono: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Source Han Sans SC", "PingFang SC", system-ui;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #142438, var(--bg));
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
}

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

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

.layout {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px 96px;
}

.masthead {
  padding: 20px 0 32px;
  border-bottom: 1px solid var(--border);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.site-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
}

.site-meta:hover {
  color: inherit;
}

.site-title {
  font-size: clamp(24px, 4.4vw, 38px);
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.avatar {
  font-size: 38px;
}

nav {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

nav a {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
}

nav a:hover {
  color: var(--accent);
}

nav a.rss::after {
  content: " RSS";
  color: var(--accent-strong);
}

.hero-block {
  margin-top: 32px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.hero-block h1,
.hero-block h2,
.hero-block h3 {
  margin-top: 0;
}

.post-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}

.post-item {
  padding: 18px 0 18px 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transform-origin: center bottom;
  transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease;
  will-change: transform;
}

.post-item.is-focus {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.post-line {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.post-num {
  font-family: var(--mono);
  color: var(--accent-strong);
  width: 3ch;
  min-width: 3ch;
  flex: 0 0 3ch;
  text-align: right;
  margin-right: 4px;
  line-height: 1.4;
}

.post-title {
  color: var(--accent);
  font-size: 1.1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.post-title:hover {
  text-decoration: underline;
}

.post-item time {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.9rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.post-summary {
  margin: 8px 0 0 32px;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-tag {
  margin-right: 10px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-decoration: none;
}

.inline-tag:hover {
  color: var(--accent);
}

.pager {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.pager-link {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.pager-link:hover {
  border-color: var(--accent);
}

.site-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Article detail */
article.prose {
  background: var(--bg-alt);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.post-header {
  margin-bottom: 30px;
}

.post-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.post-header time {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
}

.tag-row {
  margin-top: 10px;
}

.tag-page-title {
  margin: 10px 0 16px;
  color: var(--accent-strong);
  font-size: 1.2rem;
}

article.prose h1,
article.prose h2,
article.prose h3 {
  color: var(--text);
}

article.prose pre {
  background: #07101d;
  color: #e3f5ff;
  padding: 18px;
  border-radius: 16px;
  overflow-x: auto;
  font-family: var(--mono);
}

article.prose code {
  font-family: var(--mono);
  background: rgba(90, 200, 255, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

article.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 16px 0;
}

article.prose blockquote {
  border-left: 4px solid var(--accent);
  margin: 28px 0;
  padding-left: 18px;
  color: var(--accent);
  font-style: italic;
}

.back-link {
  color: var(--muted);
  font-family: var(--mono);
}

@media (max-width: 640px) {
  .layout {
    padding: 10px 14px 72px;
  }
  .masthead {
    padding: 8px 0 18px;
  }
  .header-container {
    gap: 10px;
    flex-wrap: nowrap;
  }
  .site-meta {
    gap: 8px;
  }
  .site-title {
    font-size: 1.15rem;
  }
  .avatar {
    font-size: 22px;
  }
  nav {
    gap: 6px;
  }
  nav a {
    font-size: 12px;
    padding: 2px 0;
  }
  .post-line {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: flex-start;
  }
  .post-num {
    width: 3ch;
    min-width: 3ch;
    flex: 0 0 3ch;
    margin-right: 2px;
  }
  .post-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .post-summary {
    margin-left: 32px;
    font-size: 0.85rem;
    word-break: break-word;
  }
  article.prose {
    padding: 18px 14px;
  }
  .post-header h1 {
    font-size: 1.1rem;
  }
  article.prose img {
    max-width: 100vw;
    width: calc(100vw - 56px);
    margin: 12px calc(50% - 50vw + 28px);
  }
}

@media (max-width: 480px) {
  .layout {
    padding: 8px 10px 64px;
  }
  .header-container {
    gap: 8px;
  }
  .site-title {
    font-size: 1rem;
  }
  .avatar {
    font-size: 18px;
  }
  nav {
    gap: 5px;
  }
  nav a {
    font-size: 11px;
  }
}
