/* =========== 设计狮导航 - 新首页样式 =========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #333; }

a { color: #333; text-decoration: none; }
a:hover { color: #007bff; }
img { max-width: 100%; vertical-align: middle; }

/* =========== 顶部栏 =========== */
.home-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.home-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.home-header .logo a {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}
.home-header .logo img { height: 36px; }
.home-header .search-box {
  flex: 1;
  max-width: 500px;
  display: flex;
}
.home-header .search-box input {
  flex: 1;
  height: 38px;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.home-header .search-box input:focus { border-color: #007bff; }
.home-header .search-box button {
  height: 38px;
  padding: 0 18px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  cursor: pointer;
}
.home-header .search-box button:hover { background: #0056b3; }

/* =========== 主布局 =========== */
.home-main {
  margin: 16px auto 40px;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  max-width: 1400px;
}

/* =========== 左侧栏 =========== */
.home-sidebar {
  width: 350px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 16px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  align-self: flex-start;
  position: sticky;
  top: 76px;
}
.home-sidebar h3 {
  font-size: 14px;
  color: #999;
  padding: 0 16px 12px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}
.home-sidebar ul { list-style: none; }
.home-sidebar li a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #555;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.home-sidebar li a:hover,
.home-sidebar li a.active {
  color: #007bff;
  background: #f0f7ff;
  border-left-color: #007bff;
}

/* =========== 主内容区 =========== */
.home-content {
  flex: 1;
  min-width: 0;
}

/* =========== 导航区块（三行布局） =========== */
.nav-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

/* 第1行：常用推荐 */
.nav-featured {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.nav-featured-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.nav-featured-title .nav-featured-more {
  font-size: 12px;
  font-weight: normal;
  color: #007bff;
  text-decoration: none;
}
.nav-featured-title .nav-featured-more:hover { text-decoration: underline; }
.nav-featured-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* 横向分类标签 */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.nav-tab {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 20px;
  background: #f5f6f8;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
}
.nav-tab:hover { color: #007bff; background: #e8f0fe; }
.nav-tab.active {
  background: #007bff;
  color: #fff;
}

/* 网站列表网格 */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 290px; /* 5行 ≈ 5*(46+8) + 10 */
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-grid.expanded {
  max-height: 9999px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s;
  min-width: 0; /* 防止长名字撑开列宽 */
}
.nav-item:hover { background: #f5f6f8; }
.nav-item .nav-logo-link {
  flex-shrink: 0;
  display: inline-block;
  line-height: 0;
}
.nav-item .nav-logo-link img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: contain;
  display: block;
}
.nav-item .nav-name {
  font-size: 13px;
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.nav-item .nav-name:hover { color: #007bff; }
.nav-item .nav-desc {
  display: none;
  font-size: 11px;
  color: #999;
}

/* 展开/收起按钮 */
.nav-expand {
  display: block;
  text-align: center;
  padding: 10px 0 4px;
  font-size: 13px;
  color: #007bff;
  cursor: pointer;
  user-select: none;
}
.nav-expand:hover { color: #0056b3; }
.nav-expand .arrow { display: inline-block; transition: transform 0.2s; font-size: 12px; margin-left: 4px; }
.nav-expand .arrow.up { transform: rotate(180deg); }

/* =========== 文章列表 =========== */
.article-section { }
.article-section .section-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #007bff;
  display: inline-block;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-item {
  display: flex;
  gap: 16px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}
.article-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.article-thumb {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.article-info h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-info h3 a { color: #1a1a2e; }
.article-info h3 a:hover { color: #007bff; }
.article-excerpt {
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #aaa;
}
.article-meta .cat-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #e8f0fe;
  color: #007bff;
  border-radius: 12px;
  font-size: 12px;
}

/* =========== 分页 =========== */
.home-pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.home-pagination a,
.home-pagination span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #555;
  transition: all 0.15s;
}
.home-pagination a:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}
.home-pagination .current {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* =========== 加载动画 =========== */
.nav-loading {
  text-align: center;
  padding: 40px 0;
  color: #999;
  font-size: 14px;
}
.nav-loading .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========== 空状态 =========== */
.nav-empty {
  text-align: center;
  padding: 40px 0;
  color: #bbb;
  font-size: 14px;
}

/* =========== 页脚 =========== */
.home-footer {
  background: #1a1a2e;
  color: #999;
  padding: 24px 0;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links a {
  color: #aaa;
  font-size: 13px;
  margin-right: 16px;
  transition: color 0.15s;
}
.footer-links a:hover { color: #fff; }
.footer-copy {
  font-size: 13px;
  color: #777;
}
.footer-copy a { color: #999; }
.footer-copy a:hover { color: #fff; }

/* =========== 响应式 =========== */
@media (max-width: 992px) {
  .home-main { flex-direction: column; }
  .home-sidebar {
    width: 100%;
    position: static;
    display: flex;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 0;
  }
  .home-sidebar h3 { display: none; }
  .home-sidebar ul { display: flex; flex-wrap: wrap; gap: 0; }
  .home-sidebar li a { padding: 6px 12px; border-left: none; border-bottom: 2px solid transparent; }
  .home-sidebar li a.active { border-left-color: transparent; border-bottom-color: #007bff; }
  .nav-featured-grid { grid-template-columns: repeat(4, 1fr); }
  .nav-grid { grid-template-columns: repeat(4, 1fr); }
  .article-thumb { width: 140px; height: 96px; }
}
@media (max-width: 600px) {
  .nav-featured-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-grid { grid-template-columns: repeat(3, 1fr); }
  .article-thumb { width: 110px; height: 75px; }
  .home-header .header-inner { flex-wrap: wrap; }
  .home-header .search-box { max-width: 100%; }
}
