:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #f0f5ef;
  --ink: #16201d;
  --muted: #63716b;
  --line: #dfe6de;
  --green: #2f7d5f;
  --green-dark: #1f5f49;
  --coral: #d86f45;
  --gold: #b38a2e;
  --blue: #386f93;
  --shadow: 0 20px 60px rgba(42, 58, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf7;
  color: var(--green-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
  padding: 0.1rem 0.35rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(223, 230, 222, 0.8);
  background: rgba(247, 248, 245, 0.86);
  backdrop-filter: blur(16px);
}

.brand,
.site-nav,
.hero-actions,
.contact-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.site-nav {
  gap: clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--green-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(2rem, 5vw, 5rem);
  min-height: calc(100vh - 72px);
  padding: clamp(4rem, 8vw, 7rem) 5vw 3.5rem;
}

.hero-copy {
  align-self: center;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.35rem;
  max-width: 780px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.18rem;
}

.hero-text,
.section-heading p,
.focus-card p,
.contact-section p {
  color: var(--muted);
}

.hero-text {
  max-width: 690px;
  font-size: clamp(1.02rem, 1.8vw, 1.24rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  padding: 0 1.2rem;
  font-weight: 800;
}

.button.primary {
  background: var(--green);
  color: #ffffff;
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero-visual {
  align-self: center;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 125, 95, 0.08), rgba(216, 111, 69, 0.06)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#skill-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 5vw;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 2rem;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.focus-card {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.35rem;
}

.focus-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  margin-bottom: 1.2rem;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.articles-section {
  background: #eef3ed;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.article-list,
.article-reader {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-list {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.article-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.post-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem;
}

.post-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0.85rem;
  text-align: left;
}

.post-button:hover,
.post-button.active {
  background: var(--surface-strong);
}

.post-button strong,
.post-button span {
  display: block;
}

.post-button strong {
  line-height: 1.3;
}

.post-button span {
  color: var(--muted);
  font-size: 0.84rem;
}

.article-reader {
  min-height: 540px;
  padding: clamp(1.2rem, 3vw, 2.25rem);
}

.markdown-body {
  max-width: 860px;
}

.markdown-body h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.markdown-body h2 {
  margin-top: 2.1rem;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.markdown-body h3 {
  margin-top: 1.6rem;
}

.markdown-body p,
.markdown-body li {
  color: #3d4a45;
}

.markdown-body pre {
  overflow-x: auto;
  border-radius: 8px;
  background: #14201b;
  color: #edf6f1;
  padding: 1rem;
}

.markdown-body pre code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
}

.contact-links {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-links a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.8rem 1rem;
  color: var(--green-dark);
  font-weight: 800;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 5vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.beian-police {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.beian-police img {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 980px) {
  .hero,
  .article-layout,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 360px;
  }

  .focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-list {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.9rem;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 3rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  .hero-visual {
    min-height: 300px;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
