:root {
  color-scheme: light;
  --sky: #85d2f0;
  --glass: rgba(220, 250, 255, 0.58);
  --glass-strong: rgba(239, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.7);
  --text: #102027;
  --muted: #4d6871;
  --accent: #ff8b28;
  --violet: #6667f3;
  --pink: #dd4ad4;
  --green-1: #d8f6e8;
  --green-2: #9ce8c5;
  --green-3: #54d79e;
  --green-4: #19a874;
  --shadow: 0 18px 40px rgba(25, 88, 111, 0.24);
  --blur: blur(20px) saturate(1.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(132, 211, 238, 0.18), rgba(132, 211, 238, 0.18)),
    url("./assets/sky-meadow.png") center / cover fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 23%, rgba(255, 255, 255, 0.55), transparent 24%),
    radial-gradient(circle at 82% 17%, rgba(182, 242, 255, 0.45), transparent 22%),
    linear-gradient(to bottom, rgba(112, 205, 239, 0.12), rgba(145, 228, 207, 0.2));
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 110px;
}

.glass-nav,
.glass-card,
.chip-row a {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.glass-nav {
  position: sticky;
  top: 22px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px 22px 12px 30px;
  border-radius: 999px;
}

.brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 18px;
  font-weight: 800;
}

.nav-links a {
  min-width: 72px;
  padding: 13px 20px;
  border-radius: 999px;
  text-align: center;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px rgba(28, 106, 136, 0.18);
  transform: translateY(-1px);
}

.nav-actions {
  justify-self: end;
  display: flex;
  gap: 14px;
}

.nav-actions button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
  place-items: center;
}

.nav-actions button:hover {
  background: rgba(255, 255, 255, 0.48);
}

.nav-actions .accent {
  color: var(--accent);
}

.nav-actions button.is-spinning svg {
  animation: spin-pop 0.45s ease;
}

@keyframes spin-pop {
  0% {
    transform: rotate(0deg) scale(1);
  }

  55% {
    transform: rotate(180deg) scale(1.18);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.45fr;
  gap: 20px;
  margin-top: 24px;
}

.home-stack {
  display: grid;
  gap: 28px;
  margin-top: 34px;
}

.glass-card {
  border-radius: 22px;
}

.profile-card {
  display: grid;
  min-height: 260px;
  padding: 34px;
  place-items: center;
  text-align: center;
}

.avatar-ring {
  display: grid;
  width: 112px;
  height: 112px;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #ff8a46, #f68cc9, #776aff, #52d4df, #ff8a46);
  box-shadow: 0 0 32px rgba(107, 97, 255, 0.44);
  place-items: center;
}

.avatar {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.home-profile {
  min-height: 292px;
}

.home-activity {
  min-height: 260px;
}

.home-stack .activity-card {
  padding: 34px 42px;
}

.home-stack .chip-row {
  margin-top: -8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 700;
}

.badge-row,
.tag-line,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.badge-row span,
.status-pill,
.tag-line span,
.tag-cloud span {
  padding: 7px 13px;
  color: #2369b8;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(166, 221, 244, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.badge-row span:nth-child(2) {
  color: #8f43c5;
  background: rgba(208, 169, 236, 0.58);
}

.badge-row span:nth-child(3) {
  color: #178768;
  background: rgba(152, 231, 195, 0.58);
}

.github-link,
.contact-link {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
}

.github-link {
  margin-top: 16px;
  color: #2369b8;
}

.contact-link {
  margin-top: 6px;
}

.activity-card,
.section-card,
.sidebar-card {
  padding: 28px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 4px;
  color: #3c7886;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.15;
}

.month-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  margin: 6px 0 8px;
  color: #253b42;
  font-size: 14px;
  font-weight: 800;
}

.contribution-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  grid-auto-columns: 1fr;
  gap: 4px;
  min-height: 115px;
  margin: 0 0 26px;
  overflow: hidden;
}

.day {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  background: rgba(205, 232, 185, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(47, 124, 80, 0.08);
}

.day[data-level="1"] {
  background: #a9db86;
}

.day[data-level="2"] {
  background: #6fc75a;
}

.day[data-level="3"] {
  background: #2ea83d;
}

.day[data-level="4"] {
  background: #087b24;
}

.activity-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-weight: 800;
}

.activity-summary p {
  margin-bottom: 0;
}

strong {
  color: var(--violet);
}

.activity-summary strong:nth-of-type(2) {
  color: #19a874;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.legend i {
  display: block;
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

.legend i:nth-of-type(1) {
  background: var(--green-1);
}

.legend i:nth-of-type(2) {
  background: var(--green-2);
}

.legend i:nth-of-type(3) {
  background: var(--green-3);
}

.legend i:nth-of-type(4) {
  background: var(--green-4);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

.chip-row a {
  min-width: 118px;
  padding: 17px 24px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.chip-row a:hover {
  transform: translateY(-2px);
}

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

.main-column,
.side-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.empty-state {
  display: grid;
  min-height: 240px;
  padding: 34px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.26);
  place-items: center;
}

.empty-state h3,
.note-preview h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.empty-state p,
.note-preview p,
.sidebar-card p {
  color: var(--muted);
  line-height: 1.8;
}

.empty-icon {
  display: grid;
  width: 82px;
  height: 82px;
  color: #73b3c4;
  font-size: 42px;
  font-weight: 950;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  place-items: center;
}

.text-link,
.side-contact {
  color: #226f92;
  font-weight: 900;
}

button.side-contact {
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.copy-email {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.note-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.3);
}

.mini-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  color: white;
  font-weight: 950;
  border-radius: 50%;
  background: linear-gradient(145deg, #61c9d7, #5e6bf6);
  place-items: center;
}

.post-card {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.32);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.post-card:hover {
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 14px 28px rgba(25, 88, 111, 0.14);
  transform: translateY(-2px);
}

.post-card h3 {
  margin-bottom: 0;
  font-size: 26px;
}

.post-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.post-date {
  color: #3c7886;
  font-size: 14px;
  font-weight: 900;
}

.post-tag {
  justify-self: start;
  padding: 7px 13px;
  color: #2369b8;
  font-size: 14px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(166, 221, 244, 0.62);
}

.mini-post {
  display: block;
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.26);
}

.article-page {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
}

.toc-card {
  position: sticky;
  top: 118px;
  padding: 22px;
}

.toc-card h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.toc-nav {
  display: grid;
  gap: 8px;
}

.toc-nav a {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  border-radius: 12px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.toc-nav a:hover {
  color: #1e5866;
  background: rgba(255, 255, 255, 0.42);
  transform: translateX(2px);
}

.toc-nav .toc-sub {
  padding-left: 24px;
  font-size: 13px;
  font-weight: 800;
}

.article-card {
  padding: 36px;
}

.article-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 34px;
}

.article-hero h1 {
  margin-bottom: 0;
  color: var(--text);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(38px, 5vw, 56px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.article-meta span,
.article-meta time {
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.article-summary {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.9;
}

.article-content {
  display: grid;
  gap: 18px;
  color: #27424b;
  font-size: 17px;
  line-height: 1.9;
}

.article-content h2 {
  margin-top: 16px;
  font-size: 28px;
}

.article-content h3 {
  margin: 10px 0 0;
  font-size: 22px;
}

.article-content p,
.article-content ul,
.article-content figure {
  margin-bottom: 0;
}

.article-content ul {
  padding-left: 22px;
}

.article-content li + li {
  margin-top: 6px;
}

.article-content table {
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.3);
}

.article-content th,
.article-content td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.54);
}

.article-content th {
  color: #1e5866;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.38);
}

.article-content tr:last-child td {
  border-bottom: 0;
}

.article-content code {
  padding: 2px 6px;
  color: #1b5565;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.5);
}

.article-content pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 16px;
  background: rgba(16, 32, 39, 0.84);
}

.article-content pre code {
  padding: 0;
  color: #effcff;
  background: transparent;
}

.article-content figure {
  display: grid;
  gap: 10px;
}

.article-content img {
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.35);
}

.article-content figcaption {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.tag-line {
  justify-content: flex-start;
  margin-top: 12px;
}

.sidebar-card h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.notes-page {
  margin-top: 34px;
}

.page-title {
  margin: 0 0 18px 10px;
}

.page-title h1 {
  color: var(--text);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: clamp(38px, 5vw, 54px);
}

.large-note {
  min-height: 220px;
  align-items: center;
}

.large-note h2 {
  margin-bottom: 10px;
}

.stats-list p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 34px;
}

.about-card,
.friends-card {
  padding: 34px;
}

.about-card,
.friends-card,
.about-copy {
  font-family:
    "Comic Sans MS", "Segoe Print", "Microsoft YaHei", ui-sans-serif, system-ui,
    sans-serif;
}

.about-intro {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.about-intro h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 4.6vw, 52px);
}

.about-copy {
  display: grid;
  gap: 16px;
  color: #415f68;
  font-size: 19px;
  font-weight: 700;
  line-height: 2;
}

.about-copy p {
  margin-bottom: 0;
}

.github-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 20px;
  color: #183342;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 24px rgba(25, 88, 111, 0.18);
}

.github-button:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.friends-card {
  align-self: start;
}

.friends-card h2 {
  margin-bottom: 18px;
  font-size: 32px;
}

.friend-empty {
  display: grid;
  gap: 10px;
  min-height: 180px;
  margin-bottom: 20px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.3);
  place-items: center;
}

.friend-empty span {
  color: #1b5565;
  font-size: 24px;
  font-weight: 900;
}

.friend-empty p {
  margin-bottom: 0;
  font-weight: 800;
}

.search-dialog[hidden] {
  display: none;
}

.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 24px;
  place-items: start center;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 60, 72, 0.24);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.search-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  margin-top: 92px;
  padding: 28px;
  border-radius: 28px;
}

.search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.search-close {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  place-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  outline: 0;
  background: transparent;
  border: 0;
}

.search-box input::placeholder {
  color: rgba(77, 104, 113, 0.72);
}

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.search-empty,
.search-result-item {
  margin: 0;
  padding: 16px 18px;
  color: var(--muted);
  font-weight: 800;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.28);
}

.search-result-item {
  display: grid;
  gap: 6px;
  color: var(--text);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.48);
  transform: translateY(-2px);
}

.search-result-item span {
  font-size: 18px;
  font-weight: 900;
}

.search-result-item small {
  color: var(--muted);
  font-weight: 800;
}

body.search-open {
  overflow: hidden;
}

.toast-message {
  position: fixed;
  top: 132px;
  left: 50%;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  padding: 16px 22px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  border-radius: 999px;
  transform: translateX(-50%);
  animation: toast-in 0.22s ease both;
}

.toast-message.is-leaving {
  animation: toast-out 0.28s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

.empty-mini {
  display: grid;
  height: 128px;
  color: var(--muted);
  font-weight: 800;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.26);
  place-items: center;
}

.tag-cloud {
  justify-content: flex-start;
}

body.dark {
  color-scheme: dark;
  --glass: rgba(71, 127, 145, 0.42);
  --glass-strong: rgba(82, 144, 163, 0.55);
  --line: rgba(229, 255, 255, 0.36);
  --text: #eafaff;
  --muted: #d3eef4;
  --shadow: 0 18px 44px rgba(0, 34, 48, 0.34);
}

body.dark::before {
  background: rgba(0, 32, 44, 0.26);
}

body.dark .empty-state,
body.dark .note-preview,
body.dark .empty-mini {
  background: rgba(14, 70, 90, 0.25);
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 22px, 680px);
    padding-top: 14px;
  }

  .glass-nav {
    grid-template-columns: 1fr auto;
    gap: 12px;
    border-radius: 28px;
  }

  .nav-links {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    font-size: 15px;
  }

  .nav-links a {
    min-width: 70px;
    padding: 10px 14px;
  }

  .hero-grid,
  .content-grid,
  .about-grid,
  .article-page {
    grid-template-columns: 1fr;
  }

  .toc-card {
    position: static;
  }

  .toc-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .month-row {
    grid-template-columns: repeat(6, 1fr);
    row-gap: 14px;
  }

  .contribution-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(28, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 13px;
    gap: 4px;
    min-height: auto;
  }

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

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

@media (max-width: 520px) {
  .brand {
    font-size: 20px;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions button {
    width: 36px;
    height: 36px;
  }

  .profile-card,
  .activity-card,
  .section-card,
  .sidebar-card,
  .article-card,
  .toc-card {
    padding: 20px;
  }

  .chip-row a {
    min-width: calc(50% - 8px);
  }

  .toc-nav {
    grid-template-columns: 1fr;
  }
}
