/* ===== 百科知识宝典 全站样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #1f2937; background: #f7f8fa; line-height: 1.7;
}
a { color: #1668dc; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- 顶部导航 ---- */
.site-top {
  position: sticky; top: 0; z-index: 1000;
  background: #1f2937; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.site-top .inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.site-top .brand { font-size: 20px; font-weight: 700; color: #fff; }
.site-top .brand small { font-size: 12px; opacity: .7; font-weight: 400; margin-left: 6px; }
.site-top nav { display: flex; gap: 16px; }
.site-top nav a { color: #e5e7eb; font-size: 15px; }
.site-top nav a:hover { color: #fff; }

/* ---- 搜索框 ---- */
.search-box { display: flex; flex: 1 1 260px; max-width: 420px; margin-left: auto; }
.search-box input {
  flex: 1; border: none; border-radius: 20px 0 0 20px; padding: 8px 14px;
  font-size: 16px; outline: none;
}
.search-box button {
  border: none; background: #ffb200; color: #1f2937; font-weight: 700;
  border-radius: 0 20px 20px 0; padding: 0 18px; cursor: pointer; font-size: 14px;
}

/* ---- 首页 Hero ---- */
.hero { text-align: center; padding: 56px 20px 40px; background: linear-gradient(160deg, #eef3fb, #fff); }
.hero h1 { font-size: 40px; letter-spacing: 2px; color: #123; }
.hero .slogan { font-size: 18px; color: #4b5563; margin-top: 10px; }
.hero .cta { margin-top: 26px; }
.hero .btn {
  display: inline-block; background: #1668dc; color: #fff; font-size: 16px;
  padding: 12px 34px; border-radius: 30px; font-weight: 600;
}
.hero .btn:hover { background: #0f54b8; text-decoration: none; }

/* ---- 首页分类图区 ---- */
.cats { padding: 40px 0 30px; }
.cats .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.cat-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); transition: transform .2s; }
.cat-card:hover { transform: translateY(-4px); }
.cat-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.cat-card .txt { padding: 14px 16px; }
.cat-card h3 { font-size: 16px; margin-bottom: 4px; }
.cat-card p { font-size: 13px; color: #6b7280; }

/* ---- 栏目目录页 ---- */
.letters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.letters a {
  min-width: 34px; padding: 6px 8px; text-align: center; border-radius: 6px;
  background: #fff; border: 1px solid #e5e7eb; color: #1f2937; font-weight: 600;
}
.letters a.on { background: #1668dc; color: #fff; border-color: #1668dc; }
.letters .all { background: #1f2937; color: #fff; }
.count { font-size: 13px; color: #6b7280; margin-bottom: 12px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.entry-item {
  background: #fff; border: 1px solid #eef0f3; border-radius: 10px; padding: 12px 16px;
  font-size: 14px; transition: border-color .2s;
}
.entry-item:hover { border-color: #1668dc; }
.entry-item .kw { font-weight: 600; color: #111827; }
.entry-item .cat { font-size: 12px; color: #1668dc; margin-left: 6px; }
.loading, .empty { text-align: center; color: #6b7280; padding: 40px 0; }

/* ---- 页脚 ---- */
.site-foot { background: #1f2937; color: #9ca3af; padding: 30px 20px; margin-top: 50px; font-size: 13px; }
.site-foot .inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-foot a { color: #e5e7eb; }
