:root,
html[data-mode="light"],
html[data-mode="dark"] {
  --main-bg: #100817;
  --main-border-color: rgba(216, 180, 254, 0.12);
  --sidebar-bg: #170b22;
  --sidebar-muted-color: rgba(226, 214, 242, 0.7);
  --sidebar-active-color: #ffffff;
  --sidebar-hover-bg: rgba(88, 28, 135, 0.34);
  --topbar-bg: rgba(16, 8, 23, 0.86);
  --card-bg: rgba(24, 12, 35, 0.92);
  --card-hover-bg: rgba(33, 13, 48, 0.96);
  --text-color: #f6f0ff;
  --text-muted-color: rgba(226, 214, 242, 0.72);
  --text-muted-highlight-color: rgba(245, 208, 254, 0.86);
  --heading-color: #f8f2ff;
  --label-color: #f0dbff;
  --link-color: #e879f9;
  --link-underline-color: rgba(232, 121, 249, 0.42);
  --btn-border-color: rgba(216, 180, 254, 0.28);
  --blockquote-border-color: rgba(190, 24, 93, 0.58);
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(88, 28, 135, 0.2), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(190, 24, 93, 0.16), transparent 30rem),
    linear-gradient(145deg, #0b0711 0%, #100817 45%, #170b22 100%);
  color: var(--text-color);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 78%);
}

#sidebar {
  background:
    linear-gradient(180deg, rgba(32, 11, 46, 0.98), rgba(14, 8, 23, 0.98)),
    #170b22;
  border-right: 1px solid rgba(216, 180, 254, 0.1);
  box-shadow: 8px 0 30px rgba(5, 2, 10, 0.18);
}

#main-wrapper,
#topbar-wrapper,
#tail-wrapper {
  background: transparent;
}

#topbar {
  border-bottom-color: rgba(216, 180, 254, 0.12);
  background:
    linear-gradient(90deg, rgba(16, 8, 23, 0.94), rgba(31, 12, 45, 0.82)),
    var(--topbar-bg);
  backdrop-filter: blur(14px);
}

main,
#panel-wrapper {
  color: var(--text-color);
}

.content,
.post-content {
  color: rgba(246, 240, 255, 0.9);
}

.dynamic-title {
  color: #f8f2ff;
  text-shadow:
    0 0 18px rgba(126, 34, 206, 0.28),
    0 0 30px rgba(190, 24, 93, 0.16);
}

a {
  text-decoration-color: rgba(232, 121, 249, 0.38);
}

a:hover,
a:focus-visible {
  color: #f0abfc;
}

.btn,
.btn-box-shadow {
  border-color: rgba(216, 180, 254, 0.24);
}

.highlight .code-highlight {
  background-color: yellow !important;
  color: black !important;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: bold;
}

#sidebar .profile-wrapper {
  isolation: isolate;
}

#sidebar #avatar {
  position: relative;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(126, 34, 206, 0.78),
    0 0 22px rgba(126, 34, 206, 0.22),
    inset 0 0 16px rgba(255, 255, 255, 0.06);
  transition:
    box-shadow 260ms ease,
    filter 260ms ease,
    transform 260ms ease;
}

#sidebar #avatar::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
  transition:
    border-color 260ms ease,
    transform 260ms ease;
}

#sidebar #avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}

#sidebar #avatar:hover,
#sidebar #avatar:focus-visible {
  transform: translateY(-3px) scale(1.035);
  box-shadow:
    0 0 0 2px rgba(190, 24, 93, 0.86),
    0 0 28px rgba(190, 24, 93, 0.3),
    0 0 44px rgba(88, 28, 135, 0.28);
  filter: saturate(1.35);
}

#sidebar #avatar:hover::after,
#sidebar #avatar:focus-visible::after {
  border-color: rgba(216, 180, 254, 0.82);
  transform: scale(0.9);
}

#sidebar .site-title {
  position: relative;
  max-width: 100%;
  padding-bottom: 0.18rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.62rem;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
  color: #d8b4fe;
  text-shadow: 0 0 14px rgba(126, 34, 206, 0.34);
  transition:
    color 220ms ease,
    font-family 220ms ease,
    letter-spacing 220ms ease,
    text-shadow 220ms ease,
    transform 220ms ease;
}

#sidebar .site-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.12rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #581c87, #7e22ce, #be185d);
  opacity: 0.72;
  transform: scaleX(0.28);
  transform-origin: left;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

#sidebar .site-title:hover,
#sidebar .site-title:focus-visible {
  font-family: Consolas, "Cascadia Code", "Courier New", monospace;
  color: #ffffff;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(216, 180, 254, 0.56),
    0 0 24px rgba(190, 24, 93, 0.34);
  transform: translateX(2px);
}

#sidebar .site-title:hover::after,
#sidebar .site-title:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  #sidebar #avatar,
  #sidebar #avatar::after,
  #sidebar .site-title,
  #sidebar .site-title::after {
    transition: none;
  }
}

.floating-gif-widget {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  width: 8.75rem;
  aspect-ratio: 1;
  padding: 0.35rem;
  border: 2px solid rgba(126, 34, 206, 0.95);
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, rgba(12, 7, 22, 0.94), rgba(35, 12, 48, 0.82)),
    rgba(10, 7, 18, 0.88);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.16),
    0 0 20px rgba(126, 34, 206, 0.28),
    0 0 34px rgba(190, 24, 93, 0.18);
  pointer-events: none;
}

.floating-gif-widget img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  filter: saturate(1.12) contrast(1.04);
}

.auto-translate-widget {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 9.5rem);
  z-index: 21;
  font-size: 0.875rem;
}

.google-translate-element,
.goog-te-banner-frame,
.goog-te-gadget,
.skiptranslate iframe {
  display: none !important;
}

body {
  top: 0 !important;
}

.auto-translate-toggle,
.auto-translate-primary,
.auto-translate-select {
  width: 100%;
  border: 1px solid rgba(126, 34, 206, 0.82);
  border-radius: 0.5rem;
  color: #f5f3ff;
  background: rgba(14, 9, 24, 0.96);
  box-shadow: 0 0 18px rgba(126, 34, 206, 0.22);
}

.auto-translate-toggle,
.auto-translate-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.auto-translate-toggle:hover,
.auto-translate-toggle:focus-visible,
.auto-translate-primary:hover,
.auto-translate-primary:focus-visible,
.auto-translate-select:focus-visible {
  border-color: rgba(190, 24, 93, 0.92);
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(190, 24, 93, 0.2),
    0 0 22px rgba(126, 34, 206, 0.34);
}

.auto-translate-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.55rem);
  width: min(15rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border: 1px solid rgba(126, 34, 206, 0.34);
  border-radius: 0.65rem;
  background:
    linear-gradient(135deg, rgba(12, 7, 22, 0.98), rgba(35, 12, 48, 0.95)),
    rgba(10, 7, 18, 0.97);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(190, 24, 93, 0.2);
}

.auto-translate-hint,
.auto-translate-select-label {
  display: block;
  margin: 0 0 0.5rem;
  color: rgba(245, 243, 255, 0.78);
  line-height: 1.35;
}

#post-list .card,
#post-list .post-preview,
#post-list article,
.post-preview.card {
  border: 1px solid rgba(126, 34, 206, 0.52);
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, rgba(18, 12, 30, 0.38), rgba(46, 16, 65, 0.22)),
    var(--card-bg);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.05),
    0 10px 28px rgba(5, 2, 10, 0.18),
    0 0 24px rgba(88, 28, 135, 0.14);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

#post-list .card:hover,
#post-list .card:focus-within,
#post-list .post-preview:hover,
#post-list .post-preview:focus-within,
#post-list article:hover,
#post-list article:focus-within,
.post-preview.card:hover,
.post-preview.card:focus-within {
  border-color: rgba(190, 24, 93, 0.76);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.1),
    0 14px 34px rgba(5, 2, 10, 0.24),
    0 0 28px rgba(126, 34, 206, 0.24),
    0 0 42px rgba(190, 24, 93, 0.14);
  transform: translateY(-2px);
}

#post-list .card a,
#post-list .post-preview a,
#post-list article a,
.post-preview.card {
  outline-color: #be185d;
}

#panel-wrapper .access {
  color: rgba(246, 240, 255, 0.8);
}

#panel-wrapper .access > section,
#panel-wrapper .access > div,
#panel-wrapper .access .post-tag {
  border-color: rgba(126, 34, 206, 0.38);
}

.post-tag,
.post-tag.btn,
#tags a.tag {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  min-height: 2.1rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(126, 34, 206, 0.55);
  border-radius: 0.5rem;
  color: #f5d0fe;
  background:
    linear-gradient(135deg, rgba(45, 14, 65, 0.76), rgba(76, 20, 82, 0.48)),
    rgba(19, 9, 31, 0.86);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.04),
    0 8px 22px rgba(5, 2, 10, 0.16);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.post-tag:hover,
.post-tag:focus-visible,
.post-tag.btn:hover,
.post-tag.btn:focus-visible,
#tags a.tag:hover,
#tags a.tag:focus-visible {
  border-color: rgba(190, 24, 93, 0.78);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(76, 20, 82, 0.92), rgba(136, 19, 55, 0.5)),
    rgba(26, 10, 39, 0.92);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.1),
    0 10px 26px rgba(5, 2, 10, 0.22),
    0 0 24px rgba(190, 24, 93, 0.18);
  transform: translateY(-1px);
}

.card.categories {
  overflow: hidden;
  border: 1px solid rgba(126, 34, 206, 0.48);
  border-radius: 0.75rem;
  background:
    linear-gradient(145deg, rgba(22, 10, 34, 0.96), rgba(43, 15, 60, 0.82)),
    var(--card-bg);
  box-shadow:
    0 0 0 1px rgba(216, 180, 254, 0.05),
    0 16px 36px rgba(5, 2, 10, 0.22),
    0 0 30px rgba(88, 28, 135, 0.12);
}

.card.categories .card-header {
  border-bottom: 1px solid rgba(216, 180, 254, 0.14);
  color: #f8f2ff;
  background:
    linear-gradient(90deg, rgba(88, 28, 135, 0.48), rgba(190, 24, 93, 0.22)),
    rgba(16, 8, 23, 0.9);
}

.card.categories .list-group {
  background: transparent;
}

.card.categories .list-group-item {
  border-color: rgba(216, 180, 254, 0.1);
  color: rgba(246, 240, 255, 0.86);
  background: rgba(16, 8, 23, 0.38);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.card.categories .list-group-item:hover,
.card.categories .list-group-item:focus-within {
  border-color: rgba(190, 24, 93, 0.34);
  color: #ffffff;
  background: rgba(59, 18, 84, 0.42);
}

.card.categories .category-trigger {
  color: #f5d0fe !important;
}

.card.categories .category-trigger:hover,
.card.categories .category-trigger:focus-visible {
  color: #ffffff !important;
}

#archives {
  position: relative;
  padding-left: 0.9rem;
  color: rgba(246, 240, 255, 0.86);
}

#archives::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.5rem;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7e22ce, #be185d, rgba(216, 180, 254, 0.18));
  box-shadow: 0 0 18px rgba(126, 34, 206, 0.3);
}

#archives .year {
  color: #f8f2ff;
  text-shadow: 0 0 16px rgba(190, 24, 93, 0.18);
}

#archives .date {
  color: #d8b4fe;
}

#archives ul li:nth-child(odd),
html[data-mode="dark"] #archives ul li:nth-child(odd),
html[data-mode="light"] #archives ul li:nth-child(odd) {
  background:
    linear-gradient(90deg, transparent, rgba(88, 28, 135, 0.18), rgba(190, 24, 93, 0.08), transparent) !important;
}

#archives a {
  color: rgba(246, 240, 255, 0.88);
}

#archives a:hover,
#archives a:focus-visible {
  color: #f0abfc;
}

#archives li,
#archives .post-tail-wrapper,
#archives .post-meta {
  border-color: rgba(216, 180, 254, 0.12);
}

.auto-translate-select-label {
  margin-top: 0.7rem;
  font-size: 0.75rem;
}

.auto-translate-select {
  min-height: 2.35rem;
  padding: 0.35rem 0.45rem;
}

@media (max-width: 1199.98px) {
  .floating-gif-widget {
    width: 7rem;
  }

  .auto-translate-widget {
    bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 7.75rem);
  }
}

@media (max-width: 575.98px) {
  .floating-gif-widget {
    right: 0.75rem;
    bottom: 4.25rem;
    width: 5.5rem;
    padding: 0.25rem;
    border-radius: 0.6rem;
  }

  .floating-gif-widget img {
    border-radius: 0.42rem;
  }

  .auto-translate-widget {
    right: 0.75rem;
    bottom: 10.25rem;
    max-width: calc(100vw - 1.5rem);
  }

  .auto-translate-toggle {
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
  }

  .auto-translate-toggle .auto-translate-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
