/* 资源怪 — 全站样式（响应式，移动优先） */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e6e8eb;
  --text: #1f2328;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-weak: #dbeafe;
  --radius: 10px;
  --wrap: 1240px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 15px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 14px; }

/* 顶栏：第一行 = 站名 + 分类，第二行 = 搜索 */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; gap: 16px; padding: 12px 14px 4px; max-width: var(--wrap); margin: 0 auto; }
.logo { font-size: 20px; font-weight: 700; white-space: nowrap; }
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; justify-content: flex-start; }
.cats::-webkit-scrollbar { display: none; }
.cats a:first-child { margin-left: auto; }
.cats a { white-space: nowrap; padding: 4px 14px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 14px; }
.cats a.on { background: var(--primary); color: #fff; }
.search-row { max-width: var(--wrap); margin: 0 auto; padding: 8px 14px 12px; }
.search { display: flex; width: 100%; max-width: 560px; margin: 0 auto; }
.search input { flex: 1; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: 9px 14px; font-size: 14px; outline: none; background: var(--bg); }
.search button { border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 0 8px 8px 0; padding: 9px 20px; cursor: pointer; font-size: 14px; }
.crumbs-top { display: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 18px; line-height: 1; padding: 6px 10px; cursor: pointer; color: var(--text); }
.mobile-menu { display: none; }
.menu-mask { display: none; }

/* 轮播 */
.carousel-wrap { margin: 14px auto 0; max-width: var(--wrap); padding: 0 14px; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 21/8; background: #111; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; color: #fff; font-size: 15px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-count { position: absolute; right: 12px; bottom: 12px; z-index: 2; color: #fff; font-size: 12px; background: rgba(0,0,0,.45); border-radius: 999px; padding: 2px 10px; }
.carousel-wrap { position: relative; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(0,0,0,.38); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding-bottom: 4px; transition: background .15s; }
.car-btn:hover { background: rgba(0,0,0,.6); }
.car-btn.prev { left: 10px; }
.car-btn.next { right: 10px; }
.carousel-dots { display: flex; gap: 6px; justify-content: center; padding: 8px 0 0; }
.carousel-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c9ced6; }
.carousel-dots i.on { background: var(--primary); }

/* 列表（左图右文） */
.list { margin-top: 14px; display: grid; gap: 10px; }
@media (min-width: 720px) { .list { grid-template-columns: 1fr 1fr; } }
.item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: box-shadow .15s; }
.item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.item .thumb { flex: 0 0 150px; }
.item .thumb img { width: 150px; height: 112px; object-fit: contain; border-radius: 8px; background: #e7eaee; }
.item-body { min-width: 0; display: flex; flex-direction: column; }
.item-body h2 { font-size: 15.5px; line-height: 1.45; }
.item-body h2 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-body h2 a:hover { color: var(--primary); }
.excerpt { color: var(--muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.meta .cat { background: var(--primary-weak); color: var(--primary); border-radius: 4px; padding: 1px 8px; }
.meta time { margin-left: auto; }

/* 分页 */
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 22px 0 34px; }
.pg { min-width: 34px; text-align: center; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.pg:hover { border-color: var(--primary); color: var(--primary); }
.pg.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-dot { padding: 6px 2px; color: var(--muted); }
.pg-nav { font-size: 13px; padding: 6px 14px; }

/* 面包屑 + 内容页 */
.crumbs { padding: 14px 0 0; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 10px 0 40px; }
.post h1 { font-size: 21px; line-height: 1.5; }
.post-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.post-meta .cat { background: var(--primary-weak); color: var(--primary); border-radius: 4px; padding: 1px 8px; }
.post-content { padding-top: 14px; font-size: 15.5px; }
.post-content p { margin: 0 0 12px; }
.post-content img { border-radius: 8px; height: auto; }
.post-content h2, .post-content h3 { margin: 18px 0 8px; }

/* 下载引导 */
.download-tip { margin: 22px 0 8px; padding: 18px; text-align: left; background: linear-gradient(135deg, #eff6ff, #ecfdf5); border: 1px dashed var(--primary); border-radius: var(--radius); }
.download-tip p { font-size: 16.5px; font-weight: 700; }
.download-tip .dl-label { color: var(--primary); }
.download-tip .mp-name { color: var(--primary); }
.download-tip .qr { margin-top: 12px; background: #fff; padding: 6px; border-radius: 8px; }

/* 浏览量 */
.views { color: var(--muted); }

/* 相关推荐（两列） */
.related h3 { font-size: 17px; padding: 6px 0 2px; }
@media (min-width: 720px) { .related .list { grid-template-columns: 1fr 1fr; } }

/* 页脚 / 404 */
.foot { border-top: 1px solid var(--line); padding: 18px 0 26px; color: var(--muted); font-size: 13px; text-align: center; background: var(--card); }
.notfound { text-align: center; padding: 70px 0; }
.notfound h1 { font-size: 64px; color: var(--primary); }
.muted { color: var(--muted); }

/* 搜索结果页（与首页列表同款样式，自定义渲染） */
.search-msg { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.search-msg b { color: var(--text); }
#search-results .list { margin-top: 12px; }
#search-results .excerpt mark { background: var(--primary-weak); color: var(--primary); padding: 0 1px; }
.search-empty { text-align: center; padding: 70px 0; color: var(--muted); font-size: 15px; }
.search-empty small { color: var(--muted); opacity: .8; }
@media (max-width: 640px) { .search-empty { padding: 46px 0; } }

/* 移动端：左三杠菜单 + 居中站名，搜索行不变；分类行收进汉堡菜单 */
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; justify-content: center; position: relative; padding-bottom: 8px; }
  .logo { margin: 0 auto; }
  .cats { display: none; }
  .menu-btn { display: block; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 300; }
  .menu-mask.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; }
  .mobile-menu.open { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; background: var(--card); box-shadow: 6px 0 24px rgba(0,0,0,.18); padding: 66px 10px 20px; width: 240px; overflow-y: auto; border-radius: 0; }
  .mobile-menu.open a { padding: 12px 16px; border-radius: 8px; font-size: 15.5px; margin-bottom: 2px; }
  .mobile-menu.open a:hover, .mobile-menu.open a.on { background: var(--primary-weak); color: var(--primary); }
  .crumbs-top { display: block; position: static; transform: none; order: 3; flex-basis: 100%; text-align: left; padding: 2px 0 0; max-width: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
  .crumbs-top a:hover { color: var(--primary); }
  main .crumbs { display: none; }
  .slide { aspect-ratio: 16/9; }
  .item .thumb { flex-basis: 92px; }
  .item .thumb img { width: 92px; height: 92px; }
  .post { padding: 16px 14px; }
  .post h1 { font-size: 18.5px; }
}
