/* ============================================================
   NexAI - 现代 AI 风格 Emlog 主题
   Design System: 深色优先 / 玻璃拟态 / 紫青渐变 / 零依赖
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --nx-accent: #7c5cff;
  --nx-accent-2: #22d3ee;
  --nx-gradient: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --nx-radius: 16px;
  --nx-radius-sm: 10px;
  --nx-radius-lg: 24px;
  --nx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --nx-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --nx-shadow: 0 8px 32px rgba(2, 6, 23, 0.45);
  --nx-glow: 0 0 0 1px rgba(124, 92, 255, 0.35), 0 8px 40px rgba(124, 92, 255, 0.25);
  --nx-max: 1300px;
  --nx-header-h: 64px;
}

/* 深色（默认） */
html[data-theme="dark"] {
  --nx-bg: #070b16;
  --nx-bg-soft: #0b1120;
  --nx-card: rgba(148, 163, 255, 0.055);
  --nx-card-hover: rgba(148, 163, 255, 0.1);
  --nx-border: rgba(148, 163, 255, 0.14);
  --nx-border-strong: rgba(148, 163, 255, 0.26);
  --nx-text: #e8ecf8;
  --nx-muted: #94a0bd;
  --nx-faint: #5d6884;
  --nx-code-bg: rgba(3, 7, 18, 0.75);
  --nx-mask: rgba(4, 8, 20, 0.72);
  color-scheme: dark;
}

/* 浅色 */
html[data-theme="light"] {
  --nx-bg: #f5f7fc;
  --nx-bg-soft: #eef1fa;
  --nx-card: rgba(255, 255, 255, 0.78);
  --nx-card-hover: rgba(255, 255, 255, 0.95);
  --nx-border: rgba(15, 23, 42, 0.09);
  --nx-border-strong: rgba(15, 23, 42, 0.18);
  --nx-text: #101728;
  --nx-muted: #5b6478;
  --nx-faint: #8a93a8;
  --nx-code-bg: rgba(15, 23, 42, 0.05);
  --nx-mask: rgba(15, 23, 42, 0.45);
  --nx-shadow: 0 8px 28px rgba(30, 41, 82, 0.1);
  color-scheme: light;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nx-header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--nx-font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--nx-text);
  background: var(--nx-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* AI 风格背景：光晕 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(600px 400px at 12% -8%, rgba(124, 92, 255, 0.16), transparent 65%),
    radial-gradient(700px 460px at 90% -14%, rgba(34, 211, 238, 0.12), transparent 65%),
    radial-gradient(800px 600px at 50% 118%, rgba(124, 92, 255, 0.08), transparent 70%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--nx-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--nx-border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}

a { color: var(--nx-accent); text-decoration: none; }
a:hover { color: var(--nx-accent-2); }

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

::selection { background: rgba(124, 92, 255, 0.35); }

:focus-visible {
  outline: 2px solid var(--nx-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.nx-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  background: var(--nx-gradient);
  color: #fff;
  padding: 8px 18px;
  border-radius: 0 0 10px 0;
}
.nx-skip:focus { left: 0; }

.nx-container {
  max-width: var(--nx-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.nx-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--nx-header-h);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: color-mix(in srgb, var(--nx-bg) 72%, transparent);
  border-bottom: 1px solid var(--nx-border);
}

/* 双渲染兜底：页面意外输出两份 header 时只显示第一份（含嵌套在 main 里的重复份） */
body > .nx-header ~ .nx-header,
main#nx-main .nx-header { display: none; }

.nx-header-inner {
  max-width: var(--nx-max);
  margin: 0 auto;
  padding: 8px 20px;
  min-height: calc(var(--nx-header-h) - 8px);
  display: flex;
  align-items: center;
  gap: 18px;
}

.nx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--nx-text);
  letter-spacing: 0.2px;
  flex-shrink: 0;
}
.nx-brand:hover { color: var(--nx-text); }

.nx-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--nx-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--nx-mono);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(124, 92, 255, 0.45);
  position: relative;
  overflow: hidden;
}
.nx-brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: nx-shine 4.5s ease-in-out infinite;
}
@keyframes nx-shine {
  0%, 60% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}

.nx-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.nx-nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nx-nav a {
  color: var(--nx-muted);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13.5px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
/* 菜单项过多时的右侧渐隐提示（JS 检测溢出后加 is-overflowing） */
.nx-nav.is-overflowing:not(.is-at-end)::after {
  content: "";
  position: sticky;
  right: 0;
  flex-shrink: 0;
  width: 34px;
  margin-left: -34px;
  align-self: stretch;
  background: linear-gradient(to left, var(--nx-bg), transparent);
  pointer-events: none;
  z-index: 5;
}
.nx-nav a:hover { color: var(--nx-text); background: var(--nx-card-hover); }
.nx-nav a.is-active {
  color: #fff;
  background: var(--nx-gradient);
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35);
}

.nx-nav-sub {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--nx-bg-soft);
  border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius-sm);
  box-shadow: var(--nx-shadow);
  padding: 6px;
  min-width: 150px;
  display: none;
  z-index: 1200;
}
.nx-nav-item { position: relative; }
.nx-nav-item:hover .nx-nav-sub,
.nx-nav-item:focus-within .nx-nav-sub { display: block; }
.nx-nav-sub a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--nx-muted);
}
.nx-nav-sub a:hover { color: var(--nx-text); background: var(--nx-card-hover); }

.nx-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 中等宽度下收起搜索按钮文字，给菜单腾空间 */
@media (max-width: 1360px) {
  .nx-search-btn .nx-search-label,
  .nx-search-btn kbd { display: none; }
  .nx-search-btn { width: 38px; padding: 0; justify-content: center; }
}

.nx-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  color: var(--nx-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.nx-icon-btn:hover {
  color: var(--nx-text);
  border-color: var(--nx-border-strong);
  transform: translateY(-1px);
}

.nx-search-btn {
  gap: 8px;
  width: auto;
  padding: 0 12px;
  font-size: 13px;
  color: var(--nx-muted);
}
.nx-search-btn kbd {
  font-family: var(--nx-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--nx-border);
  background: var(--nx-code-bg);
  color: var(--nx-faint);
}

.nx-menu-btn { display: none; }

/* ---------- Hero ---------- */
.nx-hero {
  position: relative;
  padding: 72px 0 40px;
  text-align: center;
}

.nx-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--nx-muted);
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}
.nx-hero-badge .nx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nx-accent-2);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
  animation: nx-pulse 2.2s ease-in-out infinite;
}
@keyframes nx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.nx-hero h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.22;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nx-hero h1 .nx-grad {
  background: var(--nx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nx-hero p {
  color: var(--nx-muted);
  font-size: clamp(14px, 2vw, 16.5px);
  max-width: 620px;
  margin: 0 auto 30px;
}

.nx-hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.nx-hero-search input {
  width: 100%;
  padding: 15px 54px 15px 46px;
  border-radius: 999px;
  border: 1px solid var(--nx-border-strong);
  background: var(--nx-card);
  backdrop-filter: blur(12px);
  color: var(--nx-text);
  font-size: 15px;
  font-family: var(--nx-font);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.nx-hero-search input::placeholder { color: var(--nx-faint); }
.nx-hero-search input:focus {
  outline: none;
  border-color: var(--nx-accent);
  box-shadow: var(--nx-glow);
}
.nx-hero-search .nx-search-ico {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nx-faint);
  pointer-events: none;
}
.nx-hero-search button {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--nx-gradient);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nx-hero-search button:hover { transform: translateY(-50%) scale(1.06); }

.nx-hero-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.nx-stat {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius);
  padding: 12px 22px;
  min-width: 118px;
  backdrop-filter: blur(8px);
}
.nx-stat b {
  display: block;
  font-size: 21px;
  font-family: var(--nx-mono);
  background: var(--nx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nx-stat span { font-size: 12px; color: var(--nx-muted); }

/* ---------- 通用区块 ---------- */
.nx-section {
  margin: 34px 0;
}
.nx-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.nx-section-head h2 {
  font-size: 20px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nx-section-head h2::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--nx-gradient);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.6);
}
.nx-section-head .nx-more {
  margin-left: auto;
  font-size: 13px;
  color: var(--nx-muted);
}
.nx-section-head .nx-more:hover { color: var(--nx-accent); }

.nx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
}
.nx-layout > .nx-side { position: sticky; top: calc(var(--nx-header-h) + 20px); }
.nx-layout > .nx-main-col { min-width: 0; }

/* ---------- 文章卡片 ---------- */
.nx-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 18px;
}

.nx-card {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s, background 0.25s;
  display: flex;
  flex-direction: column;
}
.nx-card:hover {
  transform: translateY(-4px);
  border-color: var(--nx-border-strong);
  background: var(--nx-card-hover);
  box-shadow: var(--nx-shadow), 0 0 24px rgba(124, 92, 255, 0.12);
}

.nx-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.14));
  display: block;
}
.nx-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.nx-card:hover .nx-card-cover img { transform: scale(1.05); }
.nx-card-cover.nx-noimg::after {
  content: "xiaofeizyw.xyz";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nx-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(124, 92, 255, 0.55);
}

.nx-card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.nx-card-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nx-card-title a { color: var(--nx-text); }
.nx-card-title a:hover { color: var(--nx-accent); }
.nx-card-excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--nx-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nx-card-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--nx-border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--nx-faint);
  flex-wrap: wrap;
}
.nx-card-meta .nx-sort-chip {
  color: var(--nx-accent-2);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
}
.nx-top-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--nx-gradient);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(124, 92, 255, 0.5);
}

/* ---------- 列表页条 ---------- */
.nx-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--nx-faint);
  margin-bottom: 18px;
}
.nx-breadcrumb a { color: var(--nx-muted); }
.nx-breadcrumb a:hover { color: var(--nx-accent); }

.nx-list-item {
  display: flex;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.nx-list-item:hover {
  transform: translateY(-3px);
  border-color: var(--nx-border-strong);
  box-shadow: var(--nx-shadow);
}
.nx-list-item .nx-card-cover { width: 220px; flex-shrink: 0; aspect-ratio: 16/10; border-radius: var(--nx-radius); align-self: flex-start; }
.nx-list-item .nx-card-body { padding: 2px 0; }

/* ---------- 空状态 ---------- */
.nx-empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--nx-border-strong);
  border-radius: var(--nx-radius-lg);
  color: var(--nx-muted);
}
.nx-empty .nx-empty-ico {
  font-size: 42px;
  margin-bottom: 10px;
  display: block;
  opacity: 0.75;
}
.nx-empty a {
  display: inline-block;
  margin-top: 14px;
}

/* ---------- 按钮 ---------- */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 22px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-family: var(--nx-font);
  cursor: pointer;
  background: var(--nx-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.nx-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124, 92, 255, 0.45); color: #fff; }
.nx-btn--ghost {
  background: transparent;
  border: 1px solid var(--nx-border-strong);
  color: var(--nx-text);
  box-shadow: none;
}
.nx-btn--ghost:hover { border-color: var(--nx-accent); color: var(--nx-accent); box-shadow: none; }

/* ---------- 侧栏 ---------- */
.nx-widget {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  backdrop-filter: blur(10px);
  padding: 18px;
  margin-bottom: 18px;
}
.nx-widget-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nx-widget-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--nx-gradient);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.7);
}

.nx-rank { list-style: none; margin: 0; padding: 0; }
.nx-rank li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--nx-border);
}
.nx-rank li:last-child { border-bottom: none; }
.nx-rank .nx-rank-no {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--nx-mono);
  background: var(--nx-code-bg);
  color: var(--nx-faint);
  margin-top: 2px;
}
.nx-rank li:nth-child(1) .nx-rank-no { background: var(--nx-gradient); color: #fff; }
.nx-rank li:nth-child(2) .nx-rank-no { background: rgba(124, 92, 255, 0.55); color: #fff; }
.nx-rank li:nth-child(3) .nx-rank-no { background: rgba(34, 211, 238, 0.5); color: #fff; }
.nx-rank a {
  color: var(--nx-text);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nx-rank a:hover { color: var(--nx-accent); }

.nx-tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.nx-tag {
  font-size: 12.5px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--nx-border-strong);
  color: var(--nx-muted);
  background: var(--nx-card);
  transition: all 0.2s;
}
.nx-tag:hover {
  color: #fff;
  border-color: transparent;
  background: var(--nx-gradient);
}

/* ---------- 文章页 ---------- */
.nx-article {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  backdrop-filter: blur(12px);
  padding: clamp(20px, 4vw, 40px);
  margin-bottom: 22px;
}

.nx-article-title {
  font-size: clamp(22px, 3.6vw, 32px);
  line-height: 1.35;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}

.nx-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--nx-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--nx-border);
  margin-bottom: 26px;
}
.nx-article-meta .nx-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--nx-gradient) border-box;
  padding: 2px;
}
.nx-article-meta .nx-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }

.nx-entry { font-size: 15.5px; overflow-wrap: break-word; }
.nx-entry p { margin: 0 0 1.15em; }
.nx-entry h2, .nx-entry h3, .nx-entry h4 {
  margin: 1.6em 0 0.7em;
  line-height: 1.4;
  scroll-margin-top: calc(var(--nx-header-h) + 20px);
}
.nx-entry h2 { font-size: 22px; padding-left: 12px; border-left: 4px solid var(--nx-accent); }
.nx-entry h3 { font-size: 18px; }
.nx-entry blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--nx-accent);
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.1), transparent 80%);
  border-radius: 0 12px 12px 0;
  color: var(--nx-muted);
}
.nx-entry blockquote p { margin: 0.3em 0; }
.nx-entry img { border-radius: var(--nx-radius); cursor: zoom-in; }
.nx-entry ul, .nx-entry ol { padding-left: 1.4em; }
.nx-entry li { margin: 0.35em 0; }
.nx-entry hr { border: none; height: 1px; background: var(--nx-border); margin: 2em 0; }
.nx-entry table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.nx-entry th, .nx-entry td {
  border: 1px solid var(--nx-border);
  padding: 8px 12px;
}
.nx-entry th { background: var(--nx-code-bg); }

/* 代码块：AI 终端风 */
.nx-entry pre {
  position: relative;
  margin: 1.3em 0;
  padding: 44px 18px 16px;
  border-radius: var(--nx-radius);
  background: var(--nx-code-bg);
  border: 1px solid var(--nx-border-strong);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.nx-entry pre::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 20px 0 0 #febc2e, 40px 0 0 #28c840;
}
.nx-entry pre::after {
  content: attr(data-lang);
  position: absolute;
  top: 12px;
  right: 60px;
  font-family: var(--nx-mono);
  font-size: 11px;
  color: var(--nx-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.nx-entry code {
  font-family: var(--nx-mono);
  font-size: 0.9em;
}
.nx-entry :not(pre) > code {
  background: rgba(124, 92, 255, 0.13);
  color: var(--nx-accent-2);
  padding: 2px 7px;
  border-radius: 6px;
}
.nx-code-copy {
  position: absolute;
  top: 9px;
  right: 10px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-family: var(--nx-font);
  color: var(--nx-muted);
  background: var(--nx-card-hover);
  border: 1px solid var(--nx-border);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}
.nx-entry pre:hover .nx-code-copy, .nx-code-copy:focus-visible { opacity: 1; }
.nx-code-copy:hover { color: var(--nx-accent-2); }
.nx-code-copy.is-copied { color: #28c840; opacity: 1; }

/* 下载区 */
.nx-down {
  margin: 28px 0;
  padding: 22px;
  border-radius: var(--nx-radius);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(124, 92, 255, 0.08));
}
.nx-down h4 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.nx-down h4::before { content: "⬇"; color: var(--nx-accent-2); }
.nx-down-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* 声明 / 相邻文章 */
.nx-notice {
  margin: 24px 0 0;
  padding: 14px 18px;
  border-radius: var(--nx-radius-sm);
  border: 1px dashed var(--nx-border-strong);
  font-size: 12.5px;
  color: var(--nx-faint);
  line-height: 1.8;
}
.nx-neighbor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}
.nx-neighbor a {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius);
  padding: 14px 16px;
  color: var(--nx-text);
  transition: border-color 0.2s, transform 0.2s;
}
.nx-neighbor a:hover { border-color: var(--nx-accent); transform: translateY(-2px); }
.nx-neighbor .nx-neighbor-label { font-size: 11.5px; color: var(--nx-faint); display: block; margin-bottom: 4px; }
.nx-neighbor .nx-neighbor-title { font-size: 14px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-neighbor .nx-next { text-align: right; }

/* ---------- 目录 TOC ---------- */
.nx-toc {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  backdrop-filter: blur(10px);
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: 13px;
}
.nx-toc-title { font-weight: 700; margin: 0 0 10px; font-size: 14px; }
.nx-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: nx-toc; }
.nx-toc ol ol { padding-left: 16px; }
.nx-toc li { counter-increment: nx-toc; margin: 2px 0; }
.nx-toc li::before {
  content: counter(nx-toc);
  font-family: var(--nx-mono);
  font-size: 11px;
  color: var(--nx-faint);
  margin-right: 7px;
}
.nx-toc a { color: var(--nx-muted); display: inline-block; padding: 3px 6px; border-radius: 6px; }
.nx-toc a:hover { color: var(--nx-accent); background: var(--nx-card-hover); }
.nx-toc a.is-active { color: var(--nx-accent); background: var(--nx-card-hover); font-weight: 600; }

/* ---------- 阅读进度 ---------- */
.nx-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2000;
  background: var(--nx-gradient);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.8);
  transition: width 0.08s linear;
}

/* ---------- 分页 ---------- */
.nx-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 28px 0 10px;
  list-style: none;
  padding: 0;
}
.nx-pagination li a,
.nx-pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  color: var(--nx-muted);
  font-size: 14px;
  transition: all 0.2s;
}
.nx-pagination li a:hover { color: var(--nx-text); border-color: var(--nx-border-strong); transform: translateY(-2px); }
.nx-pagination li.thisclass span,
.nx-pagination li.thisclass a {
  background: var(--nx-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.4);
  font-weight: 700;
}
.nx-pagination .pageinfo { border: none !important; background: none !important; color: var(--nx-faint); font-size: 12.5px; }

/* ---------- 评论 ---------- */
.nx-comments { margin-top: 8px; }
.nx-comment-form {
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.nx-comment-form .nx-cf-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; }
.nx-cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.nx-input, .nx-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong);
  background: var(--nx-code-bg);
  color: var(--nx-text);
  font-family: var(--nx-font);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nx-input:focus, .nx-textarea:focus {
  outline: none;
  border-color: var(--nx-accent);
  box-shadow: var(--nx-glow);
}
.nx-input::placeholder, .nx-textarea::placeholder { color: var(--nx-faint); }
.nx-textarea { min-height: 110px; resize: vertical; }
.nx-cf-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.nx-cf-foot .nx-verify img { cursor: pointer; vertical-align: middle; border-radius: 6px; }

.nx-comment {
  display: flex;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px dashed var(--nx-border);
}
.nx-comment .nx-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; border: 2px solid transparent; background: var(--nx-gradient) border-box; padding: 2px; }
.nx-comment .nx-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.nx-comment-info { flex: 1; min-width: 0; }
.nx-comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--nx-muted); }
.nx-comment-head strong { color: var(--nx-text); font-size: 14px; }
.nx-comment-head .floor {
  background: var(--nx-gradient);
  color: #fff;
  font-size: 11px;
  padding: 1px 9px;
  border-radius: 999px;
}
.nx-comment-head .nx-reply-link { margin-left: auto; }
.nx-comment-content { margin-top: 6px; font-size: 14px; overflow-wrap: break-word; }
.nx-comment-content img { max-width: 100%; border-radius: 8px; }
.nx-comment-children { margin-left: 26px; }

/* ---------- 命令面板 ---------- */
.nx-cmdk-mask {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: var(--nx-mask);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.nx-cmdk-mask.is-open { display: flex; }
.nx-cmdk {
  width: 100%;
  max-width: 580px;
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-border-strong);
  background: color-mix(in srgb, var(--nx-bg-soft) 92%, transparent);
  box-shadow: var(--nx-shadow), 0 0 60px rgba(124, 92, 255, 0.18);
  overflow: hidden;
  animation: nx-pop 0.18s ease;
}
@keyframes nx-pop {
  from { transform: scale(0.96) translateY(-8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.nx-cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--nx-border);
}
.nx-cmdk-input-row .nx-cmdk-icon { color: var(--nx-accent); }
.nx-cmdk-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--nx-text);
  font-size: 16px;
  font-family: var(--nx-font);
}
.nx-cmdk-input:focus { outline: none; }
.nx-cmdk-input::placeholder { color: var(--nx-faint); }
.nx-cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 46vh; overflow-y: auto; }
.nx-cmdk-list li a, .nx-cmdk-list li button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--nx-radius-sm);
  color: var(--nx-text);
  font-size: 14px;
  font-family: var(--nx-font);
  background: transparent;
  border: none;
  cursor: pointer;
}
.nx-cmdk-list li .nx-cmdk-ico {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--nx-code-bg);
  border: 1px solid var(--nx-border);
}
.nx-cmdk-list li .nx-cmdk-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--nx-faint);
  font-family: var(--nx-mono);
}
.nx-cmdk-list li.is-active > a,
.nx-cmdk-list li.is-active > button { background: var(--nx-card-hover); }
.nx-cmdk-list li.is-active > a .nx-cmdk-ico,
.nx-cmdk-list li.is-active > button .nx-cmdk-ico { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--nx-border);
  font-size: 11.5px;
  color: var(--nx-faint);
}
.nx-cmdk-foot kbd {
  font-family: var(--nx-mono);
  border: 1px solid var(--nx-border);
  border-radius: 4px;
  padding: 0 5px;
  background: var(--nx-code-bg);
}

/* ---------- AI 助手 ---------- */
.nx-ai-fab {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 2400;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--nx-gradient);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 26px rgba(124, 92, 255, 0.5);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nx-ai-fab:hover { transform: scale(1.08) rotate(6deg); }

.nx-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 150px;
  z-index: 2450;
  width: min(370px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 220px));
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-border-strong);
  background: color-mix(in srgb, var(--nx-bg-soft) 94%, transparent);
  backdrop-filter: blur(20px);
  box-shadow: var(--nx-shadow), 0 0 50px rgba(124, 92, 255, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: nx-pop 0.2s ease;
}
.nx-ai-panel.is-open { display: flex; }
.nx-ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nx-border);
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.12), transparent);
}
.nx-ai-head .nx-ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--nx-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.4);
}
.nx-ai-head b { font-size: 14px; }
.nx-ai-head small { display: block; font-size: 11px; color: var(--nx-faint); font-weight: 400; }
.nx-ai-close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--nx-faint);
  font-size: 17px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.nx-ai-close:hover { color: var(--nx-text); background: var(--nx-card-hover); }

.nx-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nx-ai-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  animation: nx-fade 0.25s ease;
}
@keyframes nx-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.nx-ai-msg--bot {
  align-self: flex-start;
  background: var(--nx-card-hover);
  border: 1px solid var(--nx-border);
  border-bottom-left-radius: 4px;
}
.nx-ai-msg--bot a { display: block; margin-top: 4px; font-size: 13px; }
.nx-ai-msg--user {
  align-self: flex-end;
  background: var(--nx-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.nx-ai-typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 12px 14px; }
.nx-ai-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nx-muted);
  animation: nx-bounce 1s infinite;
}
.nx-ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.nx-ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes nx-bounce {
  0%, 60%, 100% { transform: none; opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.nx-ai-foot {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--nx-border);
}
.nx-ai-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--nx-border-strong);
  background: var(--nx-code-bg);
  color: var(--nx-text);
  font-size: 13.5px;
  font-family: var(--nx-font);
}
.nx-ai-input:focus { outline: none; border-color: var(--nx-accent); }
.nx-ai-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--nx-gradient);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.nx-ai-send:hover { transform: scale(1.08); }
.nx-ai-mode {
  font-size: 11px;
  color: var(--nx-faint);
  padding: 0 16px 10px;
}
.nx-ai-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}
.nx-ai-quick button {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--nx-border-strong);
  background: transparent;
  color: var(--nx-muted);
  cursor: pointer;
  font-family: var(--nx-font);
  transition: all 0.2s;
}
.nx-ai-quick button:hover { color: var(--nx-accent); border-color: var(--nx-accent); }

/* ---------- 灯箱 ---------- */
.nx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2800;
  background: rgba(3, 6, 16, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.nx-lightbox.is-open { display: flex; }
.nx-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--nx-radius);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  animation: nx-pop 0.2s ease;
}

/* ---------- 回顶 ---------- */
.nx-gotop {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 2300;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--nx-border-strong);
  background: var(--nx-card);
  backdrop-filter: blur(10px);
  color: var(--nx-muted);
  font-size: 17px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.25s;
}
.nx-gotop.is-show { opacity: 1; pointer-events: auto; transform: none; }
.nx-gotop:hover { color: var(--nx-accent); border-color: var(--nx-accent); }

/* ---------- 骨架屏 ---------- */
.nx-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--nx-card);
  border-radius: var(--nx-radius);
}
.nx-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 255, 0.12), transparent);
  transform: translateX(-100%);
  animation: nx-skel 1.4s infinite;
}
@keyframes nx-skel { to { transform: translateX(100%); } }
.nx-skel-cover { aspect-ratio: 16/9; margin-bottom: 12px; }
.nx-skel-line { height: 14px; margin: 8px 14px; border-radius: 6px; }
.nx-skel-line:last-child { width: 55%; }
.nx-card.is-loading { pointer-events: none; }

/* ---------- Toast ---------- */
.nx-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  z-index: 2900;
  background: var(--nx-bg-soft);
  border: 1px solid var(--nx-border-strong);
  color: var(--nx-text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--nx-shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}
.nx-toast.is-show { opacity: 1; transform: translateX(-50%); }

/* ---------- 页脚 ---------- */
.nx-footer {
  margin-top: 56px;
  border-top: 1px solid var(--nx-border);
  background: color-mix(in srgb, var(--nx-bg-soft) 65%, transparent);
  backdrop-filter: blur(12px);
}
.nx-footer-inner {
  max-width: var(--nx-max);
  margin: 0 auto;
  padding: 36px 20px 26px;
}
.nx-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  margin-bottom: 20px;
}
.nx-footer-links {
  border-top: 1px dashed var(--nx-border);
  padding-top: 18px;
  margin-bottom: 20px;
}
.nx-footer-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.nx-footer-links li {
  margin: 0;
  font-size: 13px;
}
.nx-footer-links a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--nx-border);
  border-radius: 999px;
  color: var(--nx-muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nx-footer-links a:hover {
  color: var(--nx-accent);
  border-color: var(--nx-accent);
  background: color-mix(in srgb, var(--nx-accent) 8%, transparent);
}
.nx-footer h4 { margin: 0 0 12px; font-size: 14px; }
.nx-footer p { margin: 0 0 6px; font-size: 13px; color: var(--nx-muted); }
.nx-footer ul { list-style: none; margin: 0; padding: 0; }
.nx-footer ul li { margin: 6px 0; font-size: 13px; }
.nx-footer ul a { color: var(--nx-muted); }
.nx-footer ul a:hover { color: var(--nx-accent); }
.nx-footer-bottom {
  border-top: 1px solid var(--nx-border);
  padding-top: 18px;
  font-size: 12.5px;
  color: var(--nx-faint);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.nx-footer-bottom a { color: var(--nx-faint); }
.nx-footer-bottom a:hover { color: var(--nx-accent); }

/* ---------- 微语 ---------- */
.nx-tweet-list { list-style: none; margin: 0; padding: 0; position: relative; }
.nx-tweet-list::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--nx-accent), var(--nx-accent-2));
  opacity: 0.4;
}
.nx-tweet {
  position: relative;
  padding: 0 0 26px 36px;
}
.nx-tweet::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nx-gradient);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.2);
}
.nx-tweet-time { font-size: 12px; color: var(--nx-faint); font-family: var(--nx-mono); }
.nx-tweet-content {
  margin-top: 8px;
  border: 1px solid var(--nx-border);
  background: var(--nx-card);
  border-radius: var(--nx-radius);
  padding: 14px 16px;
  font-size: 14px;
  backdrop-filter: blur(8px);
}

/* ---------- 404 ---------- */
.nx-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--nx-bg);
  position: relative;
  overflow: hidden;
}
.nx-404::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(500px 380px at 30% 30%, rgba(124, 92, 255, 0.18), transparent 65%),
    radial-gradient(500px 380px at 70% 65%, rgba(34, 211, 238, 0.14), transparent 65%);
  animation: nx-drift 9s ease-in-out infinite alternate;
}
@keyframes nx-drift { to { transform: translate(4%, -4%) scale(1.06); } }
.nx-404-inner { position: relative; }
.nx-404-code {
  font-family: var(--nx-mono);
  font-size: clamp(90px, 18vw, 150px);
  font-weight: 800;
  line-height: 1;
  margin: 0;
  background: var(--nx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 40px rgba(124, 92, 255, 0.35));
}
.nx-404 p { color: var(--nx-muted); margin: 14px 0 26px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .nx-layout { grid-template-columns: 1fr; }
  .nx-layout > .nx-side { position: static; }
  .nx-side-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
  .nx-widget { margin-bottom: 0; }
}

@media (max-width: 768px) {
  .nx-nav { display: none; }
  .nx-menu-btn { display: inline-flex; }
  .nx-search-btn .nx-search-label { display: none; }
  .nx-hero { padding: 48px 0 30px; }
  .nx-list-item { flex-direction: column; }
  .nx-list-item .nx-card-cover { width: 100%; }
  .nx-neighbor { grid-template-columns: 1fr; }
  .nx-footer-grid { grid-template-columns: 1fr; }
  .nx-ai-panel { right: 16px; bottom: 146px; }
  .nx-ai-fab { right: 16px; }
  .nx-gotop { right: 18px; }
}

/* 移动抽屉 */
.nx-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--nx-mask);
  display: none;
}
.nx-drawer-mask.is-open { display: block; }
.nx-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2550;
  width: min(300px, 84vw);
  background: var(--nx-bg-soft);
  border-left: 1px solid var(--nx-border-strong);
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
}
.nx-drawer.is-open { transform: none; }
.nx-drawer a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--nx-radius-sm);
  color: var(--nx-text);
  font-size: 15px;
  margin: 4px 0;
}
.nx-drawer a:hover, .nx-drawer a.is-active { background: var(--nx-card-hover); color: var(--nx-accent); }
.nx-drawer .nx-drawer-title {
  font-size: 12px;
  color: var(--nx-faint);
  margin: 18px 0 8px;
  padding: 0 14px;
  letter-spacing: 2px;
}
.nx-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- 打印 ---------- */
@media print {
  .nx-header, .nx-footer, .nx-ai-fab, .nx-ai-panel, .nx-gotop, .nx-cmdk-mask,
  .nx-side, .nx-toc, .nx-progress, .nx-lightbox, .nx-drawer, .nx-drawer-mask { display: none !important; }
  body { background: #fff; color: #000; }
}
