/* =========================================================
 * 渗透师导航站 · 深色玻璃拟态风格
 * 靛蓝/青色发光渐变 + 磨砂玻璃卡片 + 左侧分类竖牌
 * ========================================================= */

:root {
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --accent-300: #67e8f9;
  --accent-400: #22d3ee;
  --bg-0: #070a14;
  --bg-1: #0d1120;
  --glass: rgba(17, 22, 43, 0.55);
  --glass-strong: rgba(20, 26, 50, 0.78);
  --glass-border: rgba(148, 163, 184, 0.12);
  --glass-border-hi: rgba(148, 163, 184, 0.22);
  --text-1: #e8ecf5;
  --text-2: #9aa7c0;
  --text-3: #5b6782;
  --shadow-card: 0 12px 34px -12px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 8px 30px -6px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(99, 102, 241, 0.22);
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-text: linear-gradient(135deg, #a5b4fc 0%, #67e8f9 50%, #818cf8 100%);
}

html { scrollbar-gutter: stable; overflow-y: scroll; scroll-behavior: smooth; }
* { scrollbar-width: thin; scrollbar-color: rgba(99,102,241,.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(99,102,241,.35); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

body.nav-body {
  margin: 0;
  background:
    radial-gradient(1100px 650px at 8% -8%, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(900px 600px at 95% -5%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(99, 102, 241, 0.10), transparent 60%),
    var(--bg-0);
  color: var(--text-1);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(99, 102, 241, .35); }

.nav-wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; width: 100%; }

/* ============ 顶部导航栏 ============ */
.nav-top {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(7, 10, 20, 0.72);
  border-bottom: 1px solid var(--glass-border);
}
.nav-top .nav-wrap { display: flex; align-items: center; height: 70px; gap: 14px; }

.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: 14px; flex-shrink: 0; }
.nav-logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 11px; font-size: 18px;
  background: var(--grad-brand);
  box-shadow: 0 6px 18px -2px rgba(99, 102, 241, 0.65);
}
.nav-logo-text {
  font-size: 17px; font-weight: 800; letter-spacing: .02em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}

.nav-menu { display: flex; align-items: center; gap: 6px; flex: 1; overflow-x: auto; }
.nav-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  text-decoration: none; border: 1px solid transparent;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.nav-item:hover { color: var(--text-1); background: rgba(255, 255, 255, .05); border-color: var(--glass-border-hi); }
.nav-item-active {
  color: var(--brand-300);
  background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(34, 211, 238, .14));
  border-color: rgba(99, 102, 241, .4);
  box-shadow: 0 0 16px -2px rgba(99, 102, 241, .4), inset 0 0 0 1px rgba(99, 102, 241, .15);
}

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--glass-border); color: var(--text-1); border-radius: 9px; padding: 6px 9px; cursor: pointer; }

/* 顶部推荐条 */
.nav-subbar { border-top: 1px solid rgba(148, 163, 184, .06); border-bottom: 1px solid var(--glass-border); background: rgba(13, 17, 32, .45); }
.nav-subbar-inner { display: flex; align-items: center; gap: 6px; padding: 7px 18px; overflow-x: auto; }
.nav-subbar-label {
  font-size: 11px; font-weight: 800; color: #0b0f1a;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #a5b4fc, #67e8f9);
  white-space: nowrap; letter-spacing: .05em;
}
.nav-subitem {
  font-size: 13px; color: var(--text-2); text-decoration: none; white-space: nowrap;
  padding: 4px 9px; border-radius: 7px;
  transition: color .15s ease, background .15s ease;
}
.nav-subitem:hover { color: var(--text-1); background: rgba(255, 255, 255, .06); }

/* ============ Hero ============ */
.nav-hero { position: relative; text-align: center; padding: 46px 18px 26px; }
.nav-hero-inner { max-width: 660px; margin: 0 auto; }
.nav-hero-title {
  font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin: 0 0 10px; letter-spacing: .02em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-hero-sub { margin: 0 0 26px; color: var(--text-2); font-size: 14px; }

.nav-search {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  max-width: 520px; margin: 0 auto;
  padding: 10px 16px; border-radius: 13px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border-hi);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: border-color .2s ease, box-shadow .2s ease;
  z-index: 70;
}
.nav-search:focus-within {
  border-color: rgba(99, 102, 241, .55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18), var(--shadow-card);
}
.nav-search-ico { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.nav-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-1); font-size: 14px; font-family: inherit;
  min-width: 0;
}
.nav-search input::placeholder { color: var(--text-3); }

/* 实时搜索下拉 */
.nav-search-drop {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  max-height: 380px; overflow-y: auto;
  background: rgba(10, 14, 28, 0.96);
  border: 1px solid var(--glass-border-hi);
  border-radius: 14px;
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, .05);
  padding: 6px;
}
.nav-search-drop[hidden] { display: none; }
.drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  text-decoration: none;
  transition: background .13s ease;
}
.drop-item:hover { background: rgba(99, 102, 241, .14); }
.drop-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  font-size: 15px; font-weight: 700; color: #fff;
  background: var(--grad-brand);
  overflow: hidden;
}
.drop-icon img { width: 100%; height: 100%; object-fit: contain; }
.drop-name {
  font-size: 13px; color: var(--text-1); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drop-none { font-size: 13px; color: var(--text-3); padding: 14px 10px; text-align: center; }

/* ============ 主区域 ============ */
.nav-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 18px 60px; box-sizing: border-box; }

/* 推荐位 */
.nav-rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 900px) { .nav-rec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .nav-rec-grid { grid-template-columns: repeat(2, 1fr); } }

.nav-rec-card {
  display: block; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)), var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-decoration: none; position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.nav-rec-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-brand); opacity: 0; transition: opacity .2s ease;
}
.nav-rec-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, .4); box-shadow: var(--shadow-glow); }
.nav-rec-card:hover::before { opacity: 1; }
.nav-rec-main { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.5; }
.nav-rec-sub { margin-top: 6px; font-size: 12px; color: var(--accent-300); }

/* ============ 布局：左侧竖牌 + 内容 ============ */
.nav-layout { display: flex; gap: 22px; align-items: flex-start; }

.nav-sidenav {
  position: sticky; top: 96px; flex-shrink: 0;
  width: 200px; max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 8px; border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.sidenav-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--text-3);
  padding: 8px 12px 6px; text-transform: uppercase;
}
.sidenav-list { display: flex; flex-direction: column; gap: 2px; }
.sidenav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidenav-item:hover { background: rgba(255, 255, 255, .05); color: var(--text-1); }
.sidenav-item.active {
  color: var(--brand-300);
  background: linear-gradient(135deg, rgba(99, 102, 241, .20), rgba(34, 211, 238, .12));
  border-color: rgba(99, 102, 241, .35);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .12);
}
.sidenav-ico { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.sidenav-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-content { flex: 1; min-width: 0; }

/* ============ 分类区块 ============ */
.nav-section { margin-bottom: 30px; scroll-margin-top: 100px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; font-size: 17px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .25), rgba(34, 211, 238, .18));
  border: 1px solid rgba(99, 102, 241, .3);
  box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .4);
}
.section-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-1); }
.section-count {
  font-size: 11px; color: var(--text-3); padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border);
}

/* ============ 网址卡片 ============ */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.nav-link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 14px; min-height: 62px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)), var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .05);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.nav-link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, .45);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, .18), 0 14px 34px -10px rgba(99, 102, 241, .4), var(--shadow-card);
}

.link-icon-wrap {
  position: relative; width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.link-icon { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; padding: 5px; box-sizing: border-box; display: block; }
.link-icon-wrap.no-icon .link-icon { display: none; }
.link-icon-fallback {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff;
  background: var(--grad-brand);
}
.link-icon-wrap:not(.no-icon) .link-icon-fallback { display: none; }

.nav-link-body { min-width: 0; flex: 1; }
.nav-link-name { font-size: 14px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link-meta { display: flex; gap: 12px; margin-top: 6px; color: var(--text-3); font-size: 11px; }
.nav-link-meta span { display: inline-flex; align-items: center; gap: 3px; }
.nav-link-meta svg { color: var(--text-3); }

.nav-empty { grid-column: 1 / -1; text-align: center; padding: 30px 0; color: var(--text-3); font-size: 13px; }

/* ============ 关于 / 友链 ============ */
.about-card {
  max-width: 680px; margin: 20px auto; padding: 26px 30px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.about-card h2 { margin: 0 0 14px; font-size: 19px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-card p { color: var(--text-2); font-size: 14px; line-height: 1.8; margin: 0 0 10px; }
.about-note { color: var(--text-3) !important; font-size: 12px !important; border-top: 1px solid var(--glass-border); padding-top: 12px; margin-top: 14px !important; }
.friends-note { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 0; }

/* ============ 页脚 ============ */
.nav-footer { border-top: 1px solid var(--glass-border); background: rgba(7, 10, 20, .5); padding: 24px 0; text-align: center; }
.nav-footer p { margin: 4px 0; color: var(--text-2); font-size: 13px; }
.nav-footer-sub { color: var(--text-3) !important; font-size: 12px; }
.nav-beian { color: var(--text-3); text-decoration: none; }
.nav-beian:hover { color: var(--accent-300); }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .nav-layout { flex-direction: column; }
  .nav-sidenav {
    position: static; width: 100%; max-height: none;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    padding: 10px;
  }
  .sidenav-title { display: none; }
  .sidenav-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidenav-item { padding: 6px 11px; font-size: 12px; }
  .sidenav-ico { width: 18px; font-size: 13px; }
}

@media (max-width: 860px) {
  .nav-menu {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(7, 10, 20, .96); border-bottom: 1px solid var(--glass-border);
    padding: 10px 16px; gap: 4px; display: none;
  }
  .nav-menu-open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav-item { padding: 11px 12px; }
}

@media (max-width: 520px) {
  .nav-grid { grid-template-columns: 1fr; }
  .nav-rec-grid { grid-template-columns: 1fr; }
  .nav-hero { padding-top: 34px; }
}