:root {
  --text: #363842;
  --muted: #74798a;
  --soft: #f8f9ff;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(68, 72, 92, 0.12);
  --blue: #2f75dd;
  --blue-soft: #e8f0ff;
  --violet: #b99af8;
  --shadow: 0 18px 50px rgba(46, 66, 130, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: #d7d8e8;
  min-height: 100vh;
}

body::before {
  background:
    linear-gradient(135deg, rgba(215, 184, 255, 0.64), rgba(142, 200, 255, 0.58)),
    url("assets/site-background.jpg") center / cover fixed;
  content: "";
  inset: 0;
  opacity: 0.88;
  position: fixed;
  z-index: -2;
}

body::after {
  backdrop-filter: blur(3px);
  background: rgba(238, 241, 255, 0.42);
  content: "";
  inset: 0;
  position: fixed;
  z-index: -1;
}

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

button,
input,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(248, 249, 255, 0.82);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 54px;
  justify-content: space-between;
  left: 0;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  position: sticky;
  right: 0;
  top: 0;
  z-index: 30;
}

.topnav {
  align-items: center;
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.topnav a:not(.avatar-mini) {
  color: #4e5260;
  transition: color 160ms ease;
}

.topnav a:hover {
  color: var(--blue);
}

.avatar-mini {
  background: linear-gradient(135deg, #191d2c, #5678d9);
  border-radius: 6px;
  color: white;
  display: grid;
  font-weight: 900;
  height: 26px;
  place-items: center;
  width: 26px;
}

.search-trigger {
  background: transparent;
  border: 0;
  color: #555966;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
}

.blog-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  margin: 0 auto;
  max-width: 1280px;
  padding: 36px 18px 64px;
}

.left-rail,
.right-rail {
  display: grid;
  gap: 18px;
  align-content: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 28px 20px;
  text-align: center;
}

.avatar-large {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(47, 117, 221, 0.28), rgba(185, 154, 248, 0.5)),
    #1e2333;
  border-radius: 8px;
  color: white;
  display: flex;
  font-size: 54px;
  font-weight: 900;
  height: 118px;
  justify-content: center;
  margin: 0 auto 18px;
  overflow: hidden;
  position: relative;
  width: 118px;
}

.avatar-large::after {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
  height: 88px;
  position: absolute;
  right: -28px;
  top: -22px;
  width: 88px;
}

.profile-card h1 {
  font-size: 24px;
  margin: 0 0 8px;
}

.profile-card p,
.comments-card p,
.project-grid p {
  color: var(--muted);
  line-height: 1.75;
}

.profile-location {
  color: #4e5260;
  font-size: 14px;
  margin: 10px 0 18px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0;
}

.profile-stats strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
}

.profile-stats span {
  color: var(--muted);
  font-size: 13px;
}

.follow-button {
  background: var(--blue);
  border-radius: 999px;
  color: white;
  display: block;
  font-weight: 700;
  margin: 20px auto;
  padding: 10px 16px;
}

.profile-icons {
  display: flex;
  font-size: 13px;
  gap: 14px;
  justify-content: center;
}

.link-card,
.side-card,
.projects-card,
.comments-card {
  padding: 20px;
}

.link-card h2,
.side-card h2,
.projects-card h2,
.comments-card h2,
.section-title h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

.link-card ul {
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-card li {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.link-card span,
.category-list span {
  background: #f0f1f6;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 7px;
}

.main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.hero-card {
  padding: 28px;
}

.hero-card h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
  margin: 0 0 12px;
}

.hero-card p {
  color: #5f6474;
  line-height: 1.9;
}

.eyebrow {
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions a {
  background: var(--blue);
  border-radius: 999px;
  color: white;
  font-weight: 700;
  padding: 10px 16px;
}

.hero-actions a + a {
  background: var(--blue-soft);
  color: #3367bd;
}

.post-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  margin-bottom: 14px;
}

.post-meta span {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.post-excerpt,
.post-body {
  color: #5f6474;
  font-size: 16px;
  line-height: 1.95;
}

.section-title {
  padding: 10px 4px 4px;
}

.section-title p {
  color: var(--muted);
  margin: 0;
}

.post-feed {
  display: grid;
  gap: 14px;
}

#postList {
  display: grid;
  gap: 14px;
}

.path-card {
  padding: 22px 24px;
}

.path-list {
  display: grid;
  gap: 14px;
}

.learning-path {
  background: #f8f9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.learning-path span,
.next-step {
  color: var(--muted);
  font-size: 13px;
}

.learning-path h3 {
  margin: 4px 0 8px;
}

.progress {
  background: #e9ebf5;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress i {
  background: var(--blue);
  display: block;
  height: 100%;
}

.post-card {
  padding: 22px 24px;
}

.post-card h3 {
  font-size: 24px;
  margin: 0 0 10px;
}

.post-card h3 a:hover,
.latest-list a:hover,
.category-list button:hover {
  color: var(--blue);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span,
.tag-cloud span {
  background: var(--blue-soft);
  border-radius: 999px;
  color: #3367bd;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.latest-list,
.category-list,
.tag-cloud {
  display: grid;
  gap: 16px;
}

.latest-item {
  display: grid;
  gap: 5px;
}

.latest-item time {
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
}

.latest-item a {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.latest-item small {
  color: var(--muted);
  text-transform: uppercase;
}

.category-list a {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 0;
  text-align: left;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
}

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

.guide-card {
  padding: 22px 24px;
}

.guide-card p {
  color: var(--muted);
  line-height: 1.75;
}

pre {
  background: #1f2433;
  border-radius: 8px;
  color: #e8ecff;
  overflow: auto;
  padding: 16px;
}

.project-grid article {
  background: #f8f9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.project-grid span {
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.local-comment {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.local-comment h3 {
  font-size: 16px;
  margin: 0;
}

input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
  padding: 12px 14px;
  width: 100%;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 117, 221, 0.12);
}

.local-comment button {
  background: var(--blue);
  border: 0;
  border-radius: 7px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  justify-self: start;
  padding: 10px 16px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comment-item {
  background: #f8f9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.comment-item strong {
  display: block;
  margin-bottom: 6px;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  color: #5f6474;
  line-height: 1.8;
  margin-bottom: 0;
  white-space: pre-wrap;
}

.search-panel {
  background: rgba(28, 32, 45, 0.48);
  inset: 0;
  padding: 8vh 20px;
  position: fixed;
  z-index: 50;
}

.search-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(20, 25, 40, 0.3);
  margin: 0 auto;
  max-width: 720px;
  padding: 24px;
}

.search-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-head h2 {
  margin: 0;
}

.search-head button {
  background: #f0f1f6;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  height: 36px;
  width: 36px;
}

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: 58vh;
  overflow: auto;
}

.search-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 14px;
}

.search-result h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.search-result p,
.empty,
.empty-state p {
  color: var(--muted);
  line-height: 1.7;
}

.empty {
  margin: 0;
}

.empty-state {
  background: #f8f9ff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state code {
  background: #eef1ff;
  border-radius: 5px;
  padding: 2px 6px;
}

.footer {
  align-items: center;
  background: rgba(248, 249, 255, 0.72);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 24px max(24px, calc((100vw - 1280px) / 2));
}

@media (max-width: 1120px) {
  .blog-shell {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .left-rail {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .topnav {
    flex-wrap: wrap;
    gap: 14px;
  }

  .blog-shell {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .right-rail {
    order: -1;
  }

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