/* 软件导航 - 腾讯软件中心风格；按视口自适应列数 */
:root {
  --ns-blue: #0052d9;
  --ns-blue-soft: #e8f3ff;
  --ns-text: #1a1a1a;
  --ns-muted: #8a8a8a;
  --ns-bg: #f5f6f8;
  --ns-card: #ffffff;
  --ns-radius: 10px;
  --ns-gap: 14px;
  --ns-icon: 48px;
  --ns-card-pad: 12px 14px;
  --ns-col-min: 220px;
}

.navsoft-page,
.navsoft-wrap { box-sizing: border-box; }
.navsoft-page *,
.navsoft-page *::before,
.navsoft-page *::after { box-sizing: border-box; }

/* 嵌入主题时只改内容区，不覆盖站点顶栏/页脚 */
.navsoft-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--ns-bg);
  color: var(--ns-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: 12px;
  padding-bottom: 24px;
  width: 100%;
  max-width: min(1280px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.navsoft-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 20px;
}

.navsoft-header {
  background: #fff;
  border-radius: var(--ns-radius);
  padding: 14px 16px 10px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.navsoft-brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.navsoft-brand h1 {
  margin: 0 0 8px;
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 700;
  color: #111;
}
.navsoft-home {
  color: var(--ns-muted);
  text-decoration: none;
  font-size: 13px;
}
.navsoft-home:hover { color: var(--ns-blue); }

/* 固定文字横排分类（非方块按钮） */
.navsoft-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  row-gap: 6px;
  padding: 2px 0 8px;
  overflow: visible;
}
.navsoft-cat {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
  background: none !important;
  box-shadow: none !important;
  color: #333;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  padding: 2px 14px 2px 0;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0;
}
.navsoft-cat:hover {
  color: var(--ns-blue);
  background: none !important;
}
.navsoft-cat.is-active {
  color: var(--ns-blue);
  font-weight: 500;
  background: none !important;
}


/* 一级分组（二级导航）：与分类同样的纯文字横排，选中蓝字 */
.navsoft-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 6px;
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0f1f3;
}
.navsoft-group {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0;
  color: #333;
  font-size: clamp(15px, 1.5vw, 16px);
  font-weight: 500;
  line-height: 1.4;
  padding: 2px 20px 2px 0;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}
.navsoft-group:hover { color: var(--ns-blue); }
.navsoft-group.is-active { color: var(--ns-blue); font-weight: 600; }
.navsoft-group:focus-visible,
.navsoft-cat:focus-visible { outline: 2px solid var(--ns-blue); outline-offset: 2px; }

/* 卡片网格：按可用宽度自动列数（适配安装用户屏幕） */
.navsoft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ns-col-min), 1fr));
  gap: var(--ns-gap);
}
@media (max-width: 640px) {
  :root { --ns-col-min: 160px; --ns-gap: 10px; --ns-icon: 42px; --ns-card-pad: 10px 12px; }
  .navsoft-wrap { padding: 0 8px 16px; }
}
@media (max-width: 400px) {
  :root { --ns-col-min: 100%; }
}

/* 卡片：左图标 + 右标题/简介（无动效） */
.navsoft-card {
  background: var(--ns-card);
  border-radius: var(--ns-radius);
  padding: var(--ns-card-pad);
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  min-height: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.navsoft-card:focus-visible {
  outline: 2px solid var(--ns-blue);
  outline-offset: 2px;
}
.navsoft-icon {
  width: var(--ns-icon);
  height: var(--ns-icon);
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8f0fe;
  display: block;
}
/* 无图/裂图：首字色块（腾讯软件中心式） */
.navsoft-icon--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--ns-icon) * 0.4);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  user-select: none;
  object-fit: unset;
}
.navsoft-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: var(--ns-icon);
}
.navsoft-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ns-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.navsoft-intro {
  margin: 0;
  font-size: 12px;
  color: var(--ns-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.navsoft-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  min-height: 0;
}
.navsoft-more-wrap:not([hidden]) {
  min-height: 40px;
}
.navsoft-page .navsoft-more,
.navsoft-page .navsoft-more:focus,
.navsoft-page .navsoft-more:active {
  box-shadow: none !important;
  outline: none;
}
.navsoft-page .navsoft-more:focus-visible {
  outline: 2px solid var(--ns-blue);
  outline-offset: 2px;
}
/* 覆盖 display，避免 hidden 失效导致无更多时仍显示「加载更多」 */
.navsoft-page [hidden],
.navsoft-more[hidden],
.navsoft-loading[hidden],
.navsoft-empty[hidden],
.navsoft-more-wrap[hidden] {
  display: none !important;
}
.navsoft-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.navsoft-more:hover {
  background: transparent;
  color: var(--ns-blue);
}
.navsoft-loading {
  color: var(--ns-muted);
  font-size: 13px;
  padding: 10px;
}
.navsoft-empty {
  text-align: center;
  color: var(--ns-muted);
  padding: 48px 16px;
  background: #fff;
  border-radius: var(--ns-radius);
}
.navsoft-footer {
  text-align: center;
  margin-top: 28px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--ns-muted);
}
.navsoft-footer a { color: var(--ns-muted); text-decoration: none; }
.navsoft-footer a:hover { color: var(--ns-blue); }

/* 单独单页（不显示其他导航） */
body.navsoft-solo {
  margin: 0;
  background: var(--ns-bg);
  min-height: 100vh;
  min-height: 100dvh;
}
.navsoft-page--solo {
  width: 100%;
  max-width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px) clamp(12px, 2.5vw, 24px) 8px;
}
.navsoft-wrap--solo .navsoft-brand {
  justify-content: space-between;
  width: 100%;
}

/* 主区 + 热门侧栏 */
.navsoft-body {
  display: block;
}
.navsoft-wrap--hot .navsoft-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .navsoft-wrap--hot .navsoft-body {
    grid-template-columns: 1fr;
  }
}
.navsoft-hot {
  background: #fff;
  border-radius: var(--ns-radius);
  padding: 12px 14px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.navsoft-hot-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}
.navsoft-hot-empty {
  margin: 0;
  font-size: 13px;
  color: var(--ns-muted);
  padding: 8px 0 12px;
}
.navsoft-hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.navsoft-hot-list li {
  margin: 0;
  padding: 0;
  border-top: 1px solid #f0f1f3;
}
.navsoft-hot-list li:first-child { border-top: 0; }
.navsoft-hot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  text-decoration: none;
  color: inherit;
}
.navsoft-hot-item:hover .navsoft-hot-name { color: var(--ns-blue); }
.navsoft-hot-rank {
  flex: 0 0 20px;
  width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ns-muted);
}
.navsoft-hot-list li:nth-child(1) .navsoft-hot-rank,
.navsoft-hot-list li:nth-child(2) .navsoft-hot-rank,
.navsoft-hot-list li:nth-child(3) .navsoft-hot-rank {
  color: var(--ns-blue);
}
.navsoft-hot-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navsoft-hot-clicks {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--ns-muted);
}
.navsoft-page .navsoft-hot-empty[hidden] {
  display: none !important;
}
