@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --bg: #282828;
  --bg-dim: #1d2021;
  --fg: #bfbfbf;
  --heading: #d65d0e;
  --link: #ebdbb2;
  --border: #bdae93;
  --muted: #928374;
  --accent: #fe8019;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  margin: 0;
  min-height: 100vh;
}

.avatar-container {
  margin: 40px auto 0;
  text-align: center;
}

.avatar {
  border-radius: 125px;
  width: 250px;
  height: 250px;
  border: 2px solid var(--border);
  object-fit: cover;
  background: var(--bg-dim);
}

.container {
  margin: 0 auto;
  max-width: 68ch;
  width: 100%;
  padding: 0 10px 40px;
}

p {
  text-align: justify;
  hyphens: auto;
}

h1,
h2 {
  text-align: center;
  color: var(--heading);
}

h1 {
  font-size: 1.75rem;
  margin: 1rem 0 1.25rem;
}

h2 {
  margin-top: 40px;
  font-size: 1.35rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

.contact-qr {
  position: relative;
  display: inline-block;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.contact-qr:hover,
.contact-qr:focus-within {
  color: var(--accent);
}

.contact-qr-id {
  font-weight: 700;
}

.contact-qr-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 20;
  line-height: 0;
}

.contact-qr-pop img {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.contact-qr-pop::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #fff;
}

.contact-qr:hover .contact-qr-pop,
.contact-qr:focus-within .contact-qr-pop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 590px) {
  .contact-qr-pop {
    left: 0;
    transform: translateX(0) translateY(4px);
  }

  .contact-qr:hover .contact-qr-pop,
  .contact-qr:focus-within .contact-qr-pop {
    transform: translateX(0) translateY(0);
  }

  .contact-qr-pop::after {
    left: 24px;
  }
}

code pre,
pre {
  margin: 0;
  background: var(--bg-dim);
  padding: 15px 20px;
  overflow-x: auto;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--link);
}

hr {
  border: none;
  border-top: 1px solid var(--muted);
  margin: 2rem 0 1rem;
}

.lang {
  background: var(--bg-dim);
  padding: 3px 8px;
  font-size: 0.85em;
  white-space: nowrap;
}

.show-more {
  position: relative;
  margin-bottom: 45px;
}

.show-more-text {
  height: 90px;
  overflow: hidden;
}

.show-more label {
  position: absolute;
  text-align: right;
  margin: -35px 0 0 -15px;
  padding: 5px;
  cursor: pointer;
  top: 100%;
  width: 100%;
  color: var(--accent);
  user-select: none;
}

@media (max-width: 450px) {
  .show-more label {
    margin: 0 0 0 -15px;
  }
}

@media (max-width: 590px) {
  .lang {
    display: none;
  }

  .avatar {
    width: 180px;
    height: 180px;
  }
}

.show-more input {
  display: none;
}

.show-more label::after {
  content: "展开更多";
}

.show-more input:checked + label::after {
  content: "收起";
}

.show-more input:checked ~ .show-more-text {
  height: auto;
}

.footer {
  text-align: center;
}

.beian {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.beian a {
  color: var(--muted);
  text-decoration: none;
}

.beian a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-meta {
  color: var(--muted);
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.markdown h2 {
  text-align: left;
  margin-top: 2rem;
}

.markdown pre {
  margin: 1rem 0;
}

.markdown code {
  background: var(--bg-dim);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.markdown pre code {
  background: transparent;
  padding: 0;
}

.pdf-preview {
  margin: 1rem 0 0;
  background: var(--bg-dim);
  border: 1px solid var(--muted);
  border-radius: 8px;
  overflow: hidden;
}

.pdf-preview iframe {
  display: block;
  width: 100%;
  height: min(80vh, 920px);
  border: 0;
  background: #1d2021;
}

.media-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1rem 0 0;
}

.media-item {
  margin: 0;
  padding: 0;
  background: var(--bg-dim);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #3c3836;
}

.media-item img,
.media-item video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  background: #1d2021;
}
