:root {
  --page: #090b0a;
  --paper: rgb(7 9 8 / 82%);
  --ink: #f1f2f1;
  --muted: rgb(255 255 255 / 54%);
  --line: rgb(255 255 255 / 17%);
  --button: rgb(7 9 8 / 78%);
  --link: #7dd9f5;
  --code: rgb(2 3 3 / 76%);
  --accent: #f3f4f3;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #090b0a;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-width: 320px;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: #090b0a;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  isolation: isolate;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(120% 74% at 50% 0%, rgb(255 255 255 / 5%), transparent 62%),
    linear-gradient(180deg, #0b0d0c 0%, #090b0a 100%);
}

.beam-background {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  opacity: .92;
  pointer-events: none;
}

.beam-background .beams-canvas {
  display: block;
  width: 100%;
  height: 100%;
  animation: beams-lights-up 900ms ease both;
}

@keyframes beams-lights-up {
  from { opacity: 0; }
}

a { color: var(--link); }
button, input { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  color: #fff;
  background: #333;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.header {
  position: relative;
  z-index: 20;
  min-height: 126px;
  padding-top: 47px;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.menu-item,
.search-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 2px;
  color: #fff;
  background: #5a5a5a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.menu-item { min-width: 74px; padding: 0 18px; }
.menu-item:hover, .search-button:hover { box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25); transform: translateY(-1px); }
.menu-item.active, .search-button.active { color: #fff; background: #607d8b; }
.home-button { min-width: 58px; padding: 0; }
.home-button svg { width: 17px; fill: currentColor; }

.search-button {
  width: 58px;
  height: 58px;
  margin-left: 5px;
  border-radius: 50%;
  background: #607d8b;
}

.search-button svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; }

.language-switcher {
  position: fixed;
  z-index: 30;
  top: 24px;
  right: 30px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  align-items: center;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(7 9 8 / 74%);
  backdrop-filter: blur(8px);
}

.language-switcher button {
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  color: rgb(255 255 255 / 64%);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.language-switcher button.active {
  color: #090b0a;
  background: #fff;
}

.search-panel {
  position: absolute;
  z-index: 22;
  top: 112px;
  left: 50%;
  display: flex;
  width: min(520px, calc(100% - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgb(7 9 8 / 94%);
  box-shadow: none;
  transform: translateX(-50%);
}

.search-panel[hidden] { display: none; }
.search-panel label { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); }
.search-panel input { min-width: 0; flex: 1; padding: 9px 11px; border: 1px solid var(--line); color: var(--ink); background: rgb(255 255 255 / 5%); outline: 0; }
.search-panel input:focus { border-color: var(--link); }
.search-panel button { border: 0; color: #777; background: transparent; font-size: 25px; cursor: pointer; }

.page {
  width: min(760px, 50vw);
  min-width: 590px;
  flex: 1 0 auto;
  margin: 0 auto 45px;
}

.post-card {
  overflow: hidden;
  margin-bottom: 46px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: border-color 220ms ease, background-color 220ms ease;
}

.post-card:hover { border-color: rgb(255 255 255 / 36%); background: rgb(7 9 8 / 88%); }

.card-image {
  position: relative;
  aspect-ratio: 4 / 1;
  min-height: 160px;
  overflow: hidden;
  background: #263238;
}

.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-image h1,
.card-image h2 {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  margin: 0;
  color: #fff;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.25;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
}

.card-image h2 {
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 400;
}

.card-content { padding: 25px 27px 20px; }

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 12px;
}

.post-meta span { padding: 0 8px; }
.post-meta a { text-decoration: none; }

section { scroll-margin-top: 24px; }

h2 {
  margin: 36px 0 14px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
}

h3 { font-weight: 400; }
p { margin: 0 0 15px; }
strong { font-weight: 600; }

.github-readme {
  color: var(--ink);
}

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

.readme-center { text-align: center; }
.readme-wide { display: block; width: 100%; }

.github-readme h2 {
  margin: 25px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
}

.github-readme h3 {
  margin: 13px 0 5px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.readme-hero { margin-top: 18px; }

.readme-divider {
  margin: 22px 0;
}

.readme-section { margin: 0; }

.readme-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 4px;
  margin: 15px 0;
}

.readme-badges a { line-height: 0; }
.readme-badges img { display: block; }
.readme-dashboard { margin-top: 25px; }

.readme-quest ul {
  margin: 0;
  padding-left: 24px;
}

.readme-quest li { margin: 5px 0; }

.readme-statistics img {
  display: block;
  margin: 15px auto;
}

.readme-statistics > img:first-child { max-height: 180px; }
.readme-typing { width: min(760px, 100%); }

.readme-ending { margin-top: 25px; }
.readme-farewell { max-height: 250px; }
.readme-credit { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }

.readme-introduction {
  margin: 0;
}

.readme-introduction h2 {
  margin: 0 0 16px;
}

.readme-about-layout {
  display: grid;
  grid-template-columns: 34% 66%;
  border: 1px solid var(--line);
}

.readme-character {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.readme-character img {
  display: block;
  width: 100%;
  max-width: 310px;
  height: auto;
}

.readme-profile-data {
  min-width: 0;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: var(--ink);
  background: rgb(0 0 0 / 32%);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.55;
}

.code-block,
.mini-code {
  overflow-x: auto;
  color: #e4e4e4;
  background: var(--code);
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.75;
}

.code-block {
  margin: 22px -27px;
  padding: 21px 27px;
  font-size: 12px;
}

.mini-code {
  margin: 16px 0 0;
  padding: 13px 15px;
  font-size: 11px;
}

.comment { color: #777; }
.keyword { color: #ff4081; font-weight: 700; }
.string { color: #8bc34a; }

.project-card[hidden] { display: none; }
.anchor { position: relative; top: -24px; }
.no-results { margin: -20px 0 42px; padding: 28px; border: 1px solid var(--line); color: var(--muted); background: var(--paper); text-align: center; }

.card-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 27px;
  border-top: 1px solid var(--line);
}

.card-footer > a { flex: 0 0 auto; color: var(--muted); font-size: 12px; text-decoration: none; }
.card-footer > a:hover { color: var(--link); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span { padding: 3px 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: rgb(255 255 255 / 3%); font-size: 10px; }

.stack-table { width: 100%; margin: 22px 0; border-collapse: collapse; font-size: 13px; }
.stack-table th, .stack-table td { padding: 13px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.stack-table th { color: var(--ink); background: rgb(255 255 255 / 7%); font-weight: 500; }
.stack-table td:first-child { width: 29%; color: rgb(255 255 255 / 72%); }

.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button { display: inline-flex; min-height: 38px; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 0; color: #fff; background: rgb(0 0 0 / 35%); box-shadow: none; font-size: 11px; text-decoration: none; cursor: pointer; }
.button.primary { color: #090b0a; background: var(--accent); }

.post-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 38px; }
.post-pagination a, .current-page { color: rgb(255 255 255 / 66%); font-size: 15px; text-decoration: none; }
.current-page { padding: 2px 8px; color: #090b0a; background: #fff; }

.live2d {
  position: fixed;
  z-index: 15;
  bottom: 0;
  left: 0;
  width: 330px;
  height: 600px;
}

.live2d canvas { display: block; width: 330px; height: 600px; }

.live2d-tip {
  position: absolute;
  z-index: 2;
  width: 300px;
  height: 70px;
  margin: 60px 30px;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid rgb(255 238 209 / 78%);
  border-radius: 4px;
  color: #201b17;
  background: rgb(247 230 202 / 94%);
  box-shadow: 0 3px 18px rgb(0 0 0 / 34%);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgb(255 255 255 / 42%);
  opacity: 0;
  transition: opacity 180ms ease;
  animation: live2d-shake 50s ease-in-out 5s infinite;
  pointer-events: none;
  user-select: none;
}

.live2d:hover .live2d-tip,
.live2d-tip.visible { opacity: 1; }

.live2d-highlight { color: #006f9f; font-weight: 700; }

@keyframes live2d-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  2% { transform: translate(0.5px, -1.5px) rotate(-0.5deg); }
  4% { transform: translate(0.5px, 1.5px) rotate(1.5deg); }
  6% { transform: translate(1.5px, 1.5px) rotate(1.5deg); }
  8% { transform: translate(2.5px, 1.5px) rotate(0.5deg); }
  10% { transform: translate(0.5px, 2.5px) rotate(0.5deg); }
  12% { transform: translate(1.5px, 1.5px) rotate(0.5deg); }
  14% { transform: translate(0.5px, 0.5px) rotate(0.5deg); }
  16% { transform: translate(-1.5px, -0.5px) rotate(1.5deg); }
  18% { transform: translate(0.5px, 0.5px) rotate(1.5deg); }
  20%, 98% { transform: translate(0, 0) rotate(0); }
}

.fixed-actions {
  position: fixed;
  z-index: 20;
  right: 28px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fixed-actions a,
.fixed-actions button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;
  color: #fff;
  background: rgb(7 9 8 / 82%);
  box-shadow: none;
  font-size: 20px;
  text-decoration: none;
  cursor: pointer;
}

.fixed-actions button { background: rgb(7 9 8 / 82%); }

.footer { flex: 0 0 auto; padding: 18px 0; border-top: 1px solid rgb(255 255 255 / 12%); color: rgb(255 255 255 / 58%); background: transparent; font-size: 11px; }
.footer > div { display: flex; width: min(1080px, calc(100% - 32px)); justify-content: space-between; margin: auto; }

.toast {
  position: fixed;
  z-index: 100;
  bottom: 30px;
  left: 50%;
  padding: 9px 16px;
  color: #fff;
  background: #323638;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1149px) {
  .page { width: min(720px, calc(100% - 40px)); min-width: 0; }
  .live2d { width: 230px; height: 418px; left: -18px; }
  .live2d canvas { width: 230px; height: 418px; }
  .live2d-tip { width: 210px; height: 58px; margin: 38px 12px; font-size: 12px; }
}

@media (max-width: 640px) {
  .header { min-height: 92px; padding: 20px 10px; }
  .menu { justify-content: flex-start; gap: 6px; overflow-x: auto; padding: 4px 82px 4px 4px; }
  .menu-item { min-width: auto; height: 36px; padding: 0 12px; font-size: 10px; }
  .home-button { min-width: 42px; }
  .search-button { width: 42px; min-width: 42px; height: 42px; }
  .page { width: calc(100% - 20px); }
  .card-image { min-height: 145px; }
  .card-image h1 { right: 16px; bottom: 14px; left: 16px; font-size: 20px; }
  .card-content { padding: 20px 18px 30px; }
  .post-meta { flex-wrap: wrap; gap: 4px; }
  .code-block { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 10px; }
  .readme-about-layout { display: block; }
  .readme-character { border-right: 0; border-bottom: 1px solid var(--line); }
  .readme-character img { max-width: 240px; }
  .readme-profile-data { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9px; }
  .github-readme h2 { font-size: 19px; }
  .readme-divider { margin: 16px 0; }
  .card-footer { align-items: flex-start; flex-direction: column; }
  .stack-table { display: block; overflow-x: auto; }
  .fixed-actions { right: 14px; bottom: 64px; }
  .fixed-actions a, .fixed-actions button { width: 44px; height: 44px; }
  .live2d { width: 150px; height: 273px; left: -8px; bottom: -3px; }
  .live2d canvas { width: 150px; height: 273px; }
  .live2d-tip { top: -50px; left: 8px; width: 185px; height: auto; min-height: 46px; margin: 0; padding: 6px 9px; background: rgb(247 230 202 / 96%); font-size: 11px; }
  .language-switcher { top: 12px; right: 12px; }
  .beam-background { opacity: .78; }
  .footer > div { display: block; text-align: center; }
  .footer span { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .beam-background .beams-canvas { animation: none; }
}
