@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f7f4ef;
  --bg-deep: #efe8dc;
  --ink: #1c1915;
  --ink-soft: #5c5348;
  --accent: #0f5c4c;
  --accent-hover: #0a4338;
  --line: #d6cec0;
  --card: #fffdf8;
  --code-bg: #1e2421;
  --code-fg: #d8e6df;
  --max: 42rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'IBM Plex Sans', 'Noto Sans SC', sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 92, 76, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(180, 120, 60, 0.07), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

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

.site-header {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.brand {
  display: inline-block;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-decoration: none;
  margin-left: 0.28em;
}

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

.tagline {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.15rem;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

main {
  flex: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.hero-intro {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: rise 0.7s ease both;
}

.hero-intro h1 {
  display: none;
}

.hero-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.post-item {
  animation: rise 0.7s ease both;
}

.post-item:nth-child(2) {
  animation-delay: 0.12s;
}

.post-item a {
  display: block;
  padding: 1.35rem 1.5rem;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.post-item a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--card);
}

.post-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.post-tag {
  color: var(--accent);
  font-weight: 500;
}

.post-item h2 {
  margin: 0 0 0.4rem;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.post-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  animation: rise 0.6s ease both;
}

.article-header .post-meta {
  margin-bottom: 0.75rem;
}

.article-header h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.article {
  animation: rise 0.7s ease 0.08s both;
}

.article h2 {
  margin: 2.2rem 0 0.85rem;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.article p {
  margin: 0 0 1.1rem;
}

.article ul {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
}

.article li {
  margin-bottom: 0.4rem;
}

.article code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.88em;
  background: color-mix(in srgb, var(--accent) 8%, white);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.article pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.article pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
}

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

.site-footer {
  margin-top: auto;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-deep) 70%, transparent);
}

.beian {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.beian-sep {
  color: var(--line);
  user-select: none;
}

.beian a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

.footer-note {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--ink-soft) 75%, transparent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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