/* ============================================
   Philomathesophy · Wiki 星系（宇宙极简）
   ============================================ */

:root {
  --bg: #05060f;
  --text-1: #f4f6fb;
  --text-2: rgba(244, 246, 251, 0.62);
  --text-3: rgba(244, 246, 251, 0.4);
  --accent: #d8b4fe;
  --accent-blue: #a8c0ff;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.14);
  --divider: rgba(255, 255, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Inter", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------- 顶部导航 ---------------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  pointer-events: none;
}

.top-nav .brand {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--text-1);
  opacity: 0.9;
  pointer-events: auto;
  transition: color 0.3s ease;
}

.top-nav .brand:hover {
  color: var(--accent);
}

.top-nav .nav-link {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text-2);
  pointer-events: auto;
  transition: color 0.3s ease;
}

.top-nav .nav-link:hover {
  color: var(--accent);
}

/* ---------------- 星系图主页 ---------------- */
#galaxy {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-3);
  pointer-events: none;
}

/* 信息浮层 */
.info {
  position: fixed;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  padding: 24px 26px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 40;
}

.info-title {
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.5;
  margin-bottom: 10px;
}

.info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.meta-chip {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.meta-chip.study {
  color: var(--accent);
  border-color: rgba(216, 180, 254, 0.4);
}

.meta-chip.work {
  color: var(--accent-blue);
  border-color: rgba(168, 192, 255, 0.4);
}

.info-desc {
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 14px;
}

.info-link {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  transition: opacity 0.3s ease;
}

.info-link:hover {
  opacity: 0.75;
}

/* ---------------- 文章页 ---------------- */
.article-body {
  background-attachment: fixed; /* 背景相对视口固定：星空固定在屏幕上，滚动内容时背景不动 */
  background:
    /* 银河带（斜 15°，蓝白微光，像地球上仰望的银河） */
    linear-gradient(15deg, transparent 39%, rgba(150, 175, 225, 0.05) 45%, rgba(225, 235, 255, 0.10) 50%, rgba(150, 175, 225, 0.05) 55%, transparent 61%),
    /* 蓝色星际尘埃（银河带周围扩散的蓝晕） */
    radial-gradient(ellipse 55% 30% at 50% 42%, rgba(100, 130, 200, 0.07), transparent 70%),
    radial-gradient(ellipse 35% 22% at 28% 36%, rgba(90, 120, 190, 0.06), transparent 70%),
    radial-gradient(ellipse 35% 22% at 72% 48%, rgba(90, 120, 190, 0.06), transparent 70%),
    /* 银河带内密集微星（沿带分布） */
    radial-gradient(1px 1px at 8% 38%, rgba(255, 255, 255, 0.55), transparent 100%),
    radial-gradient(1.5px 1.5px at 16% 36%, rgba(220, 230, 255, 0.6), transparent 100%),
    radial-gradient(1px 1px at 24% 40%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 32% 34%, rgba(210, 225, 255, 0.55), transparent 100%),
    radial-gradient(1px 1px at 40% 42%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1px 1px at 48% 37%, rgba(230, 240, 255, 0.6), transparent 100%),
    radial-gradient(1.5px 1.5px at 56% 44%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1px 1px at 64% 38%, rgba(220, 230, 255, 0.55), transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 42%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1px 1px at 80% 36%, rgba(225, 235, 255, 0.6), transparent 100%),
    radial-gradient(1px 1px at 88% 44%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 94% 38%, rgba(210, 225, 255, 0.55), transparent 100%),
    /* 带外散落的亮星 */
    radial-gradient(1.5px 1.5px at 18% 12%, rgba(255, 255, 255, 0.6), transparent 100%),
    radial-gradient(1px 1px at 55% 8%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 15%, rgba(216, 180, 254, 0.55), transparent 100%),
    radial-gradient(1px 1px at 35% 65%, rgba(255, 255, 255, 0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 65% 75%, rgba(216, 180, 254, 0.5), transparent 100%),
    radial-gradient(1px 1px at 90% 70%, rgba(255, 255, 255, 0.45), transparent 100%),
    /* 顶部淡紫氛围光晕 */
    radial-gradient(ellipse 80% 45% at 50% -8%, rgba(216, 180, 254, 0.06), transparent 70%),
    var(--bg);
}

.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 110px 28px 60px;
}

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

.article-meta .meta-chip.tag {
  color: var(--text-3);
}

.article-meta .meta-date {
  margin-left: auto;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-3);
  align-self: center;
}

.article-content {
  overflow-wrap: break-word; /* 长文本/长字符串自动断行，避免溢出 */
  word-break: break-word;
  line-height: 1.9;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.article-content h1 {
  font-size: 2rem;
  font-weight: 200;
  letter-spacing: 0.06em;
  line-height: 1.4;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}

.article-content h2 {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin: 36px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 24px 0 10px;
}

.article-content p {
  margin: 12px 0;
  color: var(--text-2);
}

.article-content strong {
  color: var(--text-1);
  font-weight: 500;
}

.article-content a {
  color: var(--accent);
  border-bottom: 1px solid rgba(216, 180, 254, 0.35);
  transition: border-color 0.3s ease;
}

.article-content a:hover {
  border-bottom-color: var(--accent);
}

.article-content ul,
.article-content ol {
  margin: 12px 0;
  padding-left: 1.4em;
  color: var(--text-2);
}

.article-content li {
  margin: 6px 0;
}

.article-content blockquote {
  margin: 16px 0;
  padding: 6px 18px;
  border-left: 1px solid var(--accent);
  color: var(--text-2);
  background: rgba(216, 180, 254, 0.05);
}

.article-content code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: rgba(216, 180, 254, 0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
  word-break: break-all; /* inline code 长串断行 */
}

.article-content pre {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: rgba(255, 255, 255, 0.04);
  overflow-x: auto;
}

.article-content pre code {
  background: none;
  color: var(--text-1);
  padding: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}

.article-content th,
.article-content td {
  border: 1px solid var(--divider);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-2);
}

.article-content th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-weight: 400;
}

.article-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 14px 0;
}

/* 相关/反链 */
.article-rel {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
}

.rel {
  margin-bottom: 22px;
}

.rel h2 {
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.rel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  font-size: 0.9rem;
  color: var(--text-1);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.rel-chip:hover {
  border-color: rgba(216, 180, 254, 0.5);
  color: var(--accent);
  transform: translateY(-1px);
}

.rel-tag {
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 1px 7px;
}

/* 页脚 */
.foot {
  text-align: center;
  padding: 30px 0 40px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.26em;
  color: var(--text-3);
}

/* ---------- 文章星星浮层 ---------- */
.galaxy-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  min-width: 190px;
  max-width: 260px;
  padding: 14px 18px;
  background: rgba(10, 12, 24, 0.62);
  border: 1px solid rgba(216, 180, 254, 0.28);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: opacity 0.18s ease;
}
.galaxy-tip__title {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #eef0f8;
  margin-bottom: 4px;
}
.galaxy-tip__sub {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(216, 180, 254, 0.82);
  line-height: 1.5;
}
.galaxy-tip__hint {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(238, 240, 248, 0.4);
}

/* ---------- 侧边栏目录 ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  padding: 88px 22px 28px 26px;
  background: rgba(8, 10, 20, 0.26);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 20;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 180, 254, 0.25) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(216, 180, 254, 0.25); border-radius: 2px; }
.sidebar__head {
  font-size: 11px;
  letter-spacing: 0.5em;
  color: rgba(238, 240, 248, 0.45);
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__group { margin-bottom: 22px; }
.sidebar__group-name {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(216, 180, 254, 0.7);
  margin-bottom: 8px;
}
.sidebar__item {
  position: relative;
  display: block;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: rgba(238, 240, 248, 0.78);
  padding: 6px 14px;
  margin-bottom: 2px;
  border-radius: 10px;
  background-color: transparent;
  /* 光带：与主页 glass-btn 相同的扫过效果 */
  background-image: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.14) 48%,
    rgba(255, 255, 255, 0.26) 50%,
    rgba(255, 255, 255, 0.14) 52%,
    transparent 60%
  );
  background-size: 220% 100%;
  background-position: 180% 0;
  background-repeat: no-repeat;
  border: 1px solid transparent;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    background-position 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  text-decoration: none;
}
.sidebar__item:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.12);
  background-position: -80% 0;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(180, 150, 255, 0.14);
  color: #eef0f8;
}

/* ---------- 文章目录栏 ---------- */
.toc {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 250px;
  max-height: 66vh;
  overflow-y: auto;
  padding: 22px 18px;
  background: rgba(8, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 180, 254, 0.25) transparent;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: rgba(216, 180, 254, 0.25); border-radius: 2px; }
.toc__head {
  font-size: 11px;
  letter-spacing: 0.45em;
  color: rgba(238, 240, 248, 0.5);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.toc__item {
  display: block;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(238, 240, 248, 0.75);
  text-decoration: none;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.toc__item:hover {
  color: #eef0f8;
  border-left-color: rgba(216, 180, 254, 0.7);
  background: linear-gradient(90deg, rgba(216, 180, 254, 0.1), transparent);
}
.toc__lv3 {
  padding-left: 26px;
  font-size: 12px;
  color: rgba(238, 240, 248, 0.55);
}
/* 滚动锚点不被顶部导航遮挡 */
.article-content h2,
.article-content h3 {
  scroll-margin-top: 88px;
}
/* 窄屏隐藏目录 */
@media (max-width: 1100px) {
  .toc { display: none; }
}

/* ---------- 亮星呼吸闪烁 ---------- */
.twinkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.twinkle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.35);
  animation: twinkle 4.2s ease-in-out infinite;
}
.twinkle--purple {
  background: rgba(216, 180, 254, 0.9);
  box-shadow: 0 0 8px 1px rgba(216, 180, 254, 0.35);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ---------- 自定义光标（与主页/博客统一） ---------- */
html,
body,
body * {
  cursor: none !important; /* 全局隐藏系统光标（点击/拖拽/滚动条均不出现） */
}
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  pointer-events: none;
  z-index: 9999;
}
.cursor-ring__inner {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.12);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.cursor-ring--active .cursor-ring__inner {
  transform: scale(1.45);
  border-color: rgba(216, 180, 254, 0.9);
  box-shadow: 0 0 12px rgba(216, 180, 254, 0.45);
}
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 9999;
}
/* 触摸设备：恢复系统光标 */
@media (hover: none), (pointer: coarse) {
  body,
  body * {
    cursor: auto !important;
  }
  .cursor-ring,
  .cursor-dot {
    display: none;
  }
}

/* ---------- 隐藏滚动条（保留滚动）——避免拖动滚动条时出现系统光标、自定义光标停住 ---------- */
html,
body,
.sidebar,
.toc,
.article-content pre {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge 旧版 */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.toc::-webkit-scrollbar,
.article-content pre::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ---------- 首页标题区（ASTROLABE） ---------- */
.home-hero {
  position: fixed;
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 15;
}
.home-eyebrow {
  font-size: 11px;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: rgba(238, 240, 248, 0.55);
  margin-bottom: 18px;
}
.home-title {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  margin: 0 0 16px;
  background: linear-gradient(180deg, #ffffff 20%, #d9c8ff 78%, #8f7bd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.home-subtitle {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: rgba(238, 240, 248, 0.4);
}
