/*
Theme Name: XiaoGuo Docs
Theme URI: https://itxiaoguo.com/
Author: Codex
Author URI: https://itxiaoguo.com/
Description: A lightweight VitePress-inspired WordPress theme for XiaoGuo's blog.
Version: 1.0.4
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xiaoguo-docs
*/

:root {
  color-scheme: dark;
  --xg-bg: #161618;
  --xg-bg-soft: #1d1e23;
  --xg-bg-mute: #24252c;
  --xg-text: #f1f1f4;
  --xg-text-soft: #c9cad3;
  --xg-text-mute: #8f929f;
  --xg-border: rgba(82, 82, 89, 0.5);
  --xg-border-soft: rgba(255, 255, 255, 0.08);
  --xg-brand: #a8b1ff;
  --xg-brand-strong: #646cff;
  --xg-cyan: #41d1ff;
  --xg-green: #42d392;
  --xg-pink: #ff8bd1;
  --xg-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --xg-nav: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(100, 108, 255, 0.18), transparent 31rem),
    radial-gradient(circle at 17% 66%, rgba(65, 209, 255, 0.12), transparent 25rem),
    radial-gradient(circle at 84% 68%, rgba(66, 211, 146, 0.1), transparent 24rem),
    var(--xg-bg);
  color: var(--xg-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 42vh;
  background: linear-gradient(to bottom, transparent, rgba(22, 22, 24, 0.98));
  pointer-events: none;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.xg-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--xg-nav);
  padding: 0 clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--xg-border-soft);
  background: rgba(22, 22, 24, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
}

.xg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--xg-text);
  font-size: 16px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.xg-brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--xg-brand-strong), var(--xg-green));
  color: white;
  font-size: 14px;
  box-shadow: 0 0 28px rgba(100, 108, 255, 0.52);
}

.xg-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--xg-nav);
}

.xg-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.xg-menu li {
  margin: 0;
}

.xg-nav a,
.xg-menu a {
  display: inline-flex;
  align-items: center;
  min-height: var(--xg-nav);
  border-bottom: 1px solid transparent;
  padding: 0 14px;
  color: var(--xg-text-soft);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.xg-nav a:hover,
.xg-menu a:hover,
.xg-nav .current-menu-item > a {
  border-bottom-color: var(--xg-brand);
  color: var(--xg-brand);
}

.xg-search-link {
  color: var(--xg-text-soft);
  text-decoration: none;
}

.xg-main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.xg-hero {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: calc(100vh - var(--xg-nav));
  padding: clamp(54px, 8vh, 86px) 0 42px;
  text-align: center;
}

.xg-hero::before,
.xg-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(62px);
  opacity: 0.52;
  pointer-events: none;
}

.xg-hero::before {
  width: 350px;
  height: 350px;
  top: 18%;
  left: 16%;
  background: rgba(100, 108, 255, 0.34);
}

.xg-hero::after {
  right: 15%;
  bottom: 22%;
  width: 300px;
  height: 300px;
  background: rgba(66, 211, 146, 0.25);
}

.xg-eyebrow {
  margin: 0 0 16px;
  color: var(--xg-green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.xg-hero h1 {
  margin: 0;
  color: var(--xg-text);
  font-size: clamp(54px, 9vw, 94px);
  font-weight: 920;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 0 48px rgba(168, 177, 255, 0.2);
}

.xg-hero h1 span {
  display: block;
  margin-top: 8px;
  background: linear-gradient(120deg, var(--xg-brand) 10%, var(--xg-pink) 48%, var(--xg-cyan) 92%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.xg-hero-copy {
  position: relative;
  width: min(760px, 100%);
  margin: 26px auto 0;
  color: #e7f9ff;
  font-size: clamp(17px, 2vw, 22px);
  text-shadow:
    0 0 10px rgba(125, 225, 255, 0.5),
    0 0 24px rgba(65, 209, 255, 0.34),
    0 0 46px rgba(58, 166, 255, 0.22);
  isolation: isolate;
}

.xg-hero-copy::after {
  content: "";
  position: absolute;
  inset: -14px -42px -16px;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center, rgba(199, 246, 255, 0.24), rgba(91, 213, 255, 0.13) 42%, transparent 72%);
  filter: blur(14px);
  opacity: 0.9;
  animation: xg-aura 3.6s ease-in-out infinite;
}

.xg-hero-copy::before {
  content: "";
  position: absolute;
  inset: -7px 4%;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(122, 229, 255, 0.2), transparent 70%);
  filter: blur(8px);
  opacity: 0.65;
}

.xg-section {
  padding: 40px 0 88px;
}

.xg-home-directory {
  width: min(920px, 100%);
  margin: clamp(28px, 5vh, 44px) auto 0;
}

.xg-home-directory h2 {
  margin: 0 0 16px;
  color: var(--xg-text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.xg-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--xg-border-soft);
  padding-bottom: 16px;
}

.xg-section-title,
.xg-page-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: 0;
}

.xg-section-desc {
  margin: 8px 0 0;
  color: var(--xg-text-mute);
}

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

.xg-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.xg-card {
  display: grid;
  gap: 12px;
  min-height: 184px;
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  background: rgba(29, 30, 35, 0.72);
  color: var(--xg-text);
  padding: 24px;
  text-decoration: none;
  box-shadow: var(--xg-shadow);
  backdrop-filter: blur(14px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.xg-grid-compact .xg-card {
  min-height: 96px;
  gap: 8px;
  padding: 20px;
  text-align: left;
}

.xg-grid-compact .xg-card h3 {
  font-size: 18px;
}

.xg-grid-compact .xg-card p {
  font-size: 13px;
}

.xg-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 220, 255, 0.48);
  box-shadow: 0 30px 96px rgba(0, 0, 0, 0.42), 0 0 44px rgba(65, 209, 255, 0.12);
}

.xg-card h2,
.xg-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.xg-card p,
.xg-meta {
  margin: 0;
  color: var(--xg-text-mute);
  font-size: 14px;
}

.xg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 42px;
  padding: 54px 0 90px;
}

.xg-content {
  min-width: 0;
}

.xg-post-list {
  display: grid;
  gap: 14px;
}

.xg-post-card {
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  background: rgba(29, 30, 35, 0.72);
  padding: 24px;
  box-shadow: var(--xg-shadow);
}

.xg-post-card h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

.xg-post-card h2 a {
  color: var(--xg-text);
  text-decoration: none;
}

.xg-post-card h2 a:hover {
  color: var(--xg-brand);
}

.xg-post-card p {
  color: var(--xg-text-soft);
}

.xg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}

.xg-article {
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  background: rgba(29, 30, 35, 0.72);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--xg-shadow);
}

.xg-article h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
}

.xg-entry {
  color: var(--xg-text-soft);
  font-size: 17px;
}

.xg-entry h2,
.xg-entry h3,
.xg-entry h4 {
  color: var(--xg-text);
  line-height: 1.35;
  scroll-margin-top: 90px;
}

.xg-entry a {
  color: var(--xg-brand);
}

.xg-entry code {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--xg-cyan);
  font-family: "Cascadia Code", Consolas, monospace;
  padding: 0.12em 0.35em;
}

.xg-entry pre {
  overflow: auto;
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  background: #101116;
  padding: 18px;
}

.xg-entry pre code {
  background: transparent;
  color: #f6f6f7;
  padding: 0;
}

.xg-entry blockquote {
  margin-left: 0;
  border-left: 3px solid var(--xg-brand);
  background: rgba(100, 108, 255, 0.08);
  color: var(--xg-text);
  padding: 10px 18px;
}

.xg-entry table {
  width: 100%;
  border-collapse: collapse;
}

.xg-entry th,
.xg-entry td {
  border: 1px solid var(--xg-border-soft);
  padding: 10px 12px;
}

.xg-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 18px;
}

.xg-widget {
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  background: rgba(29, 30, 35, 0.64);
  padding: 18px;
}

.xg-widget h2,
.xg-widget h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.xg-widget ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--xg-text-soft);
}

.xg-widget a {
  color: var(--xg-text-soft);
  text-decoration: none;
}

.xg-widget a:hover {
  color: var(--xg-brand);
}

.xg-search-form {
  display: flex;
  gap: 8px;
}

.xg-search-form input[type="search"] {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--xg-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--xg-text);
  font: inherit;
  padding: 10px 12px;
}

.xg-search-form button {
  border: 1px solid var(--xg-brand);
  border-radius: 8px;
  background: rgba(100, 108, 255, 0.18);
  color: var(--xg-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 14px;
}

.xg-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.xg-pagination .page-numbers {
  border: 1px solid var(--xg-border-soft);
  border-radius: 8px;
  color: var(--xg-text-soft);
  padding: 7px 12px;
  text-decoration: none;
}

.xg-pagination .current,
.xg-pagination a:hover {
  border-color: var(--xg-brand);
  color: var(--xg-brand);
}

.xg-footer {
  border-top: 1px solid var(--xg-border-soft);
  color: var(--xg-text-mute);
  padding: 28px clamp(18px, 5vw, 64px);
  text-align: center;
}

@keyframes xg-aura {
  0%, 100% { opacity: 0.62; transform: scaleX(0.96); }
  50% { opacity: 1; transform: scaleX(1.04); }
}

@media (max-width: 960px) {
  .xg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .xg-layout {
    grid-template-columns: 1fr;
  }

  .xg-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .xg-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
    padding: 14px 18px;
  }

  .xg-nav,
  .xg-nav a,
  .xg-menu a {
    min-height: 42px;
  }

  .xg-nav {
    flex-wrap: wrap;
  }

  .xg-main {
    width: min(100% - 28px, 1120px);
  }

  .xg-hero {
    min-height: calc(100vh - 120px);
    padding-top: 42px;
  }

  .xg-hero h1 {
    font-size: clamp(46px, 15vw, 66px);
  }

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

  .xg-grid-compact {
    grid-template-columns: 1fr;
  }

  .xg-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

}
