:root {
  --paper: #f8f8f3;
  --ink: #373c38;
  --muted: #68716b;
  --line: rgba(55, 60, 56, 0.18);
  --line-strong: rgba(55, 60, 56, 0.34);
  --surface: rgba(255, 255, 255, 0.48);
  --shadow: rgba(55, 60, 56, 0.08);
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-heading: "Noto Serif SC", "Noto Sans SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 8px 8px;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  color: #111713;
  text-decoration-color: currentColor;
}

button {
  font: inherit;
}

.site-shell {
  width: min(768px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 30px;
}

.site-header {
  padding: 34px 0 52px;
  text-align: center;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.domain {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.site-title {
  font-family: var(--font-heading);
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 900;
  line-height: 1.15;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 20px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.nav-links a {
  text-decoration-line: underline;
}

.page-main {
  padding-bottom: 38px;
}

.content {
  width: 100%;
}

.heti h1,
.heti h2,
.heti h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--ink);
  line-height: 1.35;
}

.hello {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  font-size: clamp(34px, 7vw, 48px);
}

.section {
  margin-top: 34px;
}

.section h2 {
  margin-bottom: 16px;
  font-size: 30px;
}

.post-list {
  display: grid;
  gap: 24px;
}

.post-item h3 {
  font-size: 24px;
}

.post-item p {
  margin: 8px 0 0;
}

.meta,
.article-meta {
  color: var(--muted);
  font-size: 14px;
}

.all-posts,
.back-link {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
}

.contact-section {
  margin-top: 42px;
}

.card-grid {
  display: grid;
  gap: 20px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 88px;
  width: 100%;
  padding: 16px 18px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
}

.card-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 18px;
}

.card-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.link-card strong,
.link-card small {
  display: block;
}

.link-card strong {
  font-size: 18px;
}

.link-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.copy-card {
  border: 1px solid var(--line);
}

.site-footer {
  display: grid;
  gap: 4px;
  padding: 30px 0 38px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.article-content {
  padding-bottom: 20px;
}

.article-content h1 {
  margin-top: 8px;
  margin-bottom: 22px;
  font-size: clamp(32px, 6vw, 46px);
}

.article-content h2 {
  margin-top: 34px;
  margin-bottom: 8px;
  font-size: 28px;
}

.article-content p {
  margin: 12px 0;
}

pre {
  overflow-x: auto;
  margin: 18px 0;
  padding: 18px;
  color: #24302a;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.demo-box {
  margin: 18px 0 26px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.demo-box p {
  margin-top: 0;
}

.demo-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.demo-result {
  display: block;
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0 18px;
  }

  .site-header {
    padding-top: 26px;
    padding-bottom: 42px;
  }

  .domain {
    font-size: 20px;
  }

  .nav-links {
    gap: 6px 12px;
    font-size: 15px;
  }

  .hello {
    margin-bottom: 28px;
  }

  .post-item h3 {
    font-size: 21px;
  }

  .section h2,
  .article-content h2 {
    font-size: 25px;
  }

  .link-card {
    min-height: 82px;
  }
}
