:root {
  --bg: #f7f7f4;
  --bg-soft: #efeee8;
  --surface: #fffdf9;
  --ink: #20242e;
  --ink-soft: #5b606a;
  --ink-faint: #8b8f97;
  --line: rgba(32, 36, 46, 0.14);
  --line-strong: rgba(32, 36, 46, 0.3);
  --accent: #d65c43;
  --accent-soft: #f4d7cf;
  --teal: #1f8580;
  --amber: #d9a63a;
  --shadow: 0 18px 50px rgba(32, 36, 46, 0.1);
  --radius: 8px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Songti SC", "STSong", SimSun, "Noto Serif SC", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #171a20;
  --bg-soft: #1e222a;
  --surface: #20242d;
  --ink: #eeeae1;
  --ink-soft: #a9adb5;
  --ink-faint: #767b84;
  --line: rgba(238, 234, 225, 0.13);
  --line-strong: rgba(238, 234, 225, 0.26);
  --accent: #ee7a5f;
  --accent-soft: #4a2b23;
  --teal: #4db5af;
  --amber: #e5b64b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

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

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 247, 244, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

[data-theme="dark"] .site-header {
  background: rgba(23, 26, 32, 0.92);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: 26px;
}

.site-nav a {
  position: relative;
  padding: 23px 0 19px;
  font-size: 15px;
  color: var(--ink-soft);
}

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

.site-nav a.active {
  color: var(--ink);
}

.site-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
}

.header-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.icon-btn,
.nav-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  cursor: pointer;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-btn:hover,
.nav-toggle:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.icon-btn:focus-visible,
.nav-toggle:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.nav-toggle {
  display: none;
}

.hero {
  padding: 78px 0 72px;
  background-color: var(--bg);
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-position: 0 0, 0 0;
  background-size: 38px 38px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 60px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 600;
  line-height: 1.16;
}

.lede {
  max-width: 560px;
  margin: 22px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.hero-side {
  padding-left: 26px;
  border-left: 1px solid var(--line-strong);
}

.side-title {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
}

.update-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-list li + li {
  border-top: 1px solid var(--line);
}

.update-list a {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  padding: 15px 4px;
}

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

.update-list time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.section {
  padding: 64px 0 20px;
}

.section-head {
  display: flex;
  gap: 20px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
}

.text-link {
  padding-bottom: 2px;
  font-size: 15px;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

.featured-post {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 46px;
  align-items: center;
}

.featured-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.featured-media img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.featured-media:hover img {
  transform: scale(1.02);
}

.post-meta {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
}

.featured-body h3,
.post-row h3,
.post-header h1 {
  margin: 0;
  font-family: var(--serif);
}

.featured-body h3 {
  font-size: 30px;
  line-height: 1.3;
}

.featured-body h3 a:hover,
.post-row h3 a:hover {
  color: var(--accent);
}

.featured-body p:not(.post-meta) {
  margin: 14px 0 20px;
  color: var(--ink-soft);
}

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: 132px 1fr 90px;
  gap: 26px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.post-row time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
}

.post-row h3 {
  margin-bottom: 6px;
  font-size: 21px;
  line-height: 1.45;
}

.post-row p {
  margin: 0;
  color: var(--ink-soft);
}

.tag {
  justify-self: end;
  padding-bottom: 2px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

.site-footer {
  margin-top: 84px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--ink-soft);
}

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

.page-main {
  padding: 64px 0 20px;
}

.page-head {
  max-width: 760px;
  margin-bottom: 44px;
}

.page-head h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.25;
}

.page-head p {
  margin: 0;
  color: var(--ink-soft);
}

.post {
  padding-top: 56px;
}

.post-header {
  max-width: 720px;
  margin: 0 auto;
}

.post-header h1 {
  margin-top: 6px;
  font-size: 40px;
  line-height: 1.3;
}

.post-summary {
  margin: 18px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.post-cover {
  width: 100%;
  max-width: 860px;
  margin: 38px auto 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
}

.post-body h2 {
  margin: 46px 0 14px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.4;
}

.post-body h3 {
  margin: 30px 0 10px;
  font-family: var(--serif);
  font-size: 21px;
}

.post-body p {
  margin: 0 0 20px;
}

.post-body ul {
  margin: 0 0 22px;
  padding-left: 24px;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body blockquote {
  margin: 30px 0;
  padding: 6px 0 6px 24px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
}

.post-body blockquote p {
  margin: 0;
}

.post-body strong {
  color: var(--ink);
}

.post-body .note {
  margin: 28px 0;
  padding: 18px 22px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-footer {
  display: flex;
  max-width: 720px;
  margin: 58px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.2fr;
  gap: 60px;
}

.about-card {
  align-self: start;
  padding: 22px 26px 26px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about-card h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 24px;
}

.about-card p {
  margin: 0;
  color: var(--ink-soft);
}

.about-body h2 {
  margin: 34px 0 10px;
  font-family: var(--serif);
  font-size: 24px;
}

.about-body h2:first-child {
  margin-top: 0;
}

.about-body p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

.about-body ul {
  margin: 0 0 18px;
  padding-left: 24px;
  color: var(--ink-soft);
}

.empty {
  display: grid;
  min-height: 58vh;
  place-items: center;
  text-align: center;
}

.empty h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 42px;
}

.empty p {
  margin: 0 0 22px;
  color: var(--ink-soft);
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 3px;
  background: var(--accent);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
  }

  .hero-side {
    padding-top: 24px;
    padding-left: 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .featured-post {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 20px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a.active::after {
    display: none;
  }

  .site-nav a.active {
    color: var(--accent);
  }

  .nav-toggle {
    display: grid;
  }

  .hero {
    padding: 52px 0 48px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .lede {
    font-size: 17px;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .post-row time {
    order: -1;
  }

  .tag {
    justify-self: start;
  }

  .page-head h1 {
    font-size: 34px;
  }

  .post-header h1 {
    font-size: 30px;
  }

  .post-cover {
    margin: 28px auto 40px;
  }

  .post-body {
    font-size: 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
