/* Nexus 生态官网 — 与 NexusMind 风格统一
   毛玻璃暗黑、Outfit、青色强调 #00e5ff */

:root {
  --nx-bg-primary: #08090c;
  --nx-bg-secondary: #0c0e12;
  --nx-bg-card: rgba(20, 23, 29, 0.75);
  --nx-bg-glass: rgba(20, 23, 29, 0.6);
  --nx-text-primary: #e6e8ec;
  --nx-text-secondary: #9ba0ab;
  --nx-text-muted: #6b7280;
  --nx-accent: #00e5ff;
  --nx-accent-dim: #00b8d4;
  --nx-accent-glow: rgba(0, 229, 255, 0.25);
  --nx-border: rgba(255, 255, 255, 0.06);
  --nx-radius: 14px;
  --nx-radius-sm: 10px;
  --nx-font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  /* 站内容量别名（与历史类名兼容） */
  --nx-bg: var(--nx-bg-primary);
  --nx-bg-soft: var(--nx-bg-secondary);
  --nx-card: var(--nx-bg-card);
  --nx-glass: var(--nx-bg-glass);
  --nx-text: var(--nx-text-primary);
  --nx-muted: var(--nx-text-secondary);
  --nx-glow: var(--nx-accent-glow);
}

/**
 * [hidden] 默认应为 display:none，但下方 .nx-modal-panel / .nx-ai-panel 等写了 display:flex，
 * 作者样式会覆盖默认隐藏，导致「已关闭」的弹窗仍铺满视口、关闭按钮看似无效。
 */
[hidden] {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
  /* PWA / Electron / Tauri：父级给出高度时让 % 与 flex 子项有稳定参照，不改变常规浏览器视觉 */
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--nx-font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--nx-text);
  background: var(--nx-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* 首页布局：一屏展示，保留全宽且避免挤压 */
body.nx-home-page {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  background: #000 !important;
}

body.nx-home-page .nx-app {
  width: 100vw !important;
  height: 100vh !important;
}

.nx-app {
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ----- 顶部导航 ----- */
.nx-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--nx-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nx-border);
}

.nx-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--nx-text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nx-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nx-accent-dim), var(--nx-accent));
  color: var(--nx-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 0 20px var(--nx-glow);
}

/* 顶栏：Nexus Brain OS 标题后约 2cm，当前登录用户名（青蓝发光） */
.nx-nav-user-glow {
  margin-left: 2cm;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #7ddcff;
  text-shadow:
    0 0 6px rgba(0, 229, 255, 0.95),
    0 0 16px rgba(56, 189, 248, 0.55),
    0 0 28px rgba(56, 189, 248, 0.22);
  white-space: nowrap;
  max-width: min(38vw, 12rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .nx-nav-user-glow {
    margin-left: 0.85rem;
    max-width: min(50vw, 9.5rem);
    font-size: 0.68rem;
  }
}

.nx-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nx-nav-link {
  color: var(--nx-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nx-nav-auth .nx-btn,
.nx-user {
  font-size: 0.9rem;
}

.nx-lang-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--nx-border);
  border-radius: 6px;
  overflow: hidden;
  margin-right: 0.65rem;
  flex-shrink: 0;
}

.nx-lang-switch__btn {
  font-family: var(--nx-font);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.42rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--nx-muted);
  cursor: pointer;
  line-height: 1.25;
  min-width: 1.65rem;
}

.nx-lang-switch__btn:hover {
  color: var(--nx-text);
  background: rgba(255, 255, 255, 0.04);
}

.nx-lang-switch__btn--on {
  background: rgba(0, 229, 255, 0.1);
  color: var(--nx-accent);
}

.nx-user {
  color: var(--nx-muted);
}

.nx-nav-system-txt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: 7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 480px) {
  .nx-nav-system-txt {
    max-width: none;
  }
}

.nx-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--nx-border);
  background: transparent;
  color: var(--nx-text);
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nx-nav-toggle::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

@media (max-width: 768px) {
  .nx-nav-links {
    display: none;
  }
  .nx-nav-toggle {
    display: flex;
  }
  .nx-nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nx-glass);
    backdrop-filter: blur(16px);
    padding: 1rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--nx-border);
  }
}

/* ----- 按钮 ----- */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: var(--nx-font);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--nx-radius);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.nx-btn-primary {
  background: linear-gradient(135deg, var(--nx-accent-dim), var(--nx-accent));
  color: var(--nx-bg);
  border: none;
  box-shadow: 0 0 24px var(--nx-glow);
}

.nx-btn-primary:hover {
  box-shadow: 0 0 32px var(--nx-glow);
  transform: translateY(-1px);
}

.nx-btn-ghost {
  background: transparent;
  color: var(--nx-accent);
  border: 1px solid var(--nx-accent);
}

.nx-btn-ghost:hover {
  background: rgba(0, 229, 255, 0.08);
}

.nx-btn-card {
  margin-top: 1rem;
  background: rgba(0, 229, 255, 0.12);
  color: var(--nx-accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.nx-btn-card:hover {
  background: rgba(0, 229, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--nx-glow);
}

/* ----- Hero ----- */
.nx-hero {
  position: relative;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 5.5rem;
  overflow: hidden;
}

/* 主界面收敛为 Nexus AI 时占位 hero 不占屏高 */
.nx-hero--minimal {
  min-height: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

/* 右下角 NX：与左下 M 对称（仅 M + NX，无 E）；须低于系统/账户等弹窗 1000 */
.nx-nex-fab-root {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 900;
  font-family: var(--nx-font);
}

body.nx-app--nex-primary .nx-legal-strip {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}

/* 手机 / 矮窗：底部为 M·E·AI 固定钮留出空间，避免「与 Nex 聊聊」被挡 */
@media (max-width: 960px), (max-height: 740px) {
  .nx-hero {
    padding-bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }
}

.nx-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 229, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.nx-hero-tag {
  position: relative;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--nx-accent);
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.nx-hero-title {
  position: relative;
  font-size: clamp(2.25rem, 6.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  line-height: 1.15;
}

.nx-hero-desc {
  position: relative;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--nx-muted);
  max-width: 640px;
  margin: 0 0 2.25rem;
  line-height: 1.65;
}

.nx-hero-main-title {
  color: #ffffff;
  font-size: clamp(2.5rem, 7vw, 3.85rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.nx-hero-mission {
  color: #9e9e9e;
  font-size: clamp(0.95rem, 2.2vw, 1.12rem);
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.nx-nex-hero-block {
  position: relative;
  width: 100%;
  max-width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

/* 与底部 M / E / AI 三钮同系：玻璃底、方角圆角、青色描边与呼吸光晕 */
.nx-nex-toggle-btn {
  align-self: center;
  min-width: 9.25rem;
  padding: 0.62rem 1.2rem;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 255, 0.48);
  background: rgba(20, 23, 29, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--nx-accent);
  text-shadow: 0 0 12px var(--nx-glow);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 229, 255, 0.22),
    0 0 28px var(--nx-glow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: nx-fab-glow 3.2s ease-in-out infinite;
}

.nx-nex-toggle-btn:hover {
  transform: scale(1.04);
  border-color: rgba(0, 229, 255, 0.58);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 229, 255, 0.38),
    0 0 40px rgba(0, 229, 255, 0.32);
}

/* Nex 打开时盖过同根内 FAB，且整体仍低于全站弹窗 1000 */
.nx-nex-shell-layer {
  z-index: 20;
}

.nx-nex-shell-layer .nx-ai-panel--hub.nx-nex-panel {
  height: min(700px, calc(100dvh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  max-height: min(700px, calc(100dvh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
}

@supports not (height: 100dvh) {
  .nx-nex-shell-layer .nx-ai-panel--hub.nx-nex-panel {
    height: min(700px, calc(100vh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    max-height: min(700px, calc(100vh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  }
}


.nx-nex-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nx-nex-panel-head-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

/* Nex 标题不与顶栏/关闭钮横向挤压；长文案省略 */
.nx-nex-panel .nx-ai-panel-head {
  flex-shrink: 0;
}

.nx-nex-panel .nx-ai-panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-nex-avatar-mark {
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.nx-nex-hub-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.65rem 0.85rem 0.85rem;
  overflow: hidden;
}

@media (max-width: 768px) {
  .nx-nex-hub-body {
    padding-bottom: 0.65rem;
  }
}

/* Nex：消息区 + 输入区同一滚动容器，输入框在流末尾（避免手机键盘遮挡固定底栏） */
.nx-nex-msgs.nx-ai-messages--hub {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  padding-bottom: 20px;
}

.nx-nex-msg-stream {
  flex: 0 0 auto;
  min-width: 0;
}

.nx-nex-msgs > .nx-ai-input-row.nx-nex-input-row {
  flex-shrink: 0;
  margin-top: 12px;
  padding: 8px;
  background: #1e1e1e;
  border-radius: 12px;
  border: 1px solid var(--nx-border);
}

.nx-nex-input-row textarea {
  min-height: 52px;
}

.nx-nex-send-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
  align-items: stretch;
}

.nx-nex-side-btn {
  flex-shrink: 0;
  align-self: flex-end;
  white-space: nowrap;
}

.nx-nex-side-btn.recording {
  animation: nx-nex-pulse 1.1s ease-in-out infinite;
  border-color: #f87171;
  color: #f87171;
}

@keyframes nx-nex-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.nx-nex-send-btn {
  min-width: 4.5rem;
}

/* Nex 内用户气泡：右对齐条带，与中枢对话区一致 */
.nx-nex-msg-stream .nx-ai-msg--user.nx-nex-msg-user-pill {
  margin-left: auto;
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border-left: none;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.22);
}

.nx-nex-img-preview {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 0.35rem;
  object-fit: contain;
}

.nx-nex-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(74, 144, 226, 0.45);
  color: #e0e0e0;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(74, 144, 226, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nx-nex-toast.nx-nex-toast--show {
  opacity: 1;
}

.nx-hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.nx-hero-actions .nx-btn {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.nx-hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.nx-scroll-icon {
  display: block;
  position: relative;
  width: 24px;
  height: 36px;
  border: 2px solid var(--nx-accent);
  border-radius: 12px;
  opacity: 0.6;
}

.nx-scroll-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: -2px;
  width: 4px;
  height: 8px;
  background: var(--nx-accent);
  border-radius: 2px;
  animation: nx-scroll 2s ease-in-out infinite;
}

@keyframes nx-scroll {
  0%, 100% { opacity: 0; top: 6px; }
  50% { opacity: 1; top: 14px; }
}

/* ----- 产品卡片区 ----- */
.nx-products {
  padding: 4rem 1.5rem;
  position: relative;
}

.nx-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--nx-muted);
  text-align: center;
  margin: 0 0 2.5rem;
}

.nx-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.nx-card {
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  padding: 1.75rem;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.nx-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 40px var(--nx-glow);
  border-color: rgba(0, 229, 255, 0.2);
}

.nx-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nx-icon-mind,
.nx-icon-flow,
.nx-icon-ai,
.nx-icon-hand,
.nx-icon-geekhub {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--nx-accent);
}

.nx-icon-mind::before { content: 'M'; }
.nx-icon-flow::before { content: 'F'; }
.nx-icon-ai::before { content: 'AI'; }
.nx-icon-hand::before { content: 'H'; }
.nx-icon-geekhub::before { content: 'G'; }

/* GeekHub 卡片单独一行时居中（4+1 布局） */
@media (min-width: 900px) {
  .nx-cards {
    grid-template-columns: repeat(4, 1fr);
  }
  .nx-card-geekhub {
    grid-column: 2 / 4;
  }
}

.nx-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.nx-card-desc {
  font-size: 0.9rem;
  color: var(--nx-muted);
  margin: 0;
  line-height: 1.45;
}

/* ----- 生态闭环 ----- */
.nx-ecosystem {
  position: relative;
  padding: 4rem 1.5rem;
  text-align: center;
  overflow: hidden;
}

.nx-ecosystem-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(0, 229, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.nx-ecosystem .nx-section-title {
  margin-bottom: 1rem;
}

.nx-ecosystem-slogan {
  position: relative;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nx-accent);
  margin: 0 0 2rem;
  letter-spacing: 0.02em;
}

.nx-flow {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.nx-flow-node {
  padding: 0.75rem 1.25rem;
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nx-flow-node:hover {
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 20px var(--nx-glow);
}

.nx-flow-icon {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nx-accent);
}

.nx-flow-label {
  font-size: 0.75rem;
  color: var(--nx-muted);
}

.nx-flow-arrow {
  color: var(--nx-accent);
  opacity: 0.7;
  font-size: 1.25rem;
}

@media (max-width: 600px) {
  .nx-flow-arrow {
    display: none;
  }
  .nx-flow-node::after {
    content: ' → ';
    color: var(--nx-accent);
    opacity: 0.7;
  }
  .nx-flow-node:last-child::after {
    display: none;
  }
}

/* ----- 首页主区：深色星空背景 + 居中品牌 Hero ----- */
.nx-main-bg {
  flex: 1;
  min-height: min(70vh, 560px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 5.5rem 1.5rem 8rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% 18%, rgba(0, 229, 255, 0.07), transparent 58%),
    radial-gradient(ellipse 50% 40% at 85% 70%, rgba(56, 189, 248, 0.05), transparent 52%),
    linear-gradient(180deg, #050608 0%, #0a0c10 45%, #0b0d12 100%);
}

body.nx-home-page .nx-main-bg {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: calc(56px + 3vh) 4vw 6vh !important;
}

/* 底部青蓝氛围光（与星空层叠加，不替换原背景色） */
.nx-main-bg::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(55%, 420px);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 95% 85% at 50% 100%, rgba(0, 229, 255, 0.11), transparent 62%);
}

.nx-main-bg__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.72;
  background-image:
    radial-gradient(1px 1px at 8% 15%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 22% 78%, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1px 1px at 41% 32%, rgba(255, 255, 255, 0.22), transparent),
    radial-gradient(1px 1px at 63% 88%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 77% 44%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 91% 12%, rgba(255, 255, 255, 0.38), transparent);
  animation: nx-main-twinkle 10s ease-in-out infinite;
}

@keyframes nx-main-twinkle {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 0.88;
  }
}

.nx-hero {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 1.8vh, 1.35rem);
  margin-top: 25vh;
}

body.nx-home-page .nx-hero {
  width: 100% !important;
  max-width: min(92vw, 54rem) !important;
  margin-top: clamp(10vh, 14vh, 18vh) !important;
  text-align: center !important;
  min-height: auto !important;
  height: auto !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  overflow: visible !important;
}

.nx-hero__title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  margin: 0;
  line-height: 1.08;
}

.nx-hero__title-en {
  display: block;
  margin: 0;
  font-family: 'Inter', 'Avenir Next', 'Segoe UI', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.nx-hero__title-zh {
  display: block;
  margin: 0;
  font-family:
    'PingFang SC',
    'Hiragino Sans GB',
    'Noto Sans CJK SC',
    'Microsoft YaHei',
    var(--nx-font),
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  font-weight: 700;
  font-size: clamp(1.45rem, 3.7vw, 2.2rem);
  letter-spacing: 0.015em;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

.nx-hero__subtitle {
  margin: 0.25rem 0 0;
  font-family:
    'Inter',
    var(--nx-font),
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  font-weight: 400;
  font-size: clamp(0.98rem, 1.8vw, 1.2rem);
  line-height: 1.72;
  letter-spacing: 0.03em;
  max-width: 44ch;
  color: #a9b2bf;
}

.nx-hero__cta {
  margin-top: clamp(1rem, 2vh, 1.5rem);
  padding: 0.75rem 1.9rem;
  font-family:
    var(--nx-font),
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #00e5ff;
  background: transparent;
  border: 1px solid #00e5ff;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 16px rgba(0, 229, 255, 0.28),
    0 0 36px rgba(0, 229, 255, 0.1);
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.nx-hero__cta:hover {
  background: rgba(0, 229, 255, 0.08);
  box-shadow:
    0 0 22px rgba(0, 229, 255, 0.45),
    0 0 52px rgba(0, 229, 255, 0.18);
}

.nx-hero__cta:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.65);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  body.nx-home-page .nx-main-bg {
    padding: calc(52px + 2vh) 1.1rem 6vh !important;
  }

  body.nx-home-page .nx-hero {
    max-width: 95vw !important;
    margin-top: clamp(8vh, 10vh, 12vh) !important;
    padding: 0 !important;
  }

  .nx-hero__title-zh {
    letter-spacing: 0.01em;
  }
}

/* ----- 页脚：弱化法律信息 + 底部分隔条（固定在视口底栏之上，居中） ----- */
.nx-legal-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 90;
  margin: 0;
  padding: 0 1.5rem;
  text-align: center;
  pointer-events: none;
}

.nx-legal-copy {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(155, 160, 171, 0.45);
}

.nx-legal-links {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(155, 160, 171, 0.4);
  line-height: 1.6;
}

.nx-legal-links a {
  color: rgba(155, 160, 171, 0.48);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nx-legal-links a:hover {
  color: rgba(0, 229, 255, 0.65);
}

.nx-legal-strip .nx-legal-copy,
.nx-legal-strip .nx-legal-links,
.nx-legal-strip a {
  pointer-events: auto;
}

.nx-footer {
  margin-top: 0;
  padding: 0;
  min-height: 0;
  border-top: none;
  background: transparent;
}

.nx-footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  z-index: 85;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 12, 16, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 兼容旧类名（若其他页仍引用） */
.nx-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.nx-footer-copy {
  font-size: 0.72rem;
  color: rgba(155, 160, 171, 0.45);
  margin: 0;
}

.nx-footer-links {
  display: flex;
  gap: 1.5rem;
}

.nx-footer-links a {
  font-size: 0.7rem;
  color: rgba(155, 160, 171, 0.45);
  text-decoration: none;
  transition: color 0.2s;
}

.nx-footer-links a:hover {
  color: var(--nx-accent);
}

/* ----- 弹窗：登录 / 系统管理 / 账户（对齐 NexusMind 玻璃层级） ----- */
.nx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.nx-modal-panel {
  position: fixed;
  z-index: 1001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
  max-height: min(88vh, 720px);
  max-height: min(88dvh, 720px);
  padding: 1.25rem 1.35rem;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 40px var(--nx-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.nx-glass {
  background: rgba(14, 16, 22, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nx-settings-panel,
.nx-account-panel {
  width: min(520px, calc(100vw - 1.5rem));
}

/* 系统设置（含 NexusMind 记忆库区块）内容更长，独立窗口/PWA 下用 dvh 贴合实际可视高度 */
.nx-settings-panel.nx-modal-panel,
.nx-account-panel.nx-modal-panel {
  max-height: min(90vh, 900px);
  max-height: min(92dvh, 900px);
}

.nx-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nx-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nx-tab {
  font-family: var(--nx-font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--nx-muted);
  cursor: pointer;
}

.nx-tab:hover {
  color: var(--nx-accent);
}

.nx-tab.active {
  color: var(--nx-accent);
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
}

.nx-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--nx-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--nx-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.nx-modal-close:hover {
  background: rgba(0, 229, 255, 0.12);
  color: var(--nx-accent);
}

.nx-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.nx-modal-title-inline {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.nx-modal-sub {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--nx-muted);
  line-height: 1.5;
}

.nx-auth-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.nx-auth-form {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.nx-auth-form.active {
  display: flex;
}

.nx-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--nx-muted);
}

.nx-field input,
.nx-field select {
  font-family: var(--nx-font);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--nx-text);
}

.nx-field input:focus,
.nx-field select:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.45);
}

.nx-login-mode {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--nx-muted);
}

.nx-login-mode label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.nx-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.nx-code-row input {
  flex: 1;
  font-family: var(--nx-font);
  padding: 0.6rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--nx-text);
}

.nx-btn-block {
  width: 100%;
  margin-top: 0.25rem;
}

.nx-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--nx-accent);
  border: 1px solid var(--nx-border);
}

.nx-btn-secondary:hover {
  background: rgba(0, 229, 255, 0.1);
}

.nx-btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.nx-btn-code {
  white-space: nowrap;
  flex-shrink: 0;
}

.nx-settings-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nx-set-section h4 {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-muted);
}

.nx-set-section p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.nx-muted {
  color: var(--nx-muted);
  margin-right: 0.35rem;
}

.nx-sub {
  font-size: 0.82rem !important;
  line-height: 1.45;
}

.nx-hint {
  font-size: 0.78rem;
  color: var(--nx-muted);
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.nx-apikey-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nx-apikey-item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
}

.nx-apikey-item .nx-masked {
  font-family: ui-monospace, monospace;
  color: var(--nx-accent);
  display: block;
  margin-bottom: 0.35rem;
}

.nx-apikey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.nx-submodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.4);
}

.nx-submodal {
  position: fixed;
  z-index: 1101;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 2rem));
  max-height: min(85vh, 640px);
  max-height: min(85dvh, 640px);
  padding: 1.25rem;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  overflow: auto;
  min-height: 0;
}

.nx-submodal h5 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.nx-row-btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.nx-curl {
  margin: 0 0 0.5rem;
  padding: 0.75rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--nx-border);
  font-size: 0.72rem;
  overflow-x: auto;
  color: var(--nx-muted);
}

.nx-curl code {
  font-family: ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.nx-mode-group {
  margin-bottom: 0.85rem;
}

.nx-mode-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nx-accent);
  margin-bottom: 0.35rem;
}

.nx-radio-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--nx-muted);
  margin: 0.25rem 0;
  cursor: pointer;
}

.nx-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 229, 255, 0.06);
  font-size: 0.78rem;
  color: var(--nx-muted);
}

.nx-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nx-accent);
  box-shadow: 0 0 8px var(--nx-glow);
}

.nx-plan-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.nx-table-wrap {
  overflow-x: auto;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
}

.nx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.nx-table th,
.nx-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--nx-border);
}

.nx-table th {
  color: var(--nx-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nx-user-pill {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .nx-nav-auth {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
  }
  .nx-nav-links.open .nx-nav-auth {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* NexusMind 管理（系统管理内嵌） */
.nx-mind-admin {
  border-left: 2px solid rgba(0, 229, 255, 0.35);
  padding-left: 0.75rem;
  margin-left: 0.1rem;
}
.nx-mind-subh {
  margin: 1rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nx-muted);
}
.nx-mind-preview-list li {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--nx-border);
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--nx-text);
  transition: background 0.15s ease, color 0.15s ease;
}
.nx-mind-preview-list li:last-child {
  border-bottom: 0;
}
.nx-mind-preview-list li:hover {
  background: rgba(0, 229, 255, 0.07);
  color: #00e5ff;
}

@keyframes nx-fab-glow {
  0%,
  100% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(0, 229, 255, 0.32),
      0 0 24px var(--nx-glow),
      0 0 48px rgba(0, 229, 255, 0.12);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(0, 229, 255, 0.5),
      0 0 32px rgba(0, 229, 255, 0.28),
      0 0 56px rgba(0, 229, 255, 0.16);
  }
}

/* ----- NexusAI：FAB + 居中大窗口中枢控制台 ----- */
/* 低于系统/账户等弹窗(1000/1001)，避免 Dock 压在二级界面上 */
.nx-ai-dock-root {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 900;
  font-family: var(--nx-font);
}

.nx-ai-fab {
  position: relative; /* 使 z-index 生效，保证始终叠在全屏壳层之上 */
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: rgba(20, 23, 29, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 229, 255, 0.25),
    0 0 28px var(--nx-glow);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: nx-fab-glow 3.2s ease-in-out infinite;
}

.nx-ai-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 255, 0.45), 0 0 40px rgba(0, 229, 255, 0.35);
}

.nx-ai-fab-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--nx-accent);
  text-shadow: 0 0 12px var(--nx-glow);
}

.nx-ai-shell {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  pointer-events: none;
}

/* Nex 手机：顶避让固定主导航+刘海，底避让 M·E·AI 触控带（须双类名，否则会被上一段 .nx-ai-shell padding 覆盖） */
@media (max-width: 768px) {
  .nx-ai-shell.nx-nex-shell-layer {
    padding: calc(env(safe-area-inset-top, 0px) + 3.55rem) max(0.6rem, env(safe-area-inset-right, 0px))
      calc(env(safe-area-inset-bottom, 0px) + 6.35rem) max(0.6rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }

  .nx-nex-shell-layer .nx-ai-panel--hub.nx-nex-panel {
    height: min(
      700px,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3.55rem - 6.35rem - 0.75rem)
    );
    max-height: min(
      700px,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3.55rem - 6.35rem - 0.75rem)
    );
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 768px) {
    .nx-nex-shell-layer .nx-ai-panel--hub.nx-nex-panel {
      height: min(
        700px,
        calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3.55rem - 6.35rem - 0.75rem)
      );
      max-height: min(
        700px,
        calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3.55rem - 6.35rem - 0.75rem)
      );
    }
  }
}

/* Nex + visualViewport：壳层已贴合可见视口，面板高度须跟壳层内容区（--nex-shell-inner-h），不能用仍按整屏的 100dvh */
.nx-ai-shell.nx-nex-shell-layer.nx-nex-shell--vv-sync {
  overflow: hidden;
}

.nx-ai-shell.nx-nex-shell-layer.nx-nex-shell--vv-sync .nx-ai-panel--hub.nx-nex-panel {
  height: min(700px, var(--nex-shell-inner-h, calc(100vh - 2rem)));
  max-height: min(700px, var(--nex-shell-inner-h, calc(100vh - 2rem)));
}

.nx-ai-shell[hidden] {
  display: none !important;
}

.nx-ai-shell-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  pointer-events: auto;
  cursor: default;
}

.nx-ai-panel {
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nx-ai-panel--hub {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: min(100%, 900px);
  height: min(700px, calc(100vh - 1.5rem));
  max-height: min(700px, calc(100vh - 1.5rem));
  height: min(700px, calc(100dvh - 1.5rem));
  max-height: min(700px, calc(100dvh - 1.5rem));
}

.nx-ai-panel--hub.nx-ai-panel--minimized {
  height: auto;
  max-height: none;
}

.nx-ai-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--nx-border);
  background: rgba(0, 229, 255, 0.04);
}

.nx-ai-panel-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--nx-accent);
  letter-spacing: 0.02em;
}

.nx-ai-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

/* NexusAI 顶栏：紧挨设置钮，已登录邮箱/身份（青蓝发光） */
.nx-ai-login-badge {
  margin-right: 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #7ddcff;
  text-shadow:
    0 0 6px rgba(0, 229, 255, 0.95),
    0 0 14px rgba(56, 189, 248, 0.5);
  white-space: nowrap;
  max-width: min(42vw, 11rem);
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.nx-ai-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--nx-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.nx-ai-icon-btn:hover {
  color: var(--nx-text);
  border-color: rgba(0, 229, 255, 0.25);
}

.nx-ai-hub-body {
  flex: 1;
  display: flex;
  min-height: 0;
  gap: 0;
}

.nx-ai-hub-main {
  flex: 0 0 70%;
  max-width: 70%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--nx-border);
  min-height: 0;
}

.nx-ai-hub-body--stack {
  flex-direction: column;
}

.nx-ai-hub-main--full {
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
  border-right: none;
}

.nx-ai-tab-pane--tasks {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.65rem;
}

.nx-nexuslocal-block {
  margin-bottom: 0.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--nx-border);
}

.nx-nexuslocal-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--nx-text);
}

.nx-local-add-device {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--nx-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.nx-local-add-device:hover {
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.07);
}

.nx-local-add-device__plus {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nx-accent);
  line-height: 1;
}

.nx-local-add-device--bottom {
  margin-top: 0.25rem;
  margin-bottom: 0.45rem;
}

.nx-local-device-list-actions {
  margin: 0 0 0.5rem;
  text-align: center;
}

.nx-local-device-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.nx-local-device-empty {
  margin: 0;
  line-height: 1.45;
}

.nx-local-device-card {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.45rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.nx-local-device-card:hover {
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.05);
}

.nx-local-device-card:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.45);
  outline-offset: 1px;
}

.nx-local-device-card__glyph {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.25;
  align-self: flex-start;
  padding-top: 0.08rem;
}

.nx-local-device-card__main {
  flex: 1;
  min-width: 0;
}

.nx-local-device-card__line1 {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: baseline;
  line-height: 1.35;
}

.nx-local-device-card__name {
  font-weight: 600;
  color: var(--nx-text);
}

.nx-local-device-card__status {
  font-size: 0.72rem;
  font-weight: 600;
}

.nx-local-device-card__status--on {
  color: #34d399;
}

.nx-local-device-card__status--off {
  color: rgba(155, 160, 171, 0.8);
}

.nx-local-device-card__line2 {
  font-size: 0.68rem;
  margin-top: 0.2rem;
}

.nx-local-device-card .nx-local-device-key {
  flex-shrink: 0;
  align-self: center;
}

.nx-local-hint-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--nx-muted);
}

.nx-local-detail-dl {
  margin: 0;
  font-size: 0.78rem;
}

.nx-local-detail-dl dt {
  margin: 0.55rem 0 0.12rem;
  color: var(--nx-muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nx-local-detail-dl dd {
  margin: 0;
  color: var(--nx-text);
  word-break: break-word;
}

.nx-local-detail-actions {
  margin-top: 1rem;
}

.nx-ai-logs--tasks-tab {
  margin-top: 0;
  max-height: 140px;
  padding: 0.45rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--nx-border);
  overflow-y: auto;
  font-size: 0.68rem;
}

.nx-ai-hub-aside {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 0;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.12);
}

.nx-ai-aside-block {
  flex-shrink: 0;
}

.nx-ai-aside-block--console {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.nx-ai-main-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 0;
  border-bottom: 1px solid var(--nx-border);
  flex-shrink: 0;
}

.nx-ai-main-tab {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--nx-radius-sm) var(--nx-radius-sm) 0 0;
  background: transparent;
  color: var(--nx-muted);
  cursor: pointer;
  font-family: inherit;
}

.nx-ai-main-tab:hover {
  color: var(--nx-text);
}

.nx-ai-main-tab--active {
  color: var(--nx-accent);
  border-color: var(--nx-border);
  border-bottom-color: transparent;
  background: rgba(0, 229, 255, 0.06);
  margin-bottom: -1px;
}

.nx-ai-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem 0.75rem;
  overflow: hidden;
}

.nx-ai-tab-pane--chat {
  padding: 0.6rem 0.7rem 0.65rem;
  gap: 0.62rem;
}

.nx-ai-chat-history-wrap {
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  background: rgba(26, 31, 38, 0.88);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.25);
  padding: 0.42rem;
}

.nx-ai-tab-pane--chat .nx-ai-messages--hub {
  margin-bottom: 0;
}

.nx-ai-quick-panel {
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex: 1 1 50%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.48rem;
  border: 1px solid rgba(0, 229, 255, 0.16);
  border-radius: 12px;
  background: rgba(26, 31, 38, 0.95);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08), 0 8px 26px rgba(0, 0, 0, 0.3);
}

.nx-ai-input-row--quick-top {
  margin-bottom: 0.15rem;
}

.nx-ai-quick-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}

.nx-ai-hub-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.nx-ai-quick-group {
  position: relative;
  flex: 1 1 calc(33.333% - 0.35rem);
  min-width: 5.75rem;
  max-width: 100%;
}

.nx-ai-quick-group--single .nx-ai-quick-btn {
  width: 100%;
}

.nx-ai-quick-btn {
  width: 100%;
  min-height: 2.1rem;
  padding: 0.45rem 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  background: rgba(26, 31, 38, 0.88);
  color: #00e5ff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nx-ai-quick-btn:hover,
.nx-ai-quick-group.is-open .nx-ai-quick-btn {
  border-color: rgba(0, 229, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.22), 0 0 20px rgba(0, 229, 255, 0.18);
}

.nx-ai-quick-btn--evo {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.38);
  background: rgba(26, 31, 38, 0.88);
  animation: none;
}

.nx-ai-quick-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(26, 31, 38, 0.98);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
  animation: nx-quick-menu-in 0.16s ease-out;
}

.nx-ai-quick-menu-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--nx-text);
  padding: 0.38rem 0.45rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.nx-ai-quick-menu-item:hover {
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.08);
}

@keyframes nx-quick-menu-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nexus Local 实时状态（快捷按钮「本地状态」） */
.nx-nexus-local-profile-modal {
  max-width: min(420px, 94vw);
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
}

.nx-nexus-local-profile-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.nx-nexus-local-profile-content {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--nx-text);
}

.nx-nexus-local-profile-section {
  margin-bottom: 0.85rem;
}

.nx-nexus-local-profile-subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #00e5ff;
  opacity: 0.95;
}

.nx-nexus-local-profile-modules {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--nx-text-secondary, #9ba0ab);
}

.nx-nexus-local-profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.nx-nexus-local-profile-table th,
.nx-nexus-local-profile-table td {
  border: 1px solid rgba(0, 229, 255, 0.15);
  padding: 0.28rem 0.4rem;
  text-align: left;
}

.nx-nexus-local-profile-table th {
  color: #00e5ff;
  font-weight: 600;
}

.nx-nexus-local-profile-foot {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  opacity: 0.85;
}

.nx-ai-tab-pane[hidden] {
  display: none !important;
}

.nx-ai-task-tab-hint {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
}

.nx-ai-task-tab-hint code {
  font-size: 0.68em;
  padding: 0.05em 0.25em;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
}

.nx-ai-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nx-muted);
}

.nx-ai-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--nx-muted);
  line-height: 1.4;
}

.nx-ai-cmd-grid--inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.nx-ai-messages--hub {
  flex: 1;
  min-height: 140px;
  max-height: none;
  overflow-y: auto;
  padding: 0.55rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--nx-border);
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
}

.nx-ai-msg {
  margin-bottom: 0.5rem;
  line-height: 1.45;
  word-break: break-word;
}

.nx-ai-msg--user {
  color: var(--nx-text);
  padding-left: 0.35rem;
  border-left: 2px solid var(--nx-accent);
}

.nx-ai-msg--assistant {
  color: var(--nx-muted);
}

.nx-nex-taskboard {
  white-space: normal;
  display: grid;
  gap: 6px;
}

.nx-nex-taskboard-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nx-nex-taskboard-title button {
  border: 1px solid rgba(120, 140, 170, 0.35);
  background: rgba(20, 28, 40, 0.65);
  color: #d6deea;
  border-radius: 8px;
  padding: 2px 6px;
  cursor: pointer;
}

.nx-nex-taskrow {
  font-size: 12px;
  color: #d6deea;
  line-height: 1.35;
}

.nx-nex-taskrow--sla {
  color: #fecaca;
}

.nx-nex-taskrow button {
  margin-left: 6px;
  border: 1px solid rgba(120, 140, 170, 0.35);
  background: rgba(20, 28, 40, 0.65);
  color: #d6deea;
  border-radius: 8px;
  padding: 2px 6px;
  cursor: pointer;
}

.nx-nex-task-suggest {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #f8fafc;
}

.nx-nex-task-suggest button {
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  border-radius: 8px;
  padding: 2px 7px;
  cursor: pointer;
}

.nx-nex-task-suggest button[data-task-action='suggest-run-policy'] {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(3, 105, 161, 0.35);
  color: #bae6fd;
}

.nx-ai-msg--md {
  color: var(--nx-text);
}

.nx-ai-msg--md .nx-ai-md-pre {
  margin: 0.5rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--nx-border);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.4;
}

.nx-ai-msg--md .nx-ai-md-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #a5f3fc;
}

.nx-ai-msg--md .nx-ai-md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: rgba(0, 229, 255, 0.12);
  color: #67e8f9;
}

.nx-ai-msg--sys {
  font-size: 0.78rem;
  color: var(--nx-muted);
  font-style: italic;
}

.nx-ai-input-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.nx-ai-input-row textarea {
  flex: 1;
  resize: vertical;
  min-height: 52px;
  max-height: 140px;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--nx-text);
  font-family: inherit;
  font-size: 0.84rem;
  padding: 0.45rem 0.55rem;
}

.nx-ai-input-row textarea:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.35);
}

.nx-ai-send {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  background: linear-gradient(135deg, rgba(0, 184, 212, 0.35), rgba(0, 229, 255, 0.25));
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--nx-accent);
}

.nx-ai-cmd {
  padding: 0.4rem 0.45rem;
  font-size: 0.74rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--nx-text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.nx-ai-cmd:hover {
  border-color: rgba(0, 229, 255, 0.35);
  color: var(--nx-accent);
}

.nx-ai-task-list--aside {
  max-height: 160px;
  overflow-y: auto;
  padding: 0.45rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--nx-border);
  font-size: 0.7rem;
  line-height: 1.35;
}

.nx-ai-task-row {
  margin-bottom: 0.35rem;
  color: var(--nx-muted);
  word-break: break-word;
}

.nx-ai-task-manage {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.nx-ai-task-card {
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.45rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.18);
}

.nx-ai-task-card-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nx-text);
  margin-bottom: 0.25rem;
}

.nx-ai-task-card-meta {
  font-size: 0.7rem;
  color: var(--nx-muted);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.nx-ai-task-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nx-ai-status {
  font-size: 0.76rem;
  line-height: 1.45;
}

.nx-ai-status p {
  margin: 0.15rem 0;
}

.nx-ai-k {
  color: var(--nx-muted);
  margin-right: 0.35rem;
}

.nx-ai-muted {
  color: var(--nx-muted);
  font-size: 0.76rem;
}

.nx-ai-ok {
  color: #4ade80;
}

.nx-ai-warn {
  color: #fbbf24;
}

.nx-ai-logs--aside {
  margin-top: 0;
  max-height: 140px;
  padding: 0.45rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--nx-border);
  overflow-y: auto;
  font-size: 0.68rem;
}

.nx-ai-log-line {
  margin-bottom: 0.35rem;
  color: var(--nx-muted);
}

.nx-ai-console-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.nx-ai-console-filter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--nx-muted);
}

.nx-ai-select--sm {
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  max-width: 7rem;
}

.nx-btn--xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
}

.nx-ai-console-log {
  flex: 1;
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.4rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--nx-border);
  font-size: 0.65rem;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.nx-ai-console-line--warn {
  color: #fbbf24;
}

.nx-ai-console-line--error {
  color: #f87171;
}

.nx-ai-console-line--info {
  color: #94a3b8;
}

.nx-ai-refresh {
  margin-top: 0.45rem;
  width: 100%;
  font-size: 0.74rem;
  padding: 0.4rem;
}

@media (max-width: 900px) {
  .nx-ai-panel--hub {
    width: 100%;
    height: min(calc(100vh - 1rem), 900px);
    max-height: min(calc(100vh - 1rem), 900px);
    height: min(calc(100dvh - 1rem), 900px);
    max-height: min(calc(100dvh - 1rem), 900px);
  }

  .nx-ai-hub-body {
    flex-direction: column;
  }

  .nx-ai-hub-main {
    flex: 1 1 auto;
    max-width: none;
    border-right: 0;
    border-bottom: 1px solid var(--nx-border);
    min-height: 320px;
    min-height: min(320px, 40dvh);
  }

  .nx-ai-hub-aside {
    flex: 0 0 auto;
    max-width: none;
    max-height: min(42vh, 360px);
    max-height: min(42dvh, 360px);
    overflow-y: auto;
  }

  .nx-ai-messages--hub {
    min-height: 100px;
  }

  .nx-ai-tab-pane--chat {
    gap: 0.45rem;
  }

  .nx-ai-chat-history-wrap {
    flex: 1 1 50%;
  }

  .nx-ai-quick-panel {
    flex: 1 1 50%;
    min-height: 210px;
  }

  .nx-ai-quick-group {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 6.5rem;
  }
}

@media (max-width: 560px) {
  .nx-ai-quick-panel {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .nx-ai-input-row--quick-top textarea {
    min-height: 46px;
    max-height: 110px;
  }
}

/* ----- NexusMind 中央记忆库（左下角 M，复用 NexusAI 壳层与面板尺寸） ----- */
.nx-mind-dock-root {
  position: fixed;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 898; /* M < E < AI，且低于系统弹窗 1000 */
  font-family: var(--nx-font);
}

/* ----- Nexus Evolution（底部居中 E，与 M / AI 同壳） ----- */
/* 禁止对根节点使用 transform：否则子级 position:fixed 的 .nx-ai-shell 会相对该窄盒子定位，整屏遮罩变成一条竖带 */
.nx-evo-dock-root {
  position: fixed;
  left: calc(50% - 28px);
  bottom: 1.1rem;
  width: 56px;
  height: 56px;
  z-index: 899;
  font-family: var(--nx-font);
  pointer-events: none;
}

.nx-evo-dock-root .nx-ai-fab {
  pointer-events: auto;
}

/* 根节点 pointer-events:none 时，确保打开后的全屏壳仍可点击（避免部分浏览器不穿透到子级） */
.nx-evo-dock-root .nx-ai-shell:not([hidden]) {
  pointer-events: auto;
}

.nx-evo-fab-letter {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--nx-text);
  text-shadow: 0 0 14px var(--nx-glow);
}

.nx-evo-panel.nx-ai-panel--hub {
  display: flex;
  flex-direction: column;
}

.nx-evo-hub-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.nx-evo-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nx-evo-hero-mark {
  color: var(--nx-accent);
  text-shadow: 0 0 12px var(--nx-glow);
}

.nx-evo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.nx-evo-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  color: var(--nx-muted);
}

.nx-evo-field .nx-ai-input {
  font-size: 0.82rem;
}

.nx-evo-pre {
  margin: 0;
  padding: 0.5rem 0.55rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.68rem;
  line-height: 1.4;
  max-height: 200px;
  overflow: auto;
  color: var(--nx-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.nx-evo-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}

.nx-evo-event-row {
  padding: 0.45rem 0.5rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.72rem;
}

.nx-evo-ev-type {
  display: block;
  font-weight: 600;
  color: var(--nx-accent);
  margin-bottom: 0.15rem;
}

.nx-evo-ev-meta {
  color: var(--nx-muted);
  font-size: 0.68rem;
}

.nx-evo-ev-preview {
  margin-top: 0.35rem;
  color: var(--nx-text);
  font-size: 0.7rem;
  opacity: 0.92;
}

.nx-evo-os {
  margin-top: 0.35rem;
}

.nx-evo-os-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.nx-evo-os-label {
  font-size: 0.72rem;
  color: var(--nx-muted);
  min-width: 4.2rem;
}

.nx-evo-os-select {
  flex: 1;
  min-width: 120px;
  max-width: 220px;
}

.nx-evo-pre--sm {
  max-height: 160px;
  margin-top: 0.35rem;
}

.nx-evo-reflect-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}

.nx-evo-reflect-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.25rem 0.15rem;
  border-radius: var(--nx-radius-sm);
}

.nx-evo-reflect-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nx-evo-reflect-meta {
  color: var(--nx-text);
  opacity: 0.9;
}

@media (max-width: 520px) {
  .nx-evo-dock-root {
    bottom: 4.5rem;
    left: calc(50% - 28px);
  }
}

.nx-mind-fab-letter {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0;
}

.nx-mind-panel.nx-ai-panel--hub {
  display: flex;
  flex-direction: column;
}

.nx-mind-hub-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.nx-mind-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nx-mind-hero {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.nx-mind-hero-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--nx-accent);
  text-shadow: 0 0 12px var(--nx-glow);
  flex-shrink: 0;
  background: rgba(0, 229, 255, 0.06);
}

.nx-mind-hero-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nx-text);
}

.nx-mind-hero-sub {
  margin: 0;
  font-size: 0.76rem;
  color: var(--nx-muted);
  line-height: 1.45;
}

.nx-mind-search-block {
  margin-top: 0.65rem;
  margin-bottom: 0.45rem;
}

.nx-mind-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--nx-muted);
  line-height: 1.45;
}

.nx-mind-hint--sm {
  font-size: 0.68rem;
  opacity: 0.95;
}

.nx-mind-hint--quick {
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}

.nx-mind-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.nx-mind-pager-info {
  font-size: 0.72rem;
  color: var(--nx-muted);
  flex: 1;
  min-width: 140px;
}

.nx-mind-pager-core-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nx-mind-model-select {
  min-width: 6.9rem;
  max-width: 8.5rem;
  font-size: 0.72rem;
  padding: 0.22rem 0.4rem;
}

.nx-mind-btn-danger {
  color: #f87171 !important;
}

.nx-mind-card-check {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  cursor: pointer;
}

.nx-mind-card-check input[type='checkbox'] {
  accent-color: #00e5ff;
}

.nx-mind-btn-block {
  width: 100%;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.nx-mind-row--checks {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.35rem;
}

.nx-mind-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--nx-muted);
  cursor: pointer;
}

.nx-mind-check input {
  accent-color: var(--nx-accent);
}

.nx-mind-section {
  padding: 0.65rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.18);
}

.nx-mind-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nx-accent);
}

.nx-mind-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.nx-mind-search-row .nx-ai-input {
  flex: 1;
}

.nx-mind-textarea {
  width: 100%;
  min-height: 88px;
  padding: 0.5rem 0.55rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--nx-text);
  font-family: inherit;
  font-size: 0.82rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.nx-mind-textarea:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.35);
}

.nx-mind-textarea--edit {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.nx-mind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* 快速保存 / 上传：分区 + 输入 + 按钮，统一高度与对齐 */
.nx-mind-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.nx-mind-field-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--nx-muted);
  line-height: 1.2;
}

.nx-mind-input-control {
  width: 100%;
  min-height: 2.45rem;
  box-sizing: border-box;
  border-radius: var(--nx-radius-sm);
  font-size: 0.8rem;
}

select.nx-mind-input-control {
  padding: 0.35rem 0.45rem;
  cursor: pointer;
}

input.nx-mind-input-control {
  padding: 0.42rem 0.5rem;
}

.nx-mind-toolbar--quick {
  display: grid;
  grid-template-columns: minmax(5.25rem, 7rem) minmax(5.25rem, 7.5rem) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.5rem 0.6rem;
  margin-top: 0.35rem;
}

.nx-mind-toolbar--quick .nx-mind-field--folder {
  grid-column: 1;
  grid-row: 1;
}

.nx-mind-toolbar--quick .nx-mind-field--project {
  grid-column: 2;
  grid-row: 1;
}

.nx-mind-toolbar--quick .nx-mind-field--title {
  grid-column: 3;
  grid-row: 1;
}

.nx-mind-toolbar--quick .nx-mind-btn-action {
  grid-column: 1 / -1;
  grid-row: 2;
}

.nx-mind-toolbar--upload {
  display: grid;
  grid-template-columns: minmax(5.25rem, 7rem) minmax(5.25rem, 7.5rem) minmax(0, 1fr);
  gap: 0.5rem 0.6rem;
  align-items: end;
  margin-top: 0.35rem;
}

.nx-mind-toolbar--upload .nx-mind-field--folder {
  grid-column: 1;
}

.nx-mind-toolbar--upload .nx-mind-field--project {
  grid-column: 2;
}

.nx-mind-upload-actions {
  grid-column: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
}

.nx-mind-upload-actions .nx-mind-btn-action {
  flex: 1 1 auto;
  min-width: 6.25rem;
}

.nx-mind-upload-actions .nx-mind-btn-action--primary {
  flex: 1.35 1 10rem;
  min-width: 7rem;
}

.nx-mind-btn-action.nx-btn {
  min-height: 2.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--nx-radius-sm);
}

.nx-mind-project-wrap {
  position: relative;
  min-width: 0;
}

button.nx-mind-project-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--nx-text);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.25);
}

button.nx-mind-project-trigger:hover {
  border-color: rgba(0, 229, 255, 0.28);
}

.nx-mind-project-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  z-index: 20;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(12, 18, 28, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  min-width: 9rem;
}

.nx-mind-project-pop-scroll {
  max-height: 11rem;
  overflow-y: auto;
}

.nx-mind-project-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.42rem 0.55rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--nx-text);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}

.nx-mind-project-opt:hover {
  background: rgba(0, 229, 255, 0.08);
}

.nx-mind-project-opt--active {
  color: var(--nx-accent);
}

.nx-mind-project-newbtn {
  display: block;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: none;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(0, 229, 255, 0.07);
  color: var(--nx-accent);
  font-size: 0.74rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.nx-mind-project-newbtn:hover {
  background: rgba(0, 229, 255, 0.12);
}

.nx-mind-project-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.nx-mind-project-modal[hidden] {
  display: none !important;
}

.nx-mind-project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.nx-mind-project-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
}

.nx-mind-project-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--nx-accent);
}

.nx-mind-project-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

@media (max-width: 480px) {
  .nx-mind-toolbar--quick {
    grid-template-columns: 1fr;
  }

  .nx-mind-toolbar--quick .nx-mind-field--folder,
  .nx-mind-toolbar--quick .nx-mind-field--project,
  .nx-mind-toolbar--quick .nx-mind-field--title,
  .nx-mind-toolbar--quick .nx-mind-btn-action {
    grid-column: 1;
    grid-row: auto;
  }

  .nx-mind-toolbar--upload {
    grid-template-columns: 1fr;
  }

  .nx-mind-toolbar--upload .nx-mind-field--project {
    grid-column: 1;
  }

  .nx-mind-toolbar--upload .nx-mind-upload-actions {
    grid-column: 1;
    justify-content: stretch;
    flex-direction: column;
  }

  .nx-mind-upload-actions .nx-mind-btn-action,
  .nx-mind-upload-actions .nx-mind-btn-action--primary {
    flex: none;
    width: 100%;
    min-width: 0;
  }
}

.nx-mind-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--nx-muted);
  min-width: 140px;
  flex: 1;
}

.nx-mind-select {
  width: 100%;
}

.nx-mind-title-input {
  flex: 2;
  min-width: 160px;
}

.nx-mind-drop {
  border: 1px dashed rgba(0, 229, 255, 0.35);
  border-radius: var(--nx-radius-sm);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.nx-mind-drop--hover,
.nx-mind-drop:hover {
  background: rgba(0, 229, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.5);
}

.nx-mind-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.nx-mind-drop-text {
  font-size: 0.8rem;
  color: var(--nx-muted);
}

.nx-mind-file-queue {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  max-height: 11rem;
  overflow-y: auto;
}

.nx-mind-queue-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.55rem;
  border-radius: var(--nx-radius-sm);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.12);
  font-size: 0.78rem;
}

.nx-mind-queue-name {
  flex: 1;
  min-width: 120px;
  color: var(--nx-text, #e8f4ff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-mind-queue-meta {
  color: var(--nx-muted);
  font-variant-numeric: tabular-nums;
}

.nx-mind-queue-status {
  margin-left: auto;
  color: var(--nx-muted);
  font-size: 0.72rem;
}

.nx-mind-queue-status--ok {
  color: rgba(0, 255, 180, 0.85);
}

.nx-mind-queue-status--err {
  color: rgba(255, 120, 120, 0.9);
}

.nx-mind-list-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.nx-mind-folder-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nx-mind-pill {
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  border-radius: 999px;
  border: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--nx-muted);
  cursor: pointer;
  font-family: inherit;
}

.nx-mind-pill--active {
  border-color: rgba(0, 229, 255, 0.45);
  color: var(--nx-accent);
  background: rgba(0, 229, 255, 0.08);
}

.nx-mind-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.nx-mind-select-wide {
  min-width: 120px;
  max-width: 160px;
}

.nx-mind-list-toolbar .nx-ai-input {
  flex: 1;
  min-width: 140px;
}

.nx-mind-status {
  font-size: 0.72rem;
  min-height: 1.2em;
  margin: 0 0 0.45rem;
  color: var(--nx-muted);
}

.nx-mind-status--ok {
  color: #4ade80;
}

.nx-mind-status--err {
  color: #f87171;
}

.nx-mind-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nx-mind-muted {
  color: var(--nx-muted);
  font-size: 0.78rem;
}

.nx-mind-key {
  font-size: 0.68rem;
  color: var(--nx-muted);
  word-break: break-all;
}

.nx-mind-card {
  padding: 0.55rem 0.65rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.22);
}

.nx-mind-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.nx-mind-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nx-text);
  word-break: break-word;
}

.nx-mind-card-tag {
  font-size: 0.65rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.12);
  color: #67e8f9;
  flex-shrink: 0;
}

.nx-mind-card-tag--core {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.nx-mind-card-tag--know {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.nx-mind-card-tag--chat {
  background: rgba(147, 197, 253, 0.12);
  color: #93c5fd;
}

.nx-mind-card-meta {
  font-size: 0.68rem;
  color: var(--nx-muted);
  line-height: 1.35;
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.nx-mind-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nx-btn--sm {
  padding: 0.32rem 0.55rem;
  font-size: 0.74rem;
}

.nx-mind-editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow-y: auto;
}

.nx-mind-editor-overlay[hidden] {
  display: none !important;
}

.nx-mind-editor-card {
  width: min(100%, 640px);
  max-height: min(90%, 620px);
  display: flex;
  flex-direction: column;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  padding: 0.65rem 0.75rem 0.85rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.nx-mind-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--nx-accent);
}

.nx-mind-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.nx-ai-config-backdrop {
  position: fixed;
  inset: 0;
  /* 高于 Dock(~900)，低于全站弹窗(1000)，避免压住系统/账户二级界面 */
  z-index: 990;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.nx-ai-config-backdrop[hidden] {
  display: none !important;
}

.nx-ai-config-modal {
  width: min(100%, 400px);
  max-height: min(90vh, 520px);
  overflow: auto;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.nx-ai-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--nx-border);
}

.nx-ai-config-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--nx-accent);
}

.nx-ai-config-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nx-ai-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--nx-muted);
}

.nx-ai-field span {
  font-weight: 600;
}

.nx-ai-select,
.nx-ai-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--nx-text);
  font-size: 0.8rem;
}

.nx-ai-config-hint {
  margin: 0;
}

.nx-ai-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.nx-ai-config-msg {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.72rem;
}

.nx-ai-panel-foot {
  padding: 0.45rem 0.85rem 0.65rem;
  border-top: 1px solid var(--nx-border);
}

.nx-ai-link {
  font-size: 0.76rem;
  color: var(--nx-accent);
  text-decoration: none;
}

.nx-ai-link:hover {
  text-decoration: underline;
}

/* 本地执行端行 + 手动 Core API Key 二级弹窗（高于模型配置层 990） */
.nx-ai-status-hand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0;
}

.nx-ai-status-hand-main {
  min-width: 0;
  flex: 1;
}

.nx-ai-handkey-open {
  flex-shrink: 0;
  font-size: 0.65rem !important;
  padding: 0.22rem 0.45rem !important;
  line-height: 1.2;
  white-space: nowrap;
}

.nx-ai-handkey-backdrop {
  position: fixed;
  inset: 0;
  z-index: 995;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.nx-ai-handkey-backdrop[hidden] {
  display: none !important;
}

.nx-ai-handkey-modal {
  width: min(100%, 400px);
  max-height: min(88vh, 560px);
  overflow: auto;
  border-radius: var(--nx-radius);
  border: 1px solid rgba(0, 229, 255, 0.22);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  padding: 0;
}

.nx-ai-plan-topic-modal {
  width: min(100%, 430px);
}

.nx-ai-handkey-step--sub {
  border-top: 1px solid var(--nx-border);
}

.nx-ai-handkey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--nx-border);
}

.nx-ai-handkey-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--nx-accent);
}

.nx-ai-handkey-title--sub {
  font-size: 0.88rem;
  font-weight: 600;
}

.nx-ai-handkey-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nx-ai-handkey-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
}

.nx-ai-handkey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.nx-ai-handkey-test-msg {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--nx-text);
}
