/* ============================================================
   Sulinlan Nav · 导航站设计系统（深空科技风 v2）
   2026-08 重构：分层渲染 + 霓虹发光 + 毛玻璃 + 扫光动效
   兼容 detail 页内联样式（保留全部 v1 变量名）
   ============================================================ */
:root {
  --bg: #05070f;
  --bg-soft: #0a0f1e;
  --surface: rgba(16, 22, 40, .68);
  --surface-solid: #101628;
  --surface-2: #1a2340;
  --border: rgba(148, 163, 184, .16);
  --border-hi: rgba(148, 163, 184, .32);
  --text: #e8edf7;
  --text-dim: #9aa7bd;
  --text-faint: #5f6c84;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px rgba(2, 6, 23, .55);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, .35), 0 18px 50px rgba(99, 102, 241, .22);
  --tr: .28s cubic-bezier(.4, 0, .2, 1);
  --tr-slow: .5s cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, .10), transparent 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 网格背景层 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

/* 光晕层 */
.bg-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
.bg-glow-1 {
  width: 560px; height: 560px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, .30), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-glow-2 {
  width: 480px; height: 480px;
  bottom: -160px; left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, .20), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.12); }
}

/* ============ 布局 ============ */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 16px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 18, 34, .88), rgba(8, 11, 22, .55));
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 20px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .5px;
}
.sidebar-brand .logo {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(99, 102, 241, .45), 0 0 20px rgba(99, 102, 241, .35);
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(99, 102, 241, .45), 0 0 20px rgba(99, 102, 241, .35); }
  50%      { box-shadow: 0 8px 28px rgba(139, 92, 246, .5), 0 0 34px rgba(139, 92, 246, .45); }
}
.sidebar-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  padding: 6px 10px 10px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: .92rem;
  border-left: 3px solid transparent;
  transition: var(--tr);
  cursor: pointer;
  user-select: none;
}
.sidebar-item .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: var(--tr);
  flex-shrink: 0;
}
.sidebar-item:hover {
  background: rgba(99, 102, 241, .1);
  color: var(--text);
  transform: translateX(4px);
}
.sidebar-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .25), rgba(139, 92, 246, .08));
  border-left-color: var(--accent);
}
.sidebar-item.active .dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 22px rgba(99, 102, 241, .6);
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px 4px;
  border-top: 1px solid var(--border);
}
.sb-clock {
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.sb-clock::before { content: "● "; color: var(--ok); font-size: .6rem; vertical-align: 1px; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.sb-meta { font-size: .72rem; color: var(--text-faint); margin-top: 4px; }

/* ============ 主内容 ============ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 36px 44px 80px;
}
.site-header { padding: 8px 0 6px; }
.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(90deg, #e8edf7, #a5b4fc 55%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.site-desc { color: var(--text-dim); margin-top: 6px; font-size: .98rem; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}
.clock {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.btn-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
  transition: var(--tr);
}
.btn-shuffle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, .5), 0 0 24px rgba(139, 92, 246, .3);
}
.btn-shuffle:active { transform: translateY(0) scale(.97); }

/* ============ 搜索 ============ */
.search-bar { margin: 26px 0 4px; position: relative; }
.search-bar input {
  width: 100%;
  padding: 17px 72px 17px 52px;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  backdrop-filter: blur(10px);
  transition: var(--tr);
}
.search-bar input::placeholder { color: var(--text-faint); }
.search-bar input:focus {
  border-color: transparent;
  background: rgba(18, 25, 44, .92);
  box-shadow: 0 0 0 1px var(--accent), 0 0 32px rgba(99, 102, 241, .35), 0 18px 40px rgba(2, 6, 23, .5);
}
.search-bar .search-ico {
  position: absolute;
  left: 19px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1.15rem;
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 7px;
  padding: 3px 9px;
  pointer-events: none;
}
.search-meta {
  min-height: 22px;
  padding: 8px 6px 0;
  font-size: .8rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ============ 分类区块 ============ */
.category-block { margin-bottom: 46px; scroll-margin-top: 28px; }
.category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.category-title .cat-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .3);
}
.category-title::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 4px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}

/* 子分类 chips */
.sub-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sub-chip {
  padding: 7px 14px;
  font-size: .84rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--tr);
  user-select: none;
}
.sub-chip .count {
  opacity: .55;
  margin-left: 4px;
  font-size: .76rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.sub-chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.sub-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .4);
}

/* 子分类内容（折叠动画） */
.sub-content { margin-bottom: 26px; }
.sub-content.hidden { display: none; }
.sub-content-title {
  font-size: .98rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-content-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 分类懒加载占位 */
.cat-placeholder { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ============ 链接卡片网格 ============ */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, rgba(99,102,241,.55), rgba(34,211,238,.35)) border-box;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: var(--tr);
  position: relative;
  overflow: hidden;
}
/* 斜向扫光 */
.link-card::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 50%;
  height: 220%;
  transform: rotate(20deg) translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
  transition: transform .9s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(99,102,241,.14), rgba(34,211,238,.08));
  opacity: 0;
  transition: var(--tr);
  pointer-events: none;
}
.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, .35), 0 18px 44px rgba(2, 6, 23, .6), 0 0 30px rgba(99, 102, 241, .18);
}
.link-card:hover::before { opacity: 1; }
.link-card:hover::after { transform: rotate(20deg) translateX(420%); }
.link-card .lc-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  transition: var(--tr);
}
.link-card .lc-favicon {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8px;
  background: var(--surface-solid);
  display: block;
}
.link-card:hover .lc-icon { transform: scale(1.08) rotate(-4deg); }
.link-card .lc-body { min-width: 0; flex: 1; }
.link-card .lc-name {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}
.link-card .lc-desc {
  font-size: .8rem;
  color: var(--text-faint);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card .lc-arrow {
  color: var(--text-faint);
  transition: var(--tr);
  flex-shrink: 0;
  font-size: .9rem;
}
.link-card:hover .lc-arrow {
  color: var(--accent);
  transform: translateX(4px);
}
/* 健康角标 */
.health-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  top: 10px; right: 10px;
  box-shadow: 0 0 8px currentColor;
}
.health-dot.up { background: var(--ok); color: var(--ok); }
.health-dot.down { background: var(--bad); color: var(--bad); }
.health-dot.timeout { background: var(--warn); color: var(--warn); }
.link-card.is-down { opacity: .55; }
.link-card.is-down .lc-name { text-decoration: line-through; }

/* 高亮关键词 */
mark {
  background: rgba(139, 92, 246, .35);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}

/* ============ 骨架屏 ============ */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.skeleton {
  height: 78px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface-solid) 40%, var(--surface-2) 50%, var(--surface-solid) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

/* ============ 滚动渐入（stagger） ============ */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-stagger {
  opacity: 0;
  transform: translateY(18px);
}
.reveal-stagger.visible {
  opacity: 1;
  transform: none;
}

/* ============ 状态/空态 ============ */
.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 60px 0;
  font-size: .95rem;
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 12px; }
.loading-tip {
  text-align: center;
  color: var(--text-faint);
  padding: 30px 0;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { padding: 4px 10px; }
  .sidebar-label, .sidebar-footer { display: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-item { padding: 7px 12px; border-left: none; }
  .main-content { padding: 26px 18px 60px; }
  .site-title { font-size: 1.7rem; }
  .header-actions { width: 100%; justify-content: space-between; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #26304e; }
::-webkit-scrollbar-track { background: transparent; }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
