:root {
  color-scheme: light;
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: rgba(209, 216, 230, 0.85);
  --brand: #5e72e4;
  --brand-dark: #324cdd;
  --accent: #11cdef;
  --success: #2dce89;
  --danger: #f5365c;
  --warm: #fb6340;
  --shadow: 0 12px 34px rgba(31, 45, 80, 0.13);
  --argon-grad: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
  --argon-warm: linear-gradient(87deg, #fb6340 0, #fbb140 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(94, 114, 228, 0.08), rgba(255, 255, 255, 0) 420px),
    linear-gradient(rgba(238, 242, 248, 0.82), rgba(238, 242, 248, 0.88)),
    url("./assets/xhy-background.gif") center / cover fixed,
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

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

.site-header {
  position: relative;
  min-height: 610px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(24, 34, 76, 0.9), rgba(94, 114, 228, 0.58), rgba(17, 205, 239, 0.28)),
    url("./assets/xhy-background.gif") center / cover fixed;
  overflow: hidden;
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 80px;
  background: var(--bg);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 100%);
  content: "";
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: #fff;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.nav-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  font-size: 15px;
}

.nav-links a {
  opacity: 0.88;
}

.nav-links a:hover,
.brand:hover {
  color: #bfdbfe;
}

.search-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.28);
}

.search-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.search-panel {
  position: fixed;
  top: 92px;
  right: max(16px, calc((100vw - 1180px) / 2));
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
}

.search-box {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-row input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.search-row input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(94, 114, 228, 0.18);
}

.search-close {
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.search-results p {
  margin: 0;
}

.search-results a {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f6ff;
  color: var(--brand-dark);
  font-weight: 700;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 520px;
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 128px;
}

.eyebrow {
  margin: 0 0 10px;
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #e7f8ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 1.05;
  text-shadow: 0 12px 38px rgba(8, 13, 35, 0.36);
}

.hero-copy {
  max-width: 600px;
  margin: 22px 0 30px;
  color: #e5eefc;
  font-size: 18px;
  word-break: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(31, 45, 80, 0.18);
}

.button.primary {
  background: var(--argon-warm);
  color: #fff;
}

.button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.back-home {
  color: #fff;
  font-weight: 800;
}

.page {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: -94px auto 42px;
  align-items: start;
}

.widget,
.post-card,
.section-block {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 18px;
  order: 1;
}

.menu-card {
  padding: 0;
  overflow: hidden;
}

.menu-card h2 {
  margin: 0;
  padding: 22px 18px;
  border-bottom: 1px solid var(--line);
  color: #343a40;
  font-size: 24px;
  text-align: center;
}

.side-nav {
  display: grid;
  gap: 14px;
  padding: 24px 0 28px;
}

.side-nav a {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 10px;
  color: #343a40;
  font-size: 22px;
  font-weight: 800;
}

.side-nav a:hover {
  color: var(--brand-dark);
}

.side-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.profile {
  position: relative;
  padding: 32px 22px 26px;
  overflow: hidden;
  text-align: center;
}

.profile-cover {
  display: none;
}

.avatar {
  position: relative;
  width: 92px;
  height: 92px;
  margin-top: 0;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.profile h2 {
  margin: 16px 0 12px;
  color: #343a40;
  font-size: 24px;
}

.bio {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.stats a {
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  color: #343a40;
  font-size: 26px;
  line-height: 1.2;
}

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

.content {
  display: grid;
  gap: 20px;
  order: 2;
}

.post-card {
  position: relative;
  padding: 26px 30px;
  overflow: hidden;
}

.post-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--argon-grad);
  content: "";
}

.post-card.pinned::before {
  background: var(--argon-warm);
}

.post-card h2 {
  margin: 8px 0 10px;
  font-size: 25px;
  line-height: 1.35;
}

.post-card h2 a:hover {
  color: var(--brand);
}

.post-card p {
  margin: 0 0 18px;
  color: #4b5563;
}

.empty-state {
  min-height: 240px;
  display: grid;
  align-content: center;
}

.empty-state h2 {
  margin-top: 0;
}

.post-kicker {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

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

.post-meta span {
  color: var(--brand-dark);
  font-weight: 700;
}

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

.chips a,
.tag-cloud a {
  border-radius: 999px;
  background: rgba(94, 114, 228, 0.12);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.chips a {
  padding: 5px 10px;
}

.tag-cloud a {
  padding: 8px 12px;
}

.read-more {
  display: inline-block;
  margin-top: 18px;
  color: var(--brand-dark);
  font-weight: 800;
}

.widget {
  padding: 22px;
}

.widget h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.notice {
  border-left: 4px solid var(--accent);
}

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

.sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 50px;
}

.section-block {
  padding: 24px 26px;
}

.section-block h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

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

.timeline a:hover {
  color: var(--brand);
}

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

.category-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9ff;
}

.category-grid span,
.muted {
  color: var(--muted);
}

.footer {
  padding: 28px 16px 40px;
  color: var(--muted);
  text-align: center;
}

.footer p {
  margin: 4px 0;
}

.footer a {
  color: inherit;
}

.footer-meta {
  margin: 0 auto 10px;
  width: min(1180px, calc(100% - 32px));
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(31, 45, 80, 0.08);
  backdrop-filter: blur(14px);
}

.footer-meta strong {
  color: var(--brand-dark);
}

.standalone-shell {
  width: min(1180px, calc(100% - 32px));
  margin: -72px auto 42px;
}

.page-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.page-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.page-card > p:first-child,
.page-card > p {
  color: var(--muted);
}

.page-stack {
  display: grid;
  gap: 18px;
}

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

.archive-list,
.taxonomy-list {
  display: grid;
  gap: 12px;
}

.archive-item,
.taxonomy-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7f9ff;
}

.archive-item time,
.taxonomy-item span {
  color: var(--muted);
  font-size: 13px;
}

.archive-item strong,
.taxonomy-item strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.archive-item p,
.taxonomy-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.friend-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 45, 80, 0.06);
}

.friend-card:hover {
  border-color: rgba(94, 114, 228, 0.32);
  transform: translateY(-1px);
}

.friend-card img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(31, 45, 80, 0.12);
}

.friend-card strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
}

.friend-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.friend-card svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.comments-card {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.comments-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.comments-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.article-page {
  background:
    linear-gradient(rgba(238, 242, 248, 0.9), rgba(238, 242, 248, 0.94)),
    url("./assets/xhy-background.gif") center / cover fixed,
    var(--bg);
}

.article-header {
  position: relative;
  min-height: 420px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(24, 34, 76, 0.9), rgba(94, 114, 228, 0.62), rgba(17, 205, 239, 0.22)),
    url("./assets/xhy-background.gif") center / cover fixed;
  overflow: hidden;
}

.article-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 72px;
  background: var(--bg);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 100%);
  content: "";
}

.article-nav {
  position: relative;
}

.article-hero {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 78px 0 120px;
}

.article-hero h1 {
  max-width: 1000px;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.3;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1110px) minmax(280px, 1fr);
  gap: clamp(36px, 4vw, 76px);
  align-items: start;
  width: min(1880px, calc(100% - 40px));
  margin: -72px auto 42px;
}

.article-card {
  grid-column: 2;
  position: relative;
  z-index: 2;
  padding: 34px min(46px, 6vw);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.article-toc {
  grid-column: 3;
  position: sticky;
  top: 22px;
  z-index: 2;
}

.toc-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 44px);
  overflow: hidden;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 30px rgba(31, 45, 80, 0.08);
  backdrop-filter: blur(14px);
}

.toc-card p {
  flex-shrink: 0;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.toc-card strong {
  flex-shrink: 0;
  display: block;
  margin-bottom: 14px;
  color: #343a40;
  font-size: 18px;
}

.toc-card nav {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.5) transparent;
}

.toc-card a {
  display: block;
  overflow: hidden;
  color: #6b7280;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-card a:hover {
  color: var(--brand-dark);
}

.toc-section {
  margin-top: 5px;
  padding-left: 10px;
  border-left: 3px solid var(--danger);
  color: #9f1239;
  font-size: 15px;
  font-weight: 900;
}

.toc-item {
  padding-left: 20px;
  border-left: 1px dashed rgba(107, 114, 128, 0.28);
  font-size: 14px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.article-meta span {
  color: var(--brand-dark);
  font-weight: 800;
}

.article-body {
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.article-body h2 {
  margin: 34px 0 16px;
  font-size: 26px;
  line-height: 1.25;
}

.article-body h3 {
  margin: 30px 0 14px;
  font-size: 20px;
  line-height: 1.45;
}

.article-body p {
  margin: 12px 0;
  color: #374151;
  line-height: 1.9;
  word-break: break-word;
}

.article-body figure {
  margin: 18px 0 24px;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 45, 80, 0.12);
}

.article-body pre {
  overflow-x: auto;
  margin: 14px 0 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #111827;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.7;
}

.article-body code {
  font-family: Consolas, "SFMono-Regular", monospace;
}

@media (max-width: 1400px) {
  .article-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(1100px, calc(100% - 32px));
  }

  .article-card,
  .article-toc {
    grid-column: 1;
  }

  .article-toc {
    position: relative;
    top: auto;
    order: -1;
  }

  .toc-card {
    max-height: 320px;
  }
}

@media (max-width: 860px) {
  .site-header {
    min-height: 540px;
    background-attachment: scroll;
  }

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

  .nav-tools {
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 10px 14px;
  }

  .hero-inner {
    padding: 54px 0 100px;
  }

  .hero-copy {
    max-width: min(330px, calc(100vw - 32px));
  }

  .page,
  .sections {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 1;
  }

  .content {
    order: 2;
  }

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

  .article-header {
    min-height: 360px;
    background-attachment: scroll;
  }

  .article-hero {
    padding: 52px 0 96px;
  }

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

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .page-grid,
  .friend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .nav-links {
    font-size: 14px;
  }

  .nav-tools {
    gap: 10px;
  }

  h1 {
    font-size: 42px;
  }

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

  .bio {
    max-width: 300px;
    margin-right: auto;
    margin-left: auto;
  }

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

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