/* 数字花园 · 与主页一致的极深背景 + 紫色点缀，阅读区略抬亮度 */

:root {
  color-scheme: dark;
  --g-bg: #050508;
  --g-surface: #0a0a0a;
  --g-read: #111113;
  --g-border: rgba(255, 255, 255, 0.09);
  --g-muted: #a1a1aa;
  --g-text: rgba(255, 255, 255, 0.82);
  --g-heading: #fafafa;
  --g-accent: #6d28d9;
  --g-accent-soft: rgba(109, 40, 217, 0.35);
  --g-radius: 14px;
  --g-max-read: 680px;
  --g-nav-h: 56px;
  --g-safe-top: env(safe-area-inset-top, 0px);
  --g-stack-h: calc(var(--g-nav-h) + var(--g-safe-top));
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Inter",
    "SF Pro Text",
    "PingFang SC",
    "Microsoft YaHei",
    ui-sans-serif,
    system-ui,
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--g-stack-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--g-bg);
  color: var(--g-text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 笔记详情页：视口顶部阅读进度 */
.g-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}

.g-read-progress__bar {
  height: 100%;
  width: 0%;
  background: #6d28d9;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 极轻噪点 + 紫晕 */
.garden-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(109, 40, 217, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 30%, rgba(167, 139, 250, 0.06), transparent 50%),
    var(--g-bg);
}

.g-page {
  position: relative;
  z-index: 1;
}

/* —— 顶栏 —— */
.g-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--g-stack-h);
  padding: var(--g-safe-top) max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  background: rgba(5, 5, 8, 0.88);
  border-bottom: 1px solid var(--g-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.g-nav__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--g-nav-h);
}

.g-nav__brand {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--g-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.g-nav__brand span {
  color: var(--g-muted);
  font-weight: 500;
}

.g-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.g-nav__links a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--g-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.g-nav__links a:hover,
.g-nav__links a[aria-current="page"] {
  color: var(--g-heading);
}

.g-nav__toggle {
  display: none;
}

.g-mobile-drawer {
  display: none;
}

.g-mobile-drawer__overlay {
  display: none;
}

@media (max-width: 720px) {
  .g-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .g-nav__links {
    display: none;
  }

  .g-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid var(--g-border);
    border-radius: 8px;
    color: var(--g-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease;
  }

  .g-nav__toggle:hover,
  .g-nav__toggle:active {
    border-color: rgba(167, 139, 250, 0.4);
  }

  .g-nav__toggle svg {
    width: 18px;
    height: 18px;
  }

  .g-mobile-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: min(260px, 75vw);
    height: 100dvh;
    z-index: 200;
    background: rgba(8, 8, 12, 0.97);
    border-left: 1px solid var(--g-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: calc(var(--g-stack-h) + 1rem) 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  }

  .g-mobile-drawer.is-open {
    transform: translateX(0);
  }

  .g-mobile-drawer__overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .g-mobile-drawer__overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .g-mobile-drawer a {
    display: block;
    padding: 0.75rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--g-text);
    text-decoration: none;
    border-bottom: 1px solid var(--g-border);
    transition: color 0.15s ease;
  }

  .g-mobile-drawer a:hover,
  .g-mobile-drawer a[aria-current="page"] {
    color: var(--g-heading);
  }
}

/* —— 花园搜索（Fuse.js 全文检索） —— */
.g-search-wrap {
  position: relative;
  z-index: 60;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0.25rem;
}

.g-search {
  position: relative;
  max-width: 28rem;
  margin: 0 auto;
}

.g-search__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--g-heading);
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.g-search__input::placeholder {
  color: rgba(161, 161, 170, 0.75);
}

.g-search__input:hover {
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.g-search__input:focus {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(109, 40, 217, 0.12);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.18);
}

.g-search__results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: min(360px, 56vh);
  overflow-y: auto;
  background: rgba(12, 12, 16, 0.97);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--g-radius);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(109, 40, 217, 0.1) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.g-search__hit-link {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--g-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}

.g-search__hit:last-child .g-search__hit-link {
  border-bottom: none;
}

.g-search__hit-link:hover,
.g-search__hit-link:focus-visible {
  background: rgba(109, 40, 217, 0.22);
  outline: none;
}

.g-search__hit-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--g-heading);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.g-search__hit-meta {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--g-muted);
  letter-spacing: 0.02em;
}

.g-search__empty {
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  color: var(--g-muted);
  text-align: center;
}

/* —— 花园主页 —— */
.g-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
}

.g-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--g-heading);
  margin: 0 0 0.5rem;
  background: linear-gradient(118deg, #ecfdf5 0%, #67e8f9 40%, #a78bfa 72%, #e9d5ff 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: garden-title-aurora 14s ease-in-out infinite;
}

@keyframes garden-title-aurora {
  0%,
  100% {
    background-position: 12% 40%;
  }
  33% {
    background-position: 88% 30%;
  }
  66% {
    background-position: 40% 70%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-hero__title {
    animation: none;
    background: linear-gradient(90deg, #e8d5a3, #7ec4c4, #93c5fd);
    background-size: 100% auto;
  }
}

.g-hero__lead {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.9375rem;
  color: var(--g-muted);
  line-height: 1.65;
}

/* 图谱 */
.g-graph-wrap {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}

.g-graph-panel {
  position: relative;
  border-radius: var(--g-radius);
  border: 1px solid var(--g-border);
  background: rgba(17, 17, 19, 0.65);
  overflow: hidden;
  min-height: 280px;
  box-shadow: 0 0 0 1px rgba(109, 40, 217, 0.06) inset;
}

.g-graph-panel svg {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 380px);
  cursor: grab;
}

.g-graph-panel svg:active {
  cursor: grabbing;
}

/* 分类 / 状态过滤 */
.g-filters-bar {
  max-width: 1100px;
  margin: 0 auto 1.25rem;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  justify-content: center;
  align-items: center;
}

.g-filters-bar .g-filters--row {
  margin: 0;
  padding: 0;
  max-width: none;
}

.g-filters {
  max-width: 1100px;
  margin: 0 auto 1.25rem;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.g-filter-btn {
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--g-muted);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.g-filter-btn:hover {
  color: var(--g-heading);
  border-color: rgba(167, 139, 250, 0.35);
}

.g-filter-btn--stage {
  text-transform: none;
  letter-spacing: 0.03em;
}

.g-filter-btn.is-active {
  background: rgba(109, 40, 217, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
  color: #f5f3ff;
}

/* 笔记卡片网格 */
.g-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.g-grid-empty {
  max-width: 1100px;
  margin: -2rem auto 3rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  color: var(--g-muted);
  text-align: center;
}

.g-grid-empty[hidden] {
  display: none !important;
}

.g-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem;
  border-radius: var(--g-radius);
  border: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  opacity: 1;
}

.g-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* 筛选不匹配：不占位，剩余卡片从顶部自动重排 */
.g-card[hidden] {
  display: none;
}

.g-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.85);
}

.g-card__stage {
  font-size: 1rem;
  line-height: 1;
}

.g-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--g-heading);
  letter-spacing: -0.02em;
}

.g-card__sum {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--g-muted);
  line-height: 1.55;
  flex: 1;
}

.g-card__time {
  margin-top: 0.75rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.38);
}

/* —— 笔记详情 —— */
.g-note-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .g-note-layout {
    grid-template-columns: 1fr;
  }
}

.g-breadcrumb {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--g-muted);
  margin-bottom: 0.25rem;
}

.g-breadcrumb a {
  color: rgba(196, 181, 253, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}

.g-breadcrumb a:hover {
  border-bottom-color: rgba(167, 139, 250, 0.75);
}

.g-read {
  max-width: var(--g-max-read);
  padding: 1.75rem 1.5rem;
  border-radius: var(--g-radius);
  border: 1px solid var(--g-border);
  background: var(--g-read);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.g-read h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--g-heading);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.g-read h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--g-heading);
}

.g-read h3 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(250, 250, 250, 0.92);
}

.g-read p {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(235, 235, 242, 0.9);
}

.g-read ul,
.g-read ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: rgba(235, 235, 242, 0.88);
}

.g-read li {
  margin-bottom: 0.35rem;
}

.g-read strong {
  color: #fff;
  font-weight: 600;
}

.g-read code {
  font-size: 0.88em;
  padding: 0.12em 0.38em;
  border-radius: 6px;
  background: rgba(109, 40, 217, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.g-read pre {
  padding: 1rem;
  border-radius: 10px;
  overflow-x: auto;
  background: #0a0a0c;
  border: 1px solid var(--g-border);
  font-size: 0.82rem;
  line-height: 1.55;
}

.g-read pre code {
  border: none;
  background: none;
  padding: 0;
}

/* 正文表格（方法论对照表、三重门矩阵等） */
.g-read table {
  width: 100%;
  margin: 1.15rem 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  border: 1px solid var(--g-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.32);
  box-shadow:
    0 0 0 1px rgba(109, 40, 217, 0.09),
    0 10px 32px rgba(0, 0, 0, 0.28);
}

.g-read thead th {
  text-align: left;
  padding: 0.65rem 0.95rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.95);
  background: linear-gradient(180deg, rgba(109, 40, 217, 0.28) 0%, rgba(109, 40, 217, 0.14) 100%);
  border-bottom: 1px solid rgba(167, 139, 250, 0.28);
}

.g-read tbody td {
  padding: 0.75rem 0.95rem;
  vertical-align: top;
  color: rgba(235, 235, 242, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.g-read tbody tr:last-child td {
  border-bottom: none;
}

.g-read tbody tr {
  transition: background 0.18s ease;
}

.g-read tbody tr:hover {
  background: rgba(109, 40, 217, 0.08);
}

/* 首列：层次 / 对象等「键」——琥珀色标点，与正文紫系区分 */
.g-read tbody td:first-child {
  font-weight: 600;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

.g-read tbody td:first-child strong {
  color: inherit;
}

/* 长文案行：避免首列被错误 nowrap（如含加粗对象名仍可能较短） */
@media (max-width: 520px) {
  .g-read tbody td:first-child {
    white-space: normal;
  }

  .g-read table {
    font-size: 0.8125rem;
  }

  .g-read tbody td,
  .g-read thead th {
    padding: 0.55rem 0.65rem;
  }
}

.g-read a:not(.wiki-link) {
  color: rgba(196, 181, 253, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 139, 250, 0.4);
  transition: border-color 0.2s ease;
}

.g-read a:not(.wiki-link):hover {
  border-bottom-color: rgba(221, 214, 254, 0.95);
}

/* 双向链接 */
.wiki-link {
  color: rgba(196, 181, 253, 0.98) !important;
  text-decoration: none !important;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.55) !important;
  transition:
    background 0.2s ease,
    border-bottom-style 0.2s ease !important;
}

.wiki-link:hover {
  background: rgba(109, 40, 217, 0.12);
  border-bottom-style: solid !important;
}

.wiki-link--missing {
  color: rgba(248, 113, 113, 0.85) !important;
  border-bottom-color: rgba(248, 113, 113, 0.45) !important;
  cursor: help;
}

/* 侧栏（Andy 式「相关笔记」） */
.g-aside {
  position: sticky;
  top: calc(var(--g-stack-h) + 12px);
  padding: 1.25rem;
  border-radius: var(--g-radius);
  border: 1px solid var(--g-border);
  background: rgba(17, 17, 19, 0.85);
  font-size: 0.8125rem;
}

.g-aside h2 {
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.88);
}

.g-aside ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-aside li {
  margin-bottom: 0.55rem;
}

.g-aside a {
  color: var(--g-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: inline;
}

.g-aside a:hover {
  color: #fff;
  border-bottom-color: rgba(167, 139, 250, 0.5);
}

.g-aside__section + .g-aside__section {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--g-border);
}

/* 反向链接区 */
.g-backlinks {
  max-width: var(--g-max-read);
  margin-top: 2rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--g-radius);
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(109, 40, 217, 0.06);
}

.g-backlinks h2 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(221, 214, 254, 0.9);
}

.g-backlinks ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-backlinks li {
  margin-bottom: 0.45rem;
}

.g-backlinks a {
  color: rgba(196, 181, 253, 0.98);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}

.g-backlinks a:hover {
  border-bottom-color: rgba(221, 214, 254, 0.9);
}

/* MOC 大卡 */
.moc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.moc-card {
  display: block;
  padding: 1.15rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.moc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.12);
}

.moc-card__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--g-heading);
}

.moc-card__excerpt {
  margin: 0;
  font-size: 0.8rem;
  color: var(--g-muted);
  line-height: 1.5;
}

.g-footer {
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.38);
  border-top: 1px solid var(--g-border);
}

.g-footer a {
  color: rgba(196, 181, 253, 0.85);
  text-decoration: none;
}

/* —— 正文中 [[链接]] 双击预览卡片 —— */
.wiki-preview-popover {
  position: fixed;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.wiki-preview-popover.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wiki-preview-popover[hidden] {
  display: none !important;
}

.wiki-preview-popover__inner {
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(14, 14, 18, 0.98) 0%, rgba(8, 8, 11, 0.99) 100%);
  border: 1px solid rgba(167, 139, 250, 0.42);
  box-shadow:
    0 0 0 1px rgba(109, 40, 217, 0.15) inset,
    0 20px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(109, 40, 217, 0.08);
}

.wiki-preview-popover__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.9);
}

.wiki-preview-popover__emoji {
  font-size: 1rem;
  line-height: 1;
}

.wiki-preview-popover__title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--g-heading);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.wiki-preview-popover__sum {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.58;
  color: rgba(212, 212, 220, 0.88);
}

.wiki-preview-popover__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f5f3ff;
  text-decoration: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.92), rgba(76, 29, 149, 0.88));
  border: 1px solid rgba(196, 181, 253, 0.35);
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.22);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.wiki-preview-popover__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(109, 40, 217, 0.32);
}

.g-read a.wiki-link {
  cursor: pointer;
}
