/* ==========================================================================
   小鱼技术栈 · 二次元梦幻皮肤 for Hexo Butterfly
   ========================================================================== */

:root {
  --bg: #fff8fc;
  --bg-2: #fdf1f8;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --ink: #4b3759;
  --ink-soft: #6c5878;
  --muted: #a08ba6;
  --line: rgba(236, 106, 158, 0.18);
  --pink: #ec6a9e;
  --pink-soft: rgba(236, 106, 158, 0.1);
  --lav: #8f7bff;
  --blue: #6bb7e8;
  --gold: #e9b85c;
  --shadow: 0 16px 40px rgba(196, 114, 151, 0.13);
  --code-bg: #2c2038;
}

[data-theme="dark"] {
  --bg: #1a1324;
  --bg-2: #21182e;
  --panel: rgba(42, 30, 54, 0.9);
  --panel-solid: #2a1e36;
  --ink: #f4e9f3;
  --ink-soft: #cbb9d4;
  --muted: #a992b5;
  --line: rgba(255, 164, 202, 0.18);
  --pink: #ff8ebc;
  --pink-soft: rgba(255, 142, 188, 0.12);
  --lav: #b6a4ff;
  --blue: #8ecbff;
  --gold: #ffd780;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  --code-bg: #140e1d;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Dreamy background ---------- */
#web_bg {
  background:
    radial-gradient(circle at 8% 3%, rgba(255, 183, 214, 0.52), transparent 30%),
    radial-gradient(circle at 94% 6%, rgba(181, 164, 255, 0.42), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(255, 226, 240, 0.78), transparent 42%),
    radial-gradient(rgba(236, 106, 158, 0.075) 1px, transparent 1.5px) 0 0 / 28px 28px,
    linear-gradient(180deg, #fff8fc 0%, #fdf1f8 50%, #f3eaff 100%) !important;
  background-attachment: fixed !important;
}

[data-theme="dark"] #web_bg {
  background:
    radial-gradient(circle at 8% 3%, rgba(236, 106, 158, 0.2), transparent 30%),
    radial-gradient(circle at 94% 6%, rgba(143, 123, 255, 0.2), transparent 30%),
    radial-gradient(rgba(255, 183, 214, 0.06) 1px, transparent 1.5px) 0 0 / 28px 28px,
    linear-gradient(180deg, #1a1324 0%, #21182e 52%, #171020 100%) !important;
  background-attachment: fixed !important;
}

/* ---------- Navigation ---------- */
#nav {
  background: rgba(255, 248, 252, 0.88);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid rgba(236, 106, 158, 0.12);
}

#page-header #nav {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

#nav .site-name,
#nav a {
  color: var(--ink);
}

#page-header #nav .site-name,
#page-header #nav a {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 12px rgba(53, 33, 70, 0.28);
}

#page-header #nav a:hover {
  color: #ffe0ee;
}

#page-header.nav-fixed #nav,
#nav.nav-fixed {
  background: rgba(255, 248, 252, 0.94) !important;
  border-bottom-color: rgba(236, 106, 158, 0.16);
  box-shadow: 0 8px 28px rgba(121, 70, 100, 0.1);
}

#page-header.nav-fixed #nav .site-name,
#page-header.nav-fixed #nav a {
  color: var(--ink);
  text-shadow: none;
}

#page-header.nav-fixed #nav a:hover {
  color: var(--pink);
}

[data-theme="dark"] #nav {
  background: rgba(26, 19, 36, 0.9);
}

[data-theme="dark"] #page-header.nav-fixed #nav,
[data-theme="dark"] #nav.nav-fixed {
  background: rgba(26, 19, 36, 0.95) !important;
}

[data-theme="dark"] #page-header.nav-fixed #nav .site-name,
[data-theme="dark"] #page-header.nav-fixed #nav a {
  color: var(--ink);
}

#nav .site-name {
  font-weight: 800;
  letter-spacing: 0.02em;
}

#nav .search,
#nav .toggle-menu {
  color: inherit;
}

/* ---------- Hero ---------- */
#page-header {
  background-position: center center;
  background-size: cover;
}

#page-header.full_page {
  background-position: center bottom;
}

#page-header.full_page::after {
  content: "";
  position: absolute;
  right: 64px;
  bottom: 8px;
  z-index: 10 !important;
  width: 300px;
  height: 300px;
  background: url("/img/mascot.png") center / contain no-repeat;
  filter: drop-shadow(0 12px 18px rgba(80, 45, 100, 0.2));
  pointer-events: none;
}

#page-header::before {
  background: linear-gradient(180deg, rgba(38, 25, 58, 0.42) 0%, rgba(38, 25, 58, 0.04) 45%, rgba(38, 25, 58, 0.2) 100%);
}

#page-header.full_page::before {
  background: linear-gradient(180deg, rgba(38, 25, 58, 0.3) 0%, rgba(38, 25, 58, 0.02) 55%, transparent 100%);
}

#site-title {
  display: inline-block;
  font-family: "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 6px 26px rgba(45, 25, 66, 0.42), 0 0 30px rgba(255, 205, 227, 0.35);
}

#site-title::before {
  content: "✧ ";
  color: #ffe5f0;
  font-size: 0.62em;
  font-weight: 400;
  vertical-align: 0.2em;
  letter-spacing: 0;
}

#site-title::after {
  content: "";
  display: block;
  width: 92px;
  height: 4px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd4e6, #ff9ec7 45%, #b8a4ff);
  box-shadow: 0 0 18px rgba(255, 180, 213, 0.7);
}

#site-subtitle {
  margin-top: 14px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #ffeaf4;
  text-shadow: 0 2px 12px rgba(58, 35, 78, 0.38);
}

#site-subtitle::before {
  content: "♡ ";
  color: #ffd1e4;
}

#page-header #scroll-down .scroll-down-effects {
  color: rgba(255, 240, 247, 0.85);
}

/* ---------- Home cards ---------- */
#recent-posts > .recent-post-item {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 213, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 253, 0.92));
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] #recent-posts > .recent-post-item {
  border-color: rgba(255, 164, 202, 0.22);
  background: linear-gradient(180deg, rgba(47, 33, 61, 0.96), rgba(35, 24, 47, 0.96));
}

#recent-posts > .recent-post-item:hover {
  border-color: rgba(236, 106, 158, 0.72);
  box-shadow: 0 18px 48px rgba(196, 114, 151, 0.22), 0 0 0 4px rgba(255, 199, 223, 0.18);
}

#recent-posts > .recent-post-item .post_cover {
  overflow: hidden;
}

#recent-posts > .recent-post-item .post_cover img {
  filter: saturate(1.04);
}

#recent-posts > .recent-post-item .recent-post-info {
  padding: 24px 26px 22px;
}

.recent-post-info .article-title {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-wrap: balance;
}

.recent-post-info .article-title:hover {
  color: var(--pink);
}

.recent-post-info .article-meta-wrap {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.recent-post-info .article-meta-wrap i {
  color: var(--pink);
}

.recent-post-info .article-meta-wrap a {
  color: var(--muted);
}

.recent-post-info .article-meta-wrap a:hover {
  color: var(--pink);
}

.recent-post-info .content {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ---------- Sidebar ---------- */
#aside-content .card-widget {
  border-radius: 20px;
  border: 1px solid rgba(255, 182, 213, 0.42);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(196, 114, 151, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] #aside-content .card-widget {
  border-color: rgba(255, 164, 202, 0.2);
}

#aside-content .card-info .avatar-img img {
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px rgba(255, 190, 218, 0.65), 0 10px 28px rgba(196, 114, 151, 0.24);
}

[data-theme="dark"] #aside-content .card-info .avatar-img img {
  border-color: #2a1e36;
  box-shadow: 0 0 0 4px rgba(255, 164, 202, 0.35), 0 10px 28px rgba(0, 0, 0, 0.3);
}

#aside-content .card-info .author-info-name {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.06em;
}

#aside-content .card-info .author-info-description {
  color: var(--muted);
  line-height: 1.75;
}

#aside-content .item-headline {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

#aside-content .item-headline i {
  color: var(--pink);
}

#aside-content #card-info-btn {
  display: block;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9ec7, #b8a4ff);
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 22px rgba(236, 106, 158, 0.24);
}

#aside-content #card-info-btn:hover {
  color: #fff !important;
  filter: brightness(1.04);
  box-shadow: 0 10px 26px rgba(236, 106, 158, 0.32);
}

#aside-content #card-info-btn i,
#aside-content #card-info-btn span {
  color: #fff !important;
}

#aside-content .card-info-social-icons {
  display: none;
}

#aside-content .site-data .headline {
  color: var(--muted);
  font-size: 0.72rem;
}

#aside-content .site-data .length-num {
  color: var(--pink);
  font-weight: 800;
}

#aside-content .card-tag-cloud a,
#aside-content .card-categories a,
#aside-content .card-archives a,
#aside-content .card-recent-post a {
  color: var(--ink-soft);
}

#aside-content .card-tag-cloud a:hover,
#aside-content .card-categories a:hover,
#aside-content .card-archives a:hover,
#aside-content .card-recent-post a:hover {
  color: var(--pink);
}

#aside-content .card-tag-cloud a {
  border: 1px solid rgba(255, 182, 213, 0.45);
  border-radius: 999px;
  padding: 3px 9px;
  margin: 3px;
  background: rgba(255, 245, 250, 0.7);
}

[data-theme="dark"] #aside-content .card-tag-cloud a {
  background: rgba(255, 142, 188, 0.06);
}

/* ---------- Article ---------- */
[data-theme="dark"] #page,
[data-theme="dark"] #post,
[data-theme="dark"] #archive {
  background: var(--panel) !important;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

[data-theme="light"] #page,
[data-theme="light"] #post,
[data-theme="light"] #archive {
  background: var(--panel) !important;
  border: 1px solid rgba(255, 182, 213, 0.42);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

#page.nc {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#page-header.post-bg::before {
  background: linear-gradient(180deg, rgba(38, 25, 58, 0.45), rgba(38, 25, 58, 0.08));
}

#page-header .post-title {
  letter-spacing: 0.015em;
  text-shadow: 0 4px 24px rgba(45, 25, 66, 0.35);
}

#article-container {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.95;
}

#article-container p {
  margin-bottom: 1.3em;
  letter-spacing: 0.012em;
}

#article-container h1,
#article-container h2,
#article-container h3,
#article-container h4 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.015em;
}

#article-container h2 {
  margin-top: 2.15em;
  padding-left: 32px;
  border-bottom: 0;
  line-height: 1.55;
}

#article-container h2::before {
  content: "✧";
  position: absolute;
  left: 0;
  top: 0.08em;
  color: var(--pink);
  font-size: 0.9em;
  font-weight: 400;
}

#article-container h2::after {
  content: "";
  display: block;
  width: 62px;
  height: 3px;
  margin-top: 0.5em;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb5d3, rgba(143, 123, 255, 0.2));
}

#article-container h3 {
  padding-left: 13px;
  border-left: 4px solid #ffb5d3;
  line-height: 1.55;
}

#article-container a:not(.headerlink) {
  color: var(--pink);
  border-bottom: 1px solid rgba(236, 106, 158, 0.3);
  text-underline-offset: 3px;
}

#article-container a:not(.headerlink):hover {
  color: #d64d88;
  border-bottom-color: #d64d88;
}

#article-container blockquote {
  border-left: 4px solid #ffa9cc;
  border-radius: 0 14px 14px 0;
  background: rgba(255, 201, 223, 0.22);
  color: var(--ink-soft);
  padding: 18px 22px;
  margin: 1.7em 0;
}

#article-container blockquote p {
  margin: 0.3em 0;
}

#article-container code {
  border-radius: 6px;
  background: rgba(255, 182, 213, 0.18);
  color: #c33f78;
  padding: 0.16em 0.42em;
}

[data-theme="dark"] #article-container code {
  color: #ffb2d0;
}

#article-container .highlight-wrap {
  border: 1px solid rgba(255, 182, 213, 0.16);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(75, 44, 89, 0.14);
}

#article-container .highlight-wrap .code-area,
#article-container figure.highlight,
#article-container pre {
  background: var(--code-bg);
}

#article-container img {
  border-radius: 14px;
}

#article-container hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236, 106, 158, 0.25), transparent);
  margin: 2.6em 0;
}

#article-container table {
  border-color: rgba(236, 106, 158, 0.18);
}

#article-container table thead {
  background: rgba(255, 182, 213, 0.16);
}

.post-copyright {
  border-radius: 14px;
  border: 1px solid rgba(255, 182, 213, 0.3);
  background: rgba(255, 201, 223, 0.12);
  margin-top: 2em;
}

#pagination .page-number {
  border-radius: 10px;
  border: 1px solid rgba(255, 182, 213, 0.45);
  background: var(--panel);
  color: var(--ink-soft);
  transition: all 0.22s ease;
}

#pagination .page-number.current {
  background: linear-gradient(135deg, #ff9ec7, #b8a4ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(236, 106, 158, 0.24);
}

/* TOC */
#card-toc .toc-link {
  color: var(--muted);
}

#card-toc .toc-link.active {
  color: var(--pink) !important;
  background: var(--pink-soft) !important;
  border-radius: 8px;
  font-weight: 700;
}

#card-toc .toc-link.active::before {
  background: var(--pink);
}

/* ---------- Archives / categories / tags ---------- */
#page .category-lists::before {
  content: "✧ TOPICS";
  display: block;
  margin: 0 0 10px 4px;
  color: var(--pink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

#page .tag-cloud-list::before {
  content: "♡ TAGS";
  display: block;
  margin: 0 0 14px 4px;
  color: var(--pink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.85;
  text-align: left;
}

#archive .article-sort-title,
#page .category-list-link {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

#page .category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 44px;
}

#page .category-list-item {
  position: relative;
  padding: 13px 10px 13px 27px;
  border-bottom: 1px dashed rgba(236, 106, 158, 0.2);
}

#page .category-list-item::before {
  content: "♡";
  position: absolute;
  left: 0;
  top: 50%;
  color: var(--pink);
  font-size: 1rem;
  transform: translateY(-50%);
}

#page .category-list-count {
  float: right;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 182, 213, 0.4);
  color: var(--pink);
  background: rgba(255, 201, 223, 0.15);
  font-size: 0.72rem;
  line-height: 24px;
  text-align: center;
}

#page .tag-cloud-list a {
  border-radius: 999px !important;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(196, 114, 151, 0.16);
}

/* ---------- Footer ---------- */
#footer,
#footer .footer-other,
#footer .copyright,
#footer .framework-info,
#footer .footer_custom_text {
  background: transparent;
  color: var(--muted);
}

#footer {
  border-top: 1px solid rgba(236, 106, 158, 0.14);
}

#footer::before {
  background: linear-gradient(90deg, transparent, rgba(236, 106, 158, 0.22), transparent);
}

#footer a {
  color: var(--pink);
}

/* ---------- Search ---------- */
.search-dialog {
  border-radius: 20px;
  border: 1px solid rgba(255, 182, 213, 0.55);
  background: #fffafd;
  box-shadow: 0 24px 70px rgba(121, 70, 100, 0.22);
}

[data-theme="dark"] .search-dialog {
  border-color: rgba(255, 164, 202, 0.22);
  background: #241a30;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

#local-search .search-dialog .search-nav {
  background: linear-gradient(90deg, rgba(255, 182, 213, 0.2), transparent);
  color: var(--ink);
}

#local-search .search-dialog .local-search-box input {
  border-radius: 999px;
  border: 1px solid rgba(255, 182, 213, 0.55);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

[data-theme="dark"] #local-search .search-dialog .local-search-box input {
  background: rgba(20, 13, 29, 0.6);
}

#local-search .search-dialog .local-search-box input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 182, 213, 0.18);
}

#local-search .search-result {
  border-bottom: 1px dashed rgba(236, 106, 158, 0.2);
  color: var(--muted) !important;
}

#local-search .search-result-list .search-result,
#local-search .search-result-list .search-result * {
  color: var(--muted) !important;
}

#local-search .search-result-list .search-keyword {
  color: var(--pink) !important;
}

#local-search .search-result-title,
#local-search .search-result-title a {
  color: var(--ink) !important;
}

#local-search .search-result-title a:hover,
#local-search .search-keyword {
  color: var(--pink) !important;
}

/* ---------- 404 ---------- */
[data-theme="light"] .error-content {
  background: var(--panel);
  border: 1px solid rgba(255, 182, 213, 0.42);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .error-content {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.error_subtitle {
  color: var(--muted);
}

/* ---------- Scrollbar & selection ---------- */
::selection {
  background: rgba(255, 158, 199, 0.35);
  color: #4b3759;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ffb4d3, #b8a4ff);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 241, 248, 0.9);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff8ebc, #8f7bff);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1324;
}

/* ---------- Small screens ---------- */
@media screen and (max-width: 768px) {
  #page-header.full_page {
    background-image: url("/img/banner-mobile.jpg") !important;
    background-position: center bottom;
  }

  #page-header.full_page::after {
    right: 18px;
    bottom: 12px;
    width: 188px;
    height: 188px;
  }

  #site-title {
    font-size: 2.2rem;
    letter-spacing: 0.04em;
  }

  #site-subtitle {
    font-size: 0.84rem;
    letter-spacing: 0.06em;
  }

  #recent-posts > .recent-post-item .recent-post-info {
    padding: 20px 20px 22px;
  }

  #article-container {
    font-size: 15.5px;
    line-height: 1.9;
  }

  #page .category-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------- Knowledge base ---------- */
.kb-shell {
  margin-top: 2px;
}

.kb-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 26px;
  padding: 34px 38px;
  border: 1px solid rgba(255, 182, 213, 0.5);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 228, 240, 0.9), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 231, 242, 0.8));
  box-shadow: 0 16px 42px rgba(196, 114, 151, 0.12);
}

[data-theme="dark"] .kb-hero {
  border-color: rgba(255, 164, 202, 0.2);
  background:
    radial-gradient(circle at 90% 20%, rgba(143, 123, 255, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(48, 33, 65, 0.95), rgba(38, 26, 52, 0.95));
}

.kb-hero::before,
.kb-hero::after {
  content: "✧";
  position: absolute;
  color: rgba(236, 106, 158, 0.15);
  font-size: 8rem;
  line-height: 1;
  pointer-events: none;
}

.kb-hero::before {
  top: -28px;
  left: -8px;
  transform: rotate(18deg);
}

.kb-hero::after {
  right: 12px;
  bottom: -58px;
  transform: rotate(-12deg);
}

.kb-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.kb-eyebrow {
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

#article-container .kb-hero h2 {
  margin: 10px 0 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 800;
  line-height: 1.35;
}

#article-container .kb-hero h2::before,
#article-container .kb-hero h2::after {
  display: none;
}

.kb-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.kb-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.kb-hero-stats span {
  padding: 6px 12px;
  border: 1px solid rgba(255, 182, 213, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.74rem;
}

[data-theme="dark"] .kb-hero-stats span {
  background: rgba(255, 142, 188, 0.06);
}

.kb-hero-stats strong {
  color: var(--pink);
  font-size: 0.98rem;
  margin-right: 2px;
}

.kb-hero-mascot {
  position: relative;
  z-index: 1;
  width: 190px;
  max-width: 26%;
  height: auto;
  flex: none;
  filter: drop-shadow(0 14px 20px rgba(90, 45, 110, 0.18));
  animation: kb-float 5s ease-in-out infinite;
}

@keyframes kb-float {
  0%, 100% { transform: translateY(0) rotate(0.5deg); }
  50% { transform: translateY(-8px) rotate(-0.5deg); }
}

/* Toolbar */
.kb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.kb-search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255, 182, 213, 0.55);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(196, 114, 151, 0.08);
}

[data-theme="dark"] .kb-search {
  background: rgba(36, 24, 48, 0.82);
}

.kb-search i {
  color: var(--pink);
}

.kb-search input {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.94rem;
}

.kb-search input::placeholder {
  color: var(--muted);
}

.kb-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
}

.kb-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.kb-sort select {
  padding: 8px 12px;
  border: 1px solid rgba(255, 182, 213, 0.45);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
}

[data-theme="dark"] .kb-sort select {
  background: rgba(36, 24, 48, 0.85);
}

.kb-count {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* Category chips */
.kb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.kb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px 7px 13px;
  border: 1px solid rgba(255, 182, 213, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-soft);
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

[data-theme="dark"] .kb-chip {
  background: rgba(42, 30, 54, 0.82);
}

.kb-chip:hover {
  transform: translateY(-1px);
  border-color: var(--kb-accent, var(--pink));
}

.kb-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--kb-accent, #ff9ec7), #b8a4ff);
  color: #fff;
  box-shadow: 0 7px 18px rgba(236, 106, 158, 0.2);
}

.kb-chip-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.kb-chip-count {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  font-size: 0.66rem;
  text-align: center;
}

.kb-chip.is-active .kb-chip-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Cards */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.kb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 258px;
  overflow: hidden;
  padding: 22px 23px 17px;
  border: 1px solid rgba(255, 182, 213, 0.44);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 228, 240, 0.55), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 252, 0.96));
  box-shadow: 0 10px 26px rgba(196, 114, 151, 0.09);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .kb-card {
  background:
    radial-gradient(circle at 100% 100%, rgba(143, 123, 255, 0.1), transparent 40%),
    linear-gradient(145deg, rgba(48, 33, 63, 0.97), rgba(34, 23, 46, 0.98));
  border-color: rgba(255, 164, 202, 0.2);
}

.kb-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--kb-accent, #ff9ec7), rgba(184, 164, 255, 0.35));
}

.kb-card:hover {
  transform: translateY(-5px);
  border-color: var(--kb-accent, rgba(236, 106, 158, 0.75));
  box-shadow: 0 20px 42px rgba(196, 114, 151, 0.18);
}

.kb-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.kb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 226, 240, 0.72);
  font-size: 1rem;
}

[data-theme="dark"] .kb-icon {
  background: rgba(255, 142, 188, 0.1);
}

.kb-cat {
  padding: 3px 9px;
  border: 1px solid rgba(255, 182, 213, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--kb-accent, #d95488);
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="dark"] .kb-cat {
  background: rgba(255, 142, 188, 0.06);
}

.kb-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.kb-no {
  position: absolute;
  right: 17px;
  bottom: 4px;
  color: var(--kb-accent, #ec6a9e);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.06;
  pointer-events: none;
}

.kb-title {
  margin: 0 0 8px;
  padding-right: 24px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kb-summary {
  display: -webkit-box;
  flex: 1;
  overflow: hidden;
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.72;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.kb-tag {
  color: var(--muted);
  font-size: 0.68rem;
}

.kb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(236, 106, 158, 0.16);
  color: var(--muted);
  font-size: 0.69rem;
}

.kb-arrow {
  color: var(--kb-accent, var(--pink));
  font-weight: 700;
  transition: transform 0.2s ease;
}

.kb-card:hover .kb-arrow {
  transform: translateX(4px);
}

.kb-empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.kb-empty span {
  display: block;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 1.5rem;
}

.kb-more-wrap {
  margin-top: 26px;
  text-align: center;
}

.kb-more {
  padding: 10px 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9ec7, #b8a4ff);
  box-shadow: 0 10px 24px rgba(236, 106, 158, 0.22);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kb-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(236, 106, 158, 0.3);
}

/* Detail page */
.kb-back {
  margin: 0 0 14px;
  font-size: 0.82rem;
}

.kb-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.kb-article-cat,
.kb-article-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 201, 223, 0.2);
  color: var(--pink);
  font-size: 0.74rem;
}

@media screen and (max-width: 1100px) {
  .kb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .kb-hero {
    align-items: flex-start;
    padding: 26px 22px;
  }

  .kb-hero-mascot {
    width: 110px;
    max-width: 30%;
  }

  .kb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .kb-tools {
    justify-content: space-between;
  }

  .kb-count {
    margin-left: auto;
  }

  .kb-grid {
    grid-template-columns: 1fr;
  }

  .kb-card {
    min-height: 0;
  }
}

/* Knowledge page: compact hero and wider editorial grid */
body:has(.kb-shell) #content-inner.layout {
  max-width: 1200px;
}

body:has(.kb-shell) #page-header:not(.full_page) {
  height: 300px !important;
}

.kb-hero {
  padding: 24px 32px;
}

#article-container .kb-hero h2 {
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
}

.kb-hero-mascot {
  width: 150px;
}

.kb-hero-stats {
  margin-top: 12px;
}

.kb-title {
  -webkit-line-clamp: 3;
}

@media screen and (max-width: 768px) {
  body:has(.kb-shell) #page-header:not(.full_page) {
    height: 240px !important;
  }

  .kb-hero {
    padding: 22px 20px;
  }

  .kb-hero-mascot {
    width: 100px;
  }
}

@media screen and (max-width: 768px) {
  .kb-hero-stats {
    gap: 6px;
  }

  .kb-hero-stats span {
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .kb-hero-stats strong {
    font-size: 0.84rem;
  }
}

/* Knowledge page: custom right sidebar */
body:has(.kb-shell) #content-inner.layout {
  max-width: 1280px;
}

.kb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 26px;
}

.kb-main {
  min-width: 0;
  scroll-margin-top: 84px;
}

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

.kb-side {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kb-side-card {
  padding: 18px;
  border: 1px solid rgba(255, 182, 213, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(196, 114, 151, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .kb-side-card {
  border-color: rgba(255, 164, 202, 0.2);
  background: rgba(42, 30, 54, 0.88);
}

.kb-overview {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 210, 230, 0.7), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 242, 248, 0.92));
}

[data-theme="dark"] .kb-overview {
  background:
    radial-gradient(circle at 100% 0%, rgba(143, 123, 255, 0.16), transparent 48%),
    linear-gradient(145deg, rgba(48, 33, 63, 0.95), rgba(35, 24, 47, 0.95));
}

.kb-side-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.kb-side-title span {
  color: var(--pink);
  font-size: 0.95rem;
}

.kb-side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.kb-side-stats div {
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

[data-theme="dark"] .kb-side-stats div {
  background: rgba(255, 142, 188, 0.06);
}

.kb-side-stats strong {
  display: block;
  color: var(--pink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.kb-side-stats span {
  color: var(--muted);
  font-size: 0.65rem;
}

.kb-side-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}

.kb-side-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pink);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.kb-side-link:hover {
  color: #d64d88;
}

.kb-side-cats {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kb-side-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.kb-side-cat:hover,
.kb-side-cat.is-active {
  background: rgba(255, 201, 223, 0.22);
  color: var(--pink);
}

[data-theme="dark"] .kb-side-cat:hover,
[data-theme="dark"] .kb-side-cat.is-active {
  background: rgba(255, 142, 188, 0.1);
}

.kb-side-cat-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.kb-side-cat-icon {
  font-size: 0.9rem;
}

.kb-side-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-side-cat-count {
  flex: none;
  min-width: 21px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
}

[data-theme="dark"] .kb-side-cat-count {
  background: rgba(255, 255, 255, 0.07);
}

.kb-side-cat.is-active .kb-side-cat-count {
  background: rgba(255, 255, 255, 0.5);
  color: var(--pink);
}

.kb-side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-side-tag {
  padding: 5px 9px;
  border: 1px solid rgba(255, 182, 213, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .kb-side-tag {
  background: rgba(255, 142, 188, 0.06);
}

.kb-side-tag:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.kb-side-recent {
  display: flex;
  flex-direction: column;
}

.kb-side-recent-item {
  display: block;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(236, 106, 158, 0.16);
  text-decoration: none;
}

.kb-side-recent-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kb-side-recent-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kb-side-recent-item:hover .kb-side-recent-title {
  color: var(--pink);
}

.kb-side-recent-date {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

@media screen and (max-width: 1150px) {
  .kb-layout {
    grid-template-columns: 1fr;
  }

  .kb-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 2;
  }
}

@media screen and (max-width: 768px) {
  .kb-side {
    grid-template-columns: 1fr;
  }

  .kb-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Rounded site font ---------- */
@font-face {
  font-family: "Zen Maru Gothic SC";
  src: url("/fonts/ZenMaruGothicSC-Regular.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Gothic SC";
  src: url("/fonts/ZenMaruGothicSC-Bold.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --rounded-font: "Zen Maru Gothic SC", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --rounded-code-font: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Noto Sans Mono CJK SC", monospace;
}

body,
body *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.iconfont):not(pre):not(code):not(kbd):not(samp):not(.highlight):not(.codeblock) {
  font-family: var(--rounded-font) !important;
}

pre,
pre *,
code,
code *,
kbd,
kbd *,
samp,
samp *,
.highlight,
.highlight *,
.codeblock,
.codeblock * {
  font-family: var(--rounded-code-font) !important;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   头像光圈 · 二次元抽卡灯箱
   ========================================================================== */

/* ---------- 头像：旋转渐变光圈 + 呼吸光晕 + 徽标 ---------- */
.avatar-img.acg-avatar,
#aside-content .card-info .avatar-img {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 26px auto 20px;
  border-radius: 50%;
  overflow: visible !important;
  cursor: pointer;
  isolation: isolate;
  outline: none;
  animation: none !important;
}

.acg-avatar img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #fff;
  border-radius: 50% !important;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(196, 114, 151, 0.26);
}

[data-theme="dark"] #aside-content .card-info .avatar-img img {
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.acg-avatar::before,
#aside-content .card-info .avatar-img::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: 2;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ffb6d5,
    #ff9ec7,
    #c9a7ff,
    #9bd4ff,
    #ffe2a8,
    #ffb6d5
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  animation: acg-halo-spin 9s linear infinite;
  pointer-events: none;
}

.acg-avatar::after,
#aside-content .card-info .avatar-img::after {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 150, 199, 0.48),
    rgba(159, 140, 255, 0.22) 55%,
    rgba(255, 218, 240, 0) 72%
  );
  filter: blur(10px);
  animation: acg-halo-breathe 4.6s ease-in-out infinite;
  pointer-events: none;
}

.acg-avatar:hover::before,
#aside-content .card-info .avatar-img:hover::before {
  animation-duration: 2.6s;
  filter: saturate(1.18) brightness(1.05);
}

.acg-avatar:hover::after,
#aside-content .card-info .avatar-img:hover::after {
  animation-duration: 1.8s;
}

#aside-content .card-info .avatar-img:hover img {
  transform: scale(1.06) rotate(0deg);
}

.acg-avatar:focus-visible {
  box-shadow: 0 0 0 4px rgba(236, 106, 158, 0.4);
}

.acg-avatar__badge {
  position: absolute;
  right: 0;
  bottom: 4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9ec7, #b8a4ff);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(236, 106, 158, 0.45), 0 0 0 2px #fff;
  animation: acg-badge-pop 2.8s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="dark"] .acg-avatar__badge {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), 0 0 0 2px #2a1e36;
}

/* ---------- 导航栏头像 ---------- */
#blog-info .site-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(255, 158, 199, 0.7),
    0 4px 14px rgba(255, 158, 199, 0.45);
  transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.3, 1), box-shadow 0.35s ease;
}

#blog-info a:hover .site-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(236, 106, 158, 0.6),
    0 8px 18px rgba(236, 106, 158, 0.4);
}

/* ---------- 灯箱 ---------- */
html.acg-lock,
html.acg-lock body {
  overflow: hidden !important;
}

.acg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.acg-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.acg-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 22, 50, 0.62);
  -webkit-backdrop-filter: blur(9px) saturate(1.1);
  backdrop-filter: blur(9px) saturate(1.1);
}

.acg-lightbox__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(900px, 94vw);
  max-height: 92vh;
  margin: 0;
  padding: 16px 16px 18px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 243, 249, 0.98));
  box-shadow: 0 30px 70px rgba(74, 32, 62, 0.38), 0 0 0 1px rgba(255, 182, 213, 0.75) inset;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.34s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.acg-lightbox.is-open .acg-lightbox__card {
  transform: none;
}

.acg-lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(236, 106, 158, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  color: #c25584;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(74, 32, 62, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
}

.acg-lightbox__close:hover {
  background: #ffe3ef;
  transform: rotate(90deg);
}

.acg-lightbox__frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  max-height: 66vh;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7eef4, #f2ecff);
}

.acg-lightbox__frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      100deg,
      transparent 20%,
      rgba(255, 255, 255, 0.7) 44%,
      transparent 64%
    )
    0 0 / 220% 100%;
  animation: acg-shimmer 1.4s linear infinite;
  pointer-events: none;
}

.acg-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.988);
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.acg-lightbox__frame.is-ready .acg-lightbox__img,
.acg-lightbox__frame.is-error .acg-lightbox__img {
  opacity: 1;
  transform: none;
}

.acg-lightbox__spinner {
  position: absolute;
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff9ec7, #c9a7ff, #9bd4ff, transparent 78%);
  animation: acg-halo-spin 1.5s linear infinite;
}

.acg-lightbox__spinner span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fbf3f8;
}

.acg-lightbox__frame.is-loading .acg-lightbox__spinner {
  display: grid;
}

.acg-lightbox__hint {
  position: absolute;
  bottom: 26%;
  margin: 0;
  padding: 0 18px;
  color: #a3728d;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.acg-lightbox__frame.is-error .acg-lightbox__hint {
  bottom: 14px;
  z-index: 2;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #c05c86;
}

.acg-lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  font-size: 0.82rem;
}

.acg-lightbox__tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe4ef, #efe6ff);
  color: #c25584;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.acg-lightbox__source {
  color: #a08ba6;
  letter-spacing: 0.02em;
  text-align: right;
}

.acg-lightbox__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 4px;
}

.acg-lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1px solid rgba(236, 106, 158, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #a04f77 !important;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.acg-lightbox__btn:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 8px 20px rgba(236, 106, 158, 0.22);
}

.acg-lightbox__btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ff9ec7, #b8a4ff);
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(236, 106, 158, 0.3);
}

.acg-lightbox__btn--primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(236, 106, 158, 0.38);
}

.acg-lightbox__btn--ghost {
  margin-left: auto;
  border-color: rgba(160, 139, 166, 0.3);
  color: #8d7a98 !important;
}

.acg-lightbox__btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

[data-theme="dark"] .acg-lightbox__card {
  background: linear-gradient(160deg, rgba(43, 31, 55, 0.98), rgba(35, 25, 48, 0.98));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 164, 202, 0.25) inset;
  color: #f4e9f3;
}

[data-theme="dark"] .acg-lightbox__frame {
  background: linear-gradient(135deg, #241a31, #2c2140);
}

[data-theme="dark"] .acg-lightbox__close {
  background: rgba(58, 43, 74, 0.92);
  color: #ffb6d5;
}

[data-theme="dark"] .acg-lightbox__tag {
  background: linear-gradient(135deg, rgba(255, 158, 199, 0.2), rgba(184, 164, 255, 0.22));
  color: #ffc2dc;
}

[data-theme="dark"] .acg-lightbox__source {
  color: #b6a3c2;
}

[data-theme="dark"] .acg-lightbox__btn {
  border-color: rgba(255, 164, 202, 0.25);
  background: rgba(58, 43, 74, 0.85);
  color: #ffc2dc !important;
}

[data-theme="dark"] .acg-lightbox__btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #e2739f, #9b86e8);
  color: #fff !important;
}

[data-theme="dark"] .acg-lightbox__btn--ghost {
  color: #c6b3d2 !important;
}

[data-theme="dark"] .acg-lightbox__spinner span {
  background: #241a31;
}

[data-theme="dark"] .acg-lightbox__hint {
  color: #c6a9be;
}

[data-theme="dark"] .acg-lightbox__frame.is-error .acg-lightbox__hint {
  background: rgba(43, 31, 55, 0.9);
  color: #ff9ec7;
}

/* ---------- 动效 ---------- */
@keyframes acg-halo-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes acg-halo-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }

  50% {
    opacity: 0.92;
    transform: scale(1.06);
  }
}

@keyframes acg-badge-pop {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12) rotate(8deg);
  }
}

@keyframes acg-shimmer {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

/* ---------- 移动端 & 无障碍 ---------- */
@media screen and (max-width: 768px) {
  .acg-lightbox {
    padding: 14px;
  }

  .acg-lightbox__card {
    gap: 12px;
    padding: 12px 12px 14px;
    border-radius: 20px;
  }

  .acg-lightbox__frame {
    min-height: 200px;
    max-height: 58vh;
  }

  .acg-lightbox__img {
    max-height: 58vh;
  }

  .acg-lightbox__btn {
    flex: 1 1 auto;
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  .acg-lightbox__btn--ghost {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acg-avatar::before,
  .acg-avatar::after,
  .acg-avatar__badge,
  .acg-lightbox__spinner,
  .acg-lightbox__frame.is-loading::after {
    animation: none !important;
  }
}
