* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
}

html,
body {
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    background 0.4s,
    color 0.4s;
}

#bg-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: url("https://t.alcy.cc/fj") center/cover no-repeat;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.55);
  transition: background 0.4s;
}

body.light #bg-overlay {
  background: rgba(255, 255, 255, 0);
}

.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #fff;
}

body.light .glass {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #222;
}

nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light nav {
  background: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-back {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: 0.3s;
}

.nav-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.light .nav-back {
  color: #222;
}

body.light .nav-back:hover {
  background: rgba(0, 0, 0, 0.08);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1.1rem;
}

main {
  padding: 100px 2rem 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.article-view {
  padding: 2.5rem;
}

.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #059669;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-view h1 {
  font-size: 2.5rem;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.meta-bar {
  margin-bottom: 2rem;
  opacity: 0.8;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.article-body {
  line-height: 1.8;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.article-body h2,
.article-body h3 {
  line-height: 1.4;
  margin: 1.8rem 0 0.8rem;
}

.article-body p {
  margin: 0.8rem 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
}

.article-body pre {
  background: #1e293b !important;
  color: #f8fafc !important;
  padding: 2.8rem 1.2rem 1.2rem;
  border-radius: 10px;
  overflow: auto;
  margin: 1.5rem 0;
  position: relative;
  white-space: pre;
  tab-size: 2;
}

.article-body pre code {
  background: transparent !important;
  color: inherit;
  font-family: "Fira Code", Consolas, monospace;
  font-size: 0.95rem;
}

.article-body .code-lang-label {
  background: #334155;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.article-body .code-copy {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  border: 1px solid rgba(226, 232, 240, 0.3);
  border-radius: 7px;
  padding: 0.25rem 0.6rem;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.article-body .code-copy:hover {
  background: #475569;
  border-color: rgba(226, 232, 240, 0.6);
  color: #fff;
}

.article-body a.jump-btn {
  margin: 0.25rem 0.15rem;
}

.article-body blockquote {
  margin: 1.2rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid #4f6ef7;
  border-radius: 0 12px 12px 0;
  background: rgba(219, 234, 254, 0.9);
  color: #26344c;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
  opacity: 1;
}

.article-body blockquote p,
.article-body blockquote div {
  color: inherit;
  margin: 0.25rem 0;
}

body:not(.light) .article-body blockquote {
  border-left-color: #60b7f5;
  background: rgba(30, 41, 59, 0.78);
  color: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

footer {
  text-align: center;
  opacity: 0.75;
  padding: 1rem 0;
}

@media (max-width: 768px) {
  main {
    padding: 80px 0 2rem;
    max-width: 100%;
  }
  .article-view {
    padding: 1.5rem 1rem;
    border-radius: 0;
  }
  .article-view h1 {
    font-size: 1.8rem;
  }
  .article-body {
    font-size: 1rem;
  }
  .meta-bar {
    gap: 0.8rem;
    font-size: 0.9rem;
  }
  nav {
    padding: 0.7rem 1rem;
  }
  .nav-back {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .article-view {
    padding: 1rem 0.6rem;
  }
  .article-view h1 {
    font-size: 1.4rem;
  }
  .article-body {
    font-size: 0.95rem;
  }
  .article-body pre {
    padding: 2.6rem 0.8rem 0.8rem;
    font-size: 0.85rem;
  }
}

body.light .article-view.glass {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.14);
  color: #1f2937;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

body.light .article-body,
body.light .meta-bar {
  color: #1f2937;
}

body.light .article-body a {
  color: #145da0;
}

.article-body a.jump-btn {
  max-width: 100%;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.article-body a.jump-btn:hover {
  box-shadow: 0 11px 24px rgba(37, 99, 235, 0.2);
}

.article-body a.jump-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.article-body a.jump-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 3px;
}

.article-body a.jump-btn span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.article-body a.jump-btn:hover span[aria-hidden="true"] {
  background: rgba(37, 99, 235, 0.2);
  transform: translateX(2px);
}

body:not(.light) .article-body a.jump-btn {
  box-shadow:
    0 8px 20px rgba(2, 6, 23, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@media (max-width: 480px) {
  .article-body a.jump-btn {
    padding: 0.58rem 0.85rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }
}

.article-body pre[data-code-block],
.article-body pre[data-language] {
  padding: 3rem 1.2rem 1.2rem;
  position: relative;
  white-space: pre;
  tab-size: 2;
}

.article-body pre[data-code-block]::before,
.article-body pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 0.72rem;
  left: 0.85rem;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  background: #334155;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-body .code-lang-label {
  display: none !important;
}

.article-body a.jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  background: #3b82f6 !important;
  border: 1px solid #2563eb !important;
  border-radius: 10px;
  color: #fff !important;
  box-shadow: 0 6px 15px rgba(30, 64, 175, 0.2);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none !important;
  vertical-align: middle;
}

.article-body a.jump-btn:hover {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.article-body a.jump-btn span[aria-hidden="true"] {
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  font-size: 1em;
}

body:not(.light) .article-body a.jump-btn {
  background: #0078d4 !important;
  border-color: #1687df !important;
  color: #fff !important;
}

body:not(.light) .article-body a.jump-btn:hover {
  background: #1687df !important;
  border-color: #60b7f5 !important;
  color: #fff !important;
}

@media (max-width: 480px) {
  .article-body pre[data-code-block],
  .article-body pre[data-language] {
    padding: 2.7rem 0.8rem 0.8rem;
  }
}
