:root {
  --bg: #f6f4ef;
  --bg-soft: #ebe7de;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --ink: #151817;
  --muted: #5f6864;
  --line: rgba(21, 24, 23, 0.12);
  --accent: #007d73;
  --accent-strong: #00a48f;
  --accent-warm: #b8621b;
  --accent-red: #b73535;
  --code: #101413;
  --shadow: 0 18px 60px rgba(29, 33, 31, 0.12);
}

[data-theme="dark"] {
  --bg: #101312;
  --bg-soft: #171b1a;
  --surface: rgba(24, 29, 28, 0.82);
  --surface-strong: #1b2220;
  --ink: #eef4ef;
  --muted: #a6b1ab;
  --line: rgba(238, 244, 239, 0.14);
  --accent: #49dbc8;
  --accent-strong: #8cf4df;
  --accent-warm: #f1a85a;
  --accent-red: #ff7777;
  --code: #0b0e0d;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 125, 115, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(184, 98, 27, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  background-size: 72px 72px, 72px 72px, auto;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

img {
  max-width: 100%;
  height: auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(1120px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #061311;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-warm));
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 30px rgba(0, 125, 115, 0.24);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 850;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

#menu::-webkit-scrollbar {
  display: none;
}

#menu a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

#menu a:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] #sun,
[data-theme="light"] #moon {
  display: none;
}

.main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: 54px;
  padding: 68px 0 44px;
}

.hero-copy {
  max-width: 670px;
}

.hero-eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 700px;
  font-size: 56px;
  line-height: 1.06;
  font-weight: 880;
}

.hero-lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions,
.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 760;
}

.button.primary {
  color: #061311;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-warm));
  border-color: transparent;
  box-shadow: 0 14px 40px rgba(0, 125, 115, 0.22);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface);
}

.topic-row span,
.tag-pills a,
.post-tags a,
.terms-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  min-height: 380px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(73, 219, 200, 0.14), transparent 36%),
    linear-gradient(315deg, rgba(241, 168, 90, 0.16), transparent 40%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
  mix-blend-mode: screen;
}

[data-theme="light"] .hero-art {
  opacity: 0.36;
  mix-blend-mode: multiply;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
}

.signal-top,
.signal-grid,
.signal-lines,
.signal-stats {
  position: relative;
  z-index: 1;
}

.signal-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.signal-top strong {
  color: var(--accent-strong);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 48px;
}

.signal-grid span {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    var(--surface-strong);
}

.signal-grid span:nth-child(3n) {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-warm) 28%, transparent), transparent),
    var(--surface-strong);
}

.signal-lines {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.signal-lines i {
  width: var(--w);
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.signal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.signal-stats span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
}

.signal-stats b {
  display: block;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.feed-section {
  padding: 18px 0 86px;
}

.section-heading,
.page-header {
  margin: 0 0 24px;
}

.section-heading h2,
.page-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 36px rgba(18, 24, 22, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--surface-strong);
}

.featured-post {
  min-height: 300px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
    var(--surface);
}

.post-card-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.post-card-meta span,
.post-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.post-card h3 {
  margin: 18px 0 0;
  font-size: 25px;
  line-height: 1.25;
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 26px;
}

.list-page,
.article-page {
  padding-top: 52px;
}

.post-single {
  width: min(780px, 100%);
  margin: 0 auto 88px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.post-title {
  margin: 18px 0 14px;
  font-size: 42px;
  line-height: 1.18;
}

.post-content {
  margin-top: 36px;
  color: color-mix(in srgb, var(--ink) 90%, var(--muted));
}

.post-content h2,
.post-content h3 {
  margin: 34px 0 12px;
  line-height: 1.3;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre {
  margin: 18px 0;
}

.post-content a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}

.post-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.post-content pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code);
  color: #d8efe7;
}

.post-content blockquote {
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.post-footer {
  margin-top: 36px;
}

.post-tags,
.terms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-list h2 {
  margin: 34px 0 14px;
  color: var(--accent);
  font-size: 24px;
}

.archive-posts {
  display: grid;
  gap: 12px;
}

.archive-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-entry-title {
  margin: 0;
  font-size: 17px;
}

.archive-meta {
  color: var(--muted);
  font-size: 13px;
}

.not-found {
  min-height: 50vh;
  display: grid;
  align-content: center;
  justify-items: start;
}

.footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

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

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.top-link {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.top-link svg {
  width: 14px;
}

@media (max-width: 860px) {
  .nav {
    width: min(100% - 28px, 1120px);
    min-height: 68px;
    gap: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .nav-right {
    flex: 1;
    justify-content: flex-end;
  }

  .main {
    width: min(100% - 28px, 1120px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 28px;
    padding: 44px 0 34px;
  }

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

  .hero-lead {
    font-size: 16px;
  }

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

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

  .post-single {
    padding: 26px;
  }

  .post-title {
    font-size: 32px;
  }

  .archive-entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-right {
    width: 100%;
  }

  #menu {
    flex: 1;
  }

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

  .section-heading h2,
  .page-header h1 {
    font-size: 28px;
  }

  .post-card,
  .post-single {
    padding: 22px;
  }
}
