/* ==========================================================================
 * cilibaoku.com「磁力宝库」- 前台样式（零 JS 依赖，内容全部由 PHP 服务端直出）
 * 主题：宝蓝 + 琥珀橙，浅色卡片网格风格
 * ========================================================================== */

:root {
  --primary: #1a56db;
  --primary-dark: #143a91;
  --accent: #f97316;
  --text: #152238;
  --muted: #68748c;
  --faint: #939db3;
  --bg: #f3f6fb;
  --card: #ffffff;
  --border: #e2e8f2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 42, 107, .06);
  --shadow-hover: 0 8px 24px rgba(15, 42, 107, .12);
  --grad: linear-gradient(135deg, #0b2a6b 0%, #1a56db 58%, #38bdf8 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.35; }
.muted { color: var(--muted); font-size: 13px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff;
  padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 99;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.logo-img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: .5px; display: flex; flex-direction: column; line-height: 1.1; }
.logo-domain { font-size: 11px; font-weight: 400; color: var(--faint); letter-spacing: 0; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.main-nav a {
  padding: 6px 11px; border-radius: 8px; font-size: 14px; color: var(--muted); white-space: nowrap;
}
.main-nav a:hover { background: #eef3fb; color: var(--primary); }
.main-nav .nav-home { color: var(--primary); font-weight: 600; }

.top-search { display: flex; align-items: center; gap: 0; flex: 0 0 auto; }
.top-search input {
  width: 180px; height: 36px; border: 1px solid var(--border); border-right: none;
  border-radius: 9px 0 0 9px; padding: 0 12px; font-size: 14px; font-family: inherit;
  color: var(--text); background: #f8fafd; outline: none;
}
.top-search input:focus { border-color: var(--primary); background: #fff; }
.top-search button {
  height: 36px; width: 44px; border: none; border-radius: 0 9px 9px 0; cursor: pointer;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
}
.top-search button:hover { background: var(--primary-dark); }

.domain-tip {
  background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fed7aa;
  text-align: center; font-size: 13px; padding: 7px 16px;
}

.page-main { padding-top: 18px; padding-bottom: 36px; }

/* ---------------- Hero ---------------- */
.hero {
  background: var(--grad); color: #fff; border-radius: 18px;
  padding: 38px 24px 30px; text-align: center; margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(15, 42, 107, .18);
}
.hero-title { font-size: 28px; margin: 0 0 8px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { margin: 0 0 22px; color: #d8e6ff; font-size: 14px; }
.hero-search {
  display: flex; align-items: center; max-width: 620px; margin: 0 auto;
  background: #fff; border-radius: 12px; padding: 5px 5px 5px 14px;
  box-shadow: 0 8px 20px rgba(3, 18, 53, .22);
}
.hs-icon { display: flex; color: var(--primary); flex: 0 0 auto; }
.hs-input {
  flex: 1 1 auto; border: none; outline: none; height: 42px; padding: 0 12px;
  font-size: 15px; font-family: inherit; color: var(--text); background: transparent; min-width: 0;
}
.hs-btn {
  flex: 0 0 auto; border: none; cursor: pointer; height: 42px; padding: 0 24px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ea580c); color: #fff;
  font-size: 15px; font-weight: 600; font-family: inherit;
}
.hs-btn:hover { filter: brightness(1.06); }
.hero-tip { margin: 16px auto 0; max-width: 660px; font-size: 13px; color: #c9dbff; }
.hero-tip a { color: #fff; text-decoration: underline; }

/* ---------------- 首页「最新文章」条 ---------------- */
.latest-art {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 16px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.la-label {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  border-radius: 6px; padding: 2px 9px; letter-spacing: .5px;
}
.la-title {
  flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.la-title:hover { color: var(--primary); }
.la-date { flex: 0 0 auto; font-size: 12px; color: var(--faint); }
.la-more { flex: 0 0 auto; font-size: 13px; color: var(--primary); }
.la-more:hover { text-decoration: underline; }
.la-empty { flex: 1 1 auto; font-size: 14px; color: var(--faint); }

/* ---------------- 内容模块 ---------------- */
.sec {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head-sub { margin-top: 22px; }
.sec-title { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 9px; }
.bar { width: 4px; height: 17px; border-radius: 3px; background: var(--accent); display: inline-block; }
.sec-tip { font-size: 13px; color: var(--faint); }
.sec-more { font-size: 13px; color: var(--primary); }
.sec-more:hover { text-decoration: underline; }
.sub-title {
  font-size: 14px; color: var(--muted); margin: 16px 0 10px; font-weight: 600;
  padding-left: 10px; border-left: 3px solid #cbd9f2;
}
.sub-title:first-child { margin-top: 0; }

/* 入口卡片 */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.site-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 12px; transition: transform .16s, box-shadow .16s, border-color .16s;
}
.site-card:hover {
  transform: translateY(-2px); border-color: #bcd0f2;
  box-shadow: var(--shadow-hover); background: #fff;
}
.sc-ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #eaf1fe;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sc-ico img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.ico-char { font-size: 17px; line-height: 1; color: var(--primary-dark); font-weight: 600; }
.sc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-desc { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-go { flex: 0 0 auto; color: #c3cfe6; font-size: 18px; }

/* ---------------- 榜单 ---------------- */
.rank-box { background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.rank-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rank-title { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.rank-more { font-size: 13px; color: var(--primary); }
.rank-tip { font-size: 12px; color: var(--faint); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item a {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 14px;
}
.rank-item a:hover { background: #eef3fb; }
.rank-no {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; background: #e6ecf7; color: var(--muted);
  font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.rank-no.top { background: linear-gradient(135deg, var(--accent), #ea580c); color: #fff; }
.rank-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { flex: 0 0 auto; font-size: 12px; color: var(--faint); }

/* ---------------- 文章 ---------------- */
.art-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.art-card {
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.art-card:hover { transform: translateY(-2px); border-color: #bcd0f2; box-shadow: var(--shadow-hover); background: #fff; }
.art-title { font-size: 15px; margin: 0 0 8px; }
.art-title a:hover { color: var(--primary); }
.art-summary {
  margin: 0 0 10px; font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--faint); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; background: #eef3fb; color: var(--primary-dark);
  border-radius: 20px; padding: 2px 11px; font-size: 12px; white-space: nowrap;
}
.chip:hover { background: #e0eafd; }
.chip-cat { background: #e8efff; }
.chip .cnt { color: var(--faint); font-size: 11px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 20px 0 4px; }
.pg-btn {
  display: inline-block; min-width: 36px; padding: 6px 11px; text-align: center; font-size: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
}
a.pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pg-btn.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn.disabled { opacity: .5; }
.pg-gap { color: var(--faint); }
.pg-info { font-size: 13px; color: var(--faint); margin-left: 6px; }

/* ---------------- 面包屑 ---------------- */
.breadcrumb { margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: #c3cfe6; }
.breadcrumb a { color: var(--primary); }

/* ---------------- 通用区块 ---------------- */
.mod {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.mod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mod-title { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 9px; }
.mod-tip { font-size: 13px; color: var(--faint); }
.mod-more { font-size: 13px; color: var(--primary); }
.seo-text p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.seo-text p:last-child { margin-bottom: 0; }
.sec-title { font-size: 17px; }
h2.sec-title, h1.mod-title { margin: 0; }

.empty { text-align: center; color: var(--faint); padding: 26px 10px; margin: 0; }

/* ---------------- 两栏布局 ---------------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.col-main { min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 14px; }
.side-box { background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.side-title { font-size: 15px; margin: 0 0 10px; }
.side-cats, .side-arts { list-style: none; margin: 0; padding: 0; }
.side-cats li a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--muted);
}
.side-cats li a:hover { background: #eef3fb; color: var(--primary); }
.side-cats li a.current { background: #e8efff; color: var(--primary-dark); font-weight: 600; }
.side-arts li a {
  display: block; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-arts li a:hover { background: #eef3fb; color: var(--primary); }
.side-text { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.side-btn {
  display: block; text-align: center; padding: 9px; border-radius: 9px; font-size: 14px;
  background: var(--primary); color: #fff;
}
.side-btn:hover { background: var(--primary-dark); }

/* ---------------- 详情页 ---------------- */
.detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.detail-title { font-size: 24px; margin: 0 0 10px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.detail-summary {
  background: #f4f7fc; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0;
  padding: 10px 14px; font-size: 14px; color: var(--muted); margin: 0 0 16px;
}
.detail-h2 { font-size: 17px; margin: 24px 0 10px; }
.rich { font-size: 15px; line-height: 1.9; word-break: break-word; }
.rich h2 { font-size: 18px; margin: 22px 0 10px; }
.rich h3 { font-size: 16px; margin: 18px 0 8px; }
.rich p { margin: 0 0 12px; }
.rich ul, .rich ol { margin: 0 0 12px; padding-left: 22px; }
.rich img { border-radius: 10px; }
.rich blockquote {
  margin: 0 0 12px; padding: 8px 14px; background: #f4f7fc;
  border-left: 3px solid var(--border); color: var(--muted); border-radius: 0 8px 8px 0;
}
.tip-list { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.tip-list li { margin-bottom: 6px; }

.go-panel {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #f0f6ff; border: 1px dashed #b9cdf5; border-radius: 12px; padding: 14px 16px; margin: 0 0 18px;
}
.go-btn {
  display: inline-block; background: linear-gradient(135deg, var(--accent), #ea580c); color: #fff;
  font-weight: 600; font-size: 15px; padding: 11px 26px; border-radius: 10px;
}
.go-btn:hover { filter: brightness(1.06); }
.go-hint { font-size: 12px; color: var(--muted); }

/* /nav 分组 */
.link-group { margin-bottom: 22px; }
.link-group:last-child { margin-bottom: 0; }
.lg-title { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.lg-main { color: var(--text); }
.lg-sub { color: var(--muted); font-size: 14px; font-weight: 500; }
.lg-count { font-size: 12px; color: var(--faint); font-weight: 400; }

/* 内联搜索 */
.inline-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-search input {
  flex: 1 1 220px; height: 40px; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 12px; font-size: 14px; font-family: inherit; outline: none;
}
.inline-search input:focus { border-color: var(--primary); }
.inline-search button {
  flex: 0 0 auto; height: 40px; padding: 0 22px; border: none; border-radius: 9px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 14px; font-family: inherit;
}
.inline-search button:hover { background: var(--primary-dark); }

.nf-wrap { text-align: center; }
.nf-wrap .inline-search { max-width: 460px; margin-left: auto; margin-right: auto; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: #0e1c33; color: #a9b8d0; margin-top: 30px; padding-top: 30px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 22px; padding-bottom: 22px; }
.foot-title { font-size: 14px; margin: 0 0 10px; color: #fff; }
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: 6px; font-size: 13px; }
.foot-links a:hover { color: #fff; }
.foot-about p { font-size: 13px; margin: 0; color: #8fa1bd; }
.foot-bottom {
  border-top: 1px solid #1c2c46; padding: 14px 16px 22px; font-size: 12px; color: #7c8dab;
}
.foot-bottom p { margin: 0 0 6px; }
.foot-bottom a { color: #a9b8d0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .top-search input { width: 150px; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .header-inner { gap: 10px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .main-nav a { padding: 5px 9px; font-size: 13px; }
  .top-search { flex: 1 1 100%; }
  .top-search input { width: 100%; }
  .hero { padding: 26px 16px 22px; border-radius: 14px; }
  .hero-title { font-size: 21px; }
  .hero-search { padding: 4px 4px 4px 10px; }
  .hs-btn { padding: 0 16px; font-size: 14px; }
  .site-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .site-card { padding: 10px; }
  .sc-desc { display: none; }
  .art-list { grid-template-columns: 1fr; }
  .sec, .mod, .detail { padding: 14px; border-radius: 12px; }
  .detail-title { font-size: 20px; }
  .footer-inner { grid-template-columns: 1fr; }
  .rank-meta { display: none; }
  .latest-art { padding: 10px 12px; gap: 8px; }
  .la-title { flex-basis: 100%; order: 3; white-space: normal; }
  .la-date { display: none; }
}
