:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #1d2433;
  --muted: #667085;
  --line: rgba(29, 36, 51, 0.1);
  --primary: #2f80ed;
  --teal: #20b7a4;
  --coral: #ff6b6b;
  --gold: #f7b731;
  --shadow: 0 18px 48px rgba(35, 51, 84, 0.12);
  --nav: rgba(255, 255, 255, 0.18);
  --hero-text: #ffffff;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: rgba(25, 33, 49, 0.86);
  --surface-solid: #182133;
  --text: #e8edf7;
  --muted: #a8b3c7;
  --line: rgba(232, 237, 247, 0.13);
  --primary: #65a7ff;
  --teal: #58d6c6;
  --coral: #ff8b8b;
  --gold: #ffd166;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --nav: rgba(17, 24, 39, 0.28);
  --hero-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 16%, rgba(32, 183, 164, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(255, 107, 107, 0.11), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  transition: background-color 180ms ease, color 180ms ease;
}

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 14px 18px;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.site-header.scrolled {
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(18, 30, 55, 0.12);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: 46px;
  padding: 0 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--nav);
  border-radius: 8px;
  backdrop-filter: blur(18px);
}

.site-header.scrolled .nav-shell {
  color: var(--text);
  border-color: var(--line);
}

.brand,
.nav-links,
.nav-actions,
.post-meta,
.hero-meta,
.social-row,
.filter-tabs,
.notice-card,
.search-head,
.search-box {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 128px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(47, 128, 237, 0.25);
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  min-width: 58px;
  padding: 8px 10px;
  text-align: center;
  border-radius: 8px;
  font-size: 14px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.site-header.scrolled .nav-links a:hover {
  background: rgba(47, 128, 237, 0.08);
}

.nav-actions {
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: inherit;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.site-header.scrolled .icon-button,
.search-head .icon-button {
  background: rgba(47, 128, 237, 0.08);
  border-color: var(--line);
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(47, 128, 237, 0.18);
}

.icon-button svg,
.scroll-cue svg,
.back-top svg {
  width: 18px;
  height: 18px;
}

.hero {
  position: relative;
  min-height: 86vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--hero-text);
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background-image: url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=2200&q=85");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.hero-overlay {
  background:
    linear-gradient(180deg, rgba(8, 13, 25, 0.26), rgba(8, 13, 25, 0.56) 56%, rgba(8, 13, 25, 0.82)),
    linear-gradient(90deg, rgba(47, 128, 237, 0.28), rgba(32, 183, 164, 0.16), rgba(255, 107, 107, 0.18));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 40px));
  padding-top: 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #cdfbf4;
}

.hero h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.12;
  font-weight: 900;
}

.hero-subtitle {
  min-height: 34px;
  margin: 20px auto 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.hero-subtitle span::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 5px;
  vertical-align: -2px;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-meta {
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-meta span {
  min-width: 104px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  animation: float 1.9s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(7px);
  }
}

.page-wrap {
  width: min(1180px, calc(100% - 36px));
  margin: -42px auto 0;
  position: relative;
  z-index: 3;
}

.notice-card,
.post-card,
.profile-card,
.side-card,
.archive-band,
.search-panel,
.loading-card,
.article-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.notice-card {
  gap: 12px;
  min-height: 58px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.notice-card p {
  margin: 0;
  color: var(--muted);
}

.notice-card svg {
  color: var(--gold);
  flex: 0 0 auto;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.section-heading h2,
.profile-card h2,
.side-card h2,
.search-head h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
}

.section-heading h2 {
  font-size: 28px;
}

.filter-tabs {
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 8px;
}

.tab-button {
  min-width: 52px;
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 8px 18px rgba(47, 128, 237, 0.22);
}

.feed {
  min-width: 0;
}

.post-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 214px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-card.featured {
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  min-height: 272px;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 128, 237, 0.28);
  box-shadow: 0 22px 54px rgba(35, 51, 84, 0.18);
}

.post-cover {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background: #d8dee9;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.loading-card {
  margin: 0;
  padding: 24px;
  color: var(--muted);
}

.post-card:hover .post-cover img {
  transform: scale(1.045);
}

.post-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 24px;
}

.post-meta {
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

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

.post-meta svg,
.side-card h2 svg,
.notice-card svg,
.search-box svg {
  width: 16px;
  height: 16px;
}

.post-body h3 {
  margin: 10px 0 8px;
  font-size: 23px;
  line-height: 1.32;
}

.post-body h3 a:hover,
.timeline a:hover,
.project-list a:hover strong {
  color: var(--primary);
}

.post-body p {
  margin: 0;
  color: var(--muted);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.post-tags span,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--primary);
  background: rgba(47, 128, 237, 0.1);
  border-radius: 8px;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}

.profile-card {
  overflow: hidden;
  text-align: center;
}

.profile-cover {
  height: 96px;
  background-image:
    linear-gradient(135deg, rgba(47, 128, 237, 0.62), rgba(32, 183, 164, 0.42)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80");
  background-size: cover;
  background-position: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: -39px auto 10px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  border: 5px solid var(--surface-solid);
  background: linear-gradient(135deg, var(--coral), var(--primary));
  border-radius: 50%;
}

.profile-card h2 {
  font-size: 22px;
}

.profile-card p {
  margin: 8px 24px 16px;
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.profile-stats strong {
  display: block;
  color: var(--text);
  font-size: 20px;
}

.social-row {
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.social-row a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.social-row a:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.social-row svg {
  width: 17px;
  height: 17px;
}

.side-card {
  padding: 18px;
}

.side-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 18px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a:nth-child(2n) {
  color: var(--teal);
  background: rgba(32, 183, 164, 0.11);
}

.tag-cloud a:nth-child(3n) {
  color: var(--coral);
  background: rgba(255, 107, 107, 0.1);
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-list a {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

[data-theme="dark"] .project-list a {
  background: rgba(255, 255, 255, 0.04);
}

.project-list strong,
.project-list span {
  display: block;
}

.project-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.archive-band {
  margin-top: 28px;
  padding: 24px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: linear-gradient(var(--primary), var(--teal), var(--coral));
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
}

.timeline article::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 22px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--surface-solid);
  background: var(--primary);
  border-radius: 50%;
}

.timeline time {
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: 36px auto 30px;
  color: var(--muted);
  text-align: center;
}

.article-page {
  width: min(920px, calc(100% - 36px));
  margin: 96px auto 0;
}

.article-hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-hero img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.article-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 25, 0.1), rgba(8, 13, 25, 0.72));
}

.article-hero-content {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 28px;
  z-index: 1;
  color: #fff;
}

.article-hero-content h1 {
  margin: 0 0 8px;
  max-width: 760px;
  font-size: 40px;
  line-height: 1.18;
}

.article-hero-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.article-card {
  margin-top: 18px;
  padding: 30px;
}

.article-content {
  margin-top: 22px;
  color: var(--text);
}

.article-content h1,
.article-content h2,
.article-content h3 {
  line-height: 1.28;
}

.article-content h1 {
  font-size: 32px;
}

.article-content h2 {
  margin-top: 30px;
  font-size: 24px;
}

.article-content p,
.article-content li {
  color: var(--muted);
}

.article-content code {
  padding: 2px 6px;
  color: var(--coral);
  background: rgba(255, 107, 107, 0.1);
  border-radius: 6px;
}

.search-dialog {
  width: min(680px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.search-dialog::backdrop {
  background: rgba(9, 14, 26, 0.54);
  backdrop-filter: blur(8px);
}

.search-panel {
  padding: 20px;
}

.search-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.search-head h2 {
  font-size: 22px;
}

.search-box {
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 8px;
}

.search-box input {
  width: 100%;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-item {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(47, 128, 237, 0.06);
}

.result-item strong,
.result-item span {
  display: block;
}

.result-item span {
  color: var(--muted);
  font-size: 14px;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 18;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(47, 128, 237, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.is-hidden {
  display: none;
}

@media (max-width: 920px) {
  .nav-links {
    display: none;
  }

  .brand {
    min-width: auto;
  }

  .hero {
    min-height: 78vh;
  }

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

  .hero-subtitle {
    font-size: 18px;
  }

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

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

  .profile-card {
    grid-row: span 2;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 10px;
  }

  .nav-shell {
    min-height: 44px;
  }

  .hero {
    min-height: 74vh;
  }

  .hero-content {
    width: min(100% - 28px, 620px);
    text-align: left;
  }

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

  .hero-meta {
    justify-content: flex-start;
  }

  .page-wrap,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    overflow-x: auto;
  }

  .post-card,
  .post-card.featured {
    grid-template-columns: 1fr;
  }

  .post-cover {
    aspect-ratio: 16 / 9;
  }

  .post-body {
    padding: 18px;
  }

  .post-body h3 {
    font-size: 20px;
  }

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

  .timeline article {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .article-page {
    width: min(100% - 24px, 920px);
    margin-top: 76px;
  }

  .article-hero,
  .article-hero img {
    min-height: 300px;
    height: 300px;
  }

  .article-hero-content {
    left: 20px;
    right: 20px;
  }

  .article-hero-content h1 {
    font-size: 28px;
  }

  .article-card {
    padding: 20px;
  }
}
