/* ============================================================
   去算卦疫情资讯网 - 前台样式
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;
  --danger: #dc2626;
  --orange: #f59e0b;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(30, 58, 138, .25);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 66px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fff; color: var(--primary);
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.logo-text { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; }
.logo-text small { display: block; font-size: 10px; font-weight: 400; opacity: .85; letter-spacing: 1px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  color: rgba(255,255,255,.85); font-size: 15px; padding: 7px 14px;
  border-radius: 8px; transition: .2s; white-space: nowrap;
}
.main-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.main-nav a.active { background: #fff; color: var(--primary); font-weight: 600; }

.search-box { display: flex; flex-shrink: 0; }
.search-box input {
  width: 210px; padding: 8px 14px; border: none; border-radius: 8px 0 0 8px;
  font-size: 14px; outline: none; background: rgba(255,255,255,.95);
}
.search-box button {
  padding: 8px 18px; border: none; border-radius: 0 8px 8px 0;
  background: var(--accent); color: #fff; font-size: 14px; cursor: pointer;
}
.search-box button:hover { filter: brightness(1.08); }

/* ---------- 轮播 ---------- */
.banner {
  position: relative; margin: 20px 0 0; border-radius: var(--radius);
  overflow: hidden; height: 340px; box-shadow: var(--shadow);
}
.banner-track { height: 100%; position: relative; }
.banner-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease;
  display: flex; align-items: center; justify-content: center;
}
.banner-slide.active { opacity: 1; z-index: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-fallback {
  width: 100%; height: 100%;
  background: linear-gradient(120deg, #1e40af, #2563eb 45%, #0891b2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; gap: 12px; text-align: center; padding: 24px;
}
.bf-tag {
  font-size: 13px; letter-spacing: 3px; padding: 5px 16px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
}
.bf-title { font-size: 34px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.bf-sub { font-size: 15px; opacity: .85; letter-spacing: 1px; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.85); color: var(--primary);
  font-size: 26px; line-height: 1; cursor: pointer; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); transition: .2s;
}
.banner-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.banner-arrow.prev { left: 16px; }
.banner-arrow.next { right: 16px; }
.banner-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.banner-dots .dot {
  width: 26px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5);
  cursor: pointer; transition: .3s;
}
.banner-dots .dot.active { background: #fff; width: 36px; }

/* ---------- 全站数据汇总条 ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; margin: 20px 0;
}
.stat-item {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; text-align: center;
  border-top: 3px solid var(--primary);
}
.stat-item:nth-child(2) { border-color: var(--accent); }
.stat-item:nth-child(3) { border-color: var(--orange); }
.stat-item:nth-child(4) { border-color: #8b5cf6; }
.stat-item:nth-child(5) { border-color: #ec4899; }
.stat-item b { display: block; font-size: 26px; color: var(--primary-dark); }
.stat-item span { font-size: 13px; color: var(--text-light); }

/* ---------- 布局 ---------- */
.home-grid {
  display: grid; grid-template-columns: 1fr 330px; gap: 20px; margin-bottom: 30px;
}
.panel {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px;
}
.panel-title {
  font-size: 17px; font-weight: 700; display: flex; align-items: center;
  gap: 8px; margin-bottom: 14px; color: var(--text);
}
.pt-bar { width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }

/* ---------- 置顶热点 ---------- */
.top-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.top-card { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: .25s; }
.top-card:hover { box-shadow: 0 8px 22px rgba(37,99,235,.14); transform: translateY(-2px); }
.top-card-main { flex-direction: column; }
.tc-thumb { height: 150px; overflow: hidden; background: linear-gradient(135deg,#dbeafe,#e0f2fe); }
.tc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tc-body { padding: 12px 14px; }
.tc-body h3 { font-size: 16px; margin: 6px 0; line-height: 1.5; }
.tc-body p { font-size: 13px; color: var(--text-light); }
.tc-meta { font-size: 12px; color: var(--text-light); }
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-line {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 14px; transition: .2s;
}
.top-line:hover { border-color: var(--primary); background: #f8faff; }
.tl-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-date { color: var(--text-light); font-size: 12px; flex-shrink: 0; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; vertical-align: 1px; flex-shrink: 0;
}
.badge.hot { background: #fee2e2; color: var(--danger); }

/* ---------- 资讯列表 ---------- */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item {
  display: flex; gap: 16px; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; transition: .25s; background: #fff;
}
.news-item:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(37,99,235,.12); transform: translateY(-2px); }
.ni-thumb {
  width: 168px; height: 112px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  display: flex; align-items: center; justify-content: center;
}
.ni-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800; color: var(--primary);
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
}
.ni-body { flex: 1; min-width: 0; }
.ni-body h3 { font-size: 16px; line-height: 1.5; margin-bottom: 6px; }
.news-item:hover h3 { color: var(--primary); }
.ni-summary {
  font-size: 13px; color: var(--text-light);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ni-meta { margin-top: 10px; font-size: 12px; color: var(--text-light); display: flex; gap: 14px; }
.ni-cat {
  background: #eff6ff; color: var(--primary); padding: 2px 10px; border-radius: 999px; font-weight: 600;
}

/* ---------- 侧栏 ---------- */
.home-side .panel { margin-bottom: 20px; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-card {
  display: flex; flex-direction: column; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); transition: .2s;
}
.cat-card:hover { background: #eff6ff; border-color: var(--primary); }
.cat-name { font-size: 14px; font-weight: 600; }
.cat-count { font-size: 12px; color: var(--text-light); }

.hot-list { display: flex; flex-direction: column; }
.hot-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px dashed var(--border); font-size: 14px;
}
.hot-item:last-child { border-bottom: none; }
.hot-rank {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  background: #e5e7eb; color: var(--text-light);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.hot-rank.top { background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff; }
.hot-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-title:hover { color: var(--primary); }
.hot-views { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

.tips-panel { background: linear-gradient(160deg, #ecfdf5, #ffffff); }
.tips-list { list-style: none; }
.tips-list li { padding: 7px 0; font-size: 14px; border-bottom: 1px dashed rgba(16,185,129,.3); }
.tips-list li:last-child { border-bottom: none; }

/* ---------- 页面头 / 面包屑 ---------- */
.page-head { margin: 24px 0 18px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-light); font-size: 14px; margin-top: 4px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; margin: 18px 0; font-size: 13px; color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- 详情页 ---------- */
.article { max-width: 860px; margin: 0 auto 20px; padding: 30px; }
.article-title { font-size: 26px; line-height: 1.45; margin-bottom: 14px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-light);
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.article-cover { border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; }
.article-summary {
  background: #eff6ff; border-left: 4px solid var(--primary);
  padding: 12px 16px; border-radius: 6px; color: #1e3a8a; margin-bottom: 18px; font-size: 15px;
}
.article-content { font-size: 16px; line-height: 2; color: #374151; }
.article-tags { margin: 18px 0 6px; padding: 10px 14px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.article-tags .tags-label { font-size: 13px; color: #6b7280; }
.article-tags .tag-link { display: inline-block; padding: 3px 10px; font-size: 13px; color: #2563eb; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 999px; text-decoration: none; transition: .2s; }
.article-tags .tag-link:hover { background: #2563eb; color: #fff; }
.article-foot {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; color: var(--text-light); font-size: 13px;
}
.btn-back { color: var(--primary); font-size: 14px; }

.related { max-width: 860px; margin: 0 auto 30px; }
.related-list { list-style: none; }
.related-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.related-list li a:hover { color: var(--primary); }
.rl-date { color: var(--text-light); font-size: 12px; flex-shrink: 0; margin-left: 12px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0 30px; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); font-size: 14px; transition: .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination span.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 按钮 / 空态 ---------- */
.btn {
  display: inline-block; padding: 9px 20px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer; transition: .2s;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn:hover { filter: brightness(1.06); }
.empty { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 14px; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 80px 0; }
.nf-code {
  font-size: 90px; font-weight: 900; color: var(--primary);
  background: linear-gradient(135deg,#2563eb,#0ea5e9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.not-found h1 { font-size: 22px; margin: 10px 0; }
.not-found p { color: var(--text-light); margin-bottom: 24px; }
.nf-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #111827; color: #9ca3af; margin-top: 30px; padding: 30px 0 26px; text-align: center; font-size: 13px;
}
.footer-title { color: #e5e7eb; font-size: 15px; margin-bottom: 6px; }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.footer-links a { color: #9ca3af; }
.footer-links a:hover { color: #fff; }
.footer-icp { margin-top: 10px; }
.footer-icp a { color: #6b7280; font-size: 12px; }
.footer-icp a:hover { color: #d1d5db; }
.footer-geo { margin-top: 10px; color: #9ca3af; font-size: 13px; }
.footer-geo b { color: #e5e7eb; font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .top-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 150px; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 12px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .banner { height: 220px; }
  .bf-title { font-size: 24px; }
  .news-item { flex-direction: column; }
  .ni-thumb { width: 100%; height: 160px; }
}
