/* ============ 基础 ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --bg: #f5f6f8;
  --card: #fff;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-width: 320px;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { 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: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.site-nav { display: flex; gap: 26px; font-size: 15px; flex: 1; overflow-x: auto; white-space: nowrap; }
.site-nav a { color: var(--text-2); padding: 18px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.header-date { flex: none; font-size: 13px; color: var(--text-3); }
.site-switch {
  flex: none;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  max-width: 110px;
  cursor: pointer;
  outline: none;
}
.site-switch:hover { border-color: var(--primary); color: var(--primary); }

/* ============ 大图轮播 ============ */
.banner {
  position: relative;
  height: 460px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow: var(--shadow);
}
.banner-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  cursor: pointer;
}
.banner-slide.active { opacity: 1; z-index: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide.active img { animation: bannerZoom 6s ease forwards; }
@keyframes bannerZoom { from { transform: scale(1); } to { transform: scale(1.05); } }
.banner-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.6) 100%);
}
.banner-caption {
  position: absolute;
  left: 24px; right: 24px; bottom: 76px;
  color: #fff;
}
.banner-caption h3 {
  font-size: 24px;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.banner-caption .cat-tag { color: #fff; background: rgba(255, 255, 255, 0.25); }
.banner-meta { margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.85); display: flex; align-items: center; gap: 12px; }
.banner-dots {
  position: absolute; left: 24px; bottom: 20px;
  display: flex; gap: 8px; z-index: 3;
}
.banner-dots .dot {
  width: 22px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  border: none; cursor: pointer; padding: 0;
  transition: background 0.3s;
}
.banner-dots .dot.active { background: #fff; }
.banner-thumbs {
  position: absolute; right: 16px; bottom: 12px;
  display: flex; gap: 8px; z-index: 3;
}
.banner-thumb {
  width: 84px; height: 52px;
  border-radius: 6px; overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.75;
  transition: all 0.3s;
}
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-thumb.active { border-color: var(--primary); opacity: 1; }
.banner-thumb:hover { opacity: 1; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); color: #fff;
  font-size: 18px; cursor: pointer;
  z-index: 3; opacity: 0;
  transition: opacity 0.3s, background 0.3s;
}
.banner:hover .banner-arrow { opacity: 1; }
.banner-arrow:hover { background: rgba(0, 0, 0, 0.6); }
.banner-arrow.prev { left: 16px; }
.banner-arrow.next { right: 16px; }

/* ============ 区块 ============ */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-head .bar { width: 5px; height: 20px; background: var(--primary); border-radius: 2px; flex: none; }
.section-head h2 { font-size: 20px; }
.section-head .more { margin-left: auto; color: var(--text-2); font-size: 13px; }
.section-head .more:hover { color: var(--primary); }
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 20px;
}

/* ============ 推荐新闻 ============ */
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; }
.rec-row { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.rec-row:nth-last-child(-n+2) { border-bottom: none; }
.rec-rank { font-size: 22px; font-weight: 800; color: var(--text-3); width: 30px; flex: none; line-height: 1.2; }
.rec-row:nth-child(-n+3) .rec-rank { color: var(--primary); }
.rec-body { flex: 1; min-width: 0; }
.rec-body h4 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-body h4 a:hover { color: var(--primary); }
.rec-body .summary {
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 4px 0;
}
.rec-body .meta { font-size: 12px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }

/* ============ 小图卡片 ============ */
.small-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.small-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.small-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); }
.small-card > img, .small-card > .card-noimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.3s; }
.small-card:hover > img { transform: scale(1.05); }
.small-card > .card-noimg {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff, #f5f6f8);
  color: var(--text-3); font-size: 13px;
}
.small-card .body { padding: 12px; }
.small-card h3 {
  font-size: 15px; line-height: 1.5; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.small-card:hover h3 { color: var(--primary); }
.small-card .summary {
  font-size: 12.5px; color: var(--text-2); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.small-card .meta { margin-top: 10px; font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }

/* ============ 新闻行（有图/无图混排） ============ */
.cat-tag { background: #eff6ff; color: var(--primary); font-size: 12px; padding: 1px 8px; border-radius: 4px; flex: none; }
.news-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.news-row:last-child { border-bottom: none; padding-bottom: 6px; }
.news-row-thumb { width: 160px; height: 100px; flex: none; border-radius: 8px; overflow: hidden; background: #e5e7eb; }
.news-row-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.news-row:hover .news-row-thumb img { transform: scale(1.06); }
.news-row-body { flex: 1; min-width: 0; }
.news-row h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-row h4 a:hover { color: var(--primary); }
.news-row .summary {
  font-size: 13px; color: var(--text-2); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-row .meta { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; align-items: center; }
.news-row.text-only .news-row-body h4 { padding-left: 10px; border-left: 3px solid var(--primary); }

/* ============ 列表页布局 ============ */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 20px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; margin: 20px 0 12px; }
.cat-head h2 { font-size: 22px; position: relative; padding-left: 14px; }
.cat-head h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; background: var(--primary); border-radius: 2px; }
.cat-desc { font-size: 13px; color: var(--text-3); }
.list-card { padding: 4px 20px; }

/* ============ 侧边栏 ============ */
.sidebar .side-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 8px;
  margin-bottom: 20px;
}
.side-card:last-child { margin-bottom: 0; }
.side-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.side-title::before { content: ''; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }
.hot-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.hot-item:last-child { border-bottom: none; }
.hot-item .rank { width: 20px; flex: none; font-weight: 800; color: var(--text-3); }
.hot-item:nth-child(-n+3) .rank { color: #f97316; }
.hot-item .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-item .t:hover { color: var(--primary); }
.hot-item .v { flex: none; color: var(--text-3); font-size: 12px; }
.cat-nav { list-style: none; }
.cat-nav li + li { margin-top: 2px; }
.cat-nav a { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--text-2); }
.cat-nav a em { font-style: normal; font-size: 12px; color: var(--text-3); }
.cat-nav a:hover, .cat-nav a.active { background: #eff6ff; color: var(--primary); }
.cat-nav a.active em { color: var(--primary); }
.ad-box {
  border: 1px dashed var(--border);
  border-radius: 8px;
  height: 250px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px;
  background: repeating-linear-gradient(45deg, #fafafa 0 10px, #fff 10px 20px);
}

/* ============ 分页 ============ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.page-btn {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px; color: var(--text-2);
  transition: all 0.2s;
}
a.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ============ 面包屑 ============ */
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); margin-top: 20px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb strong { color: var(--text); font-weight: 600; }

/* ============ 详情页 ============ */
.detail {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-top: 16px;
}
.detail h1 { font-size: 26px; line-height: 1.4; }
.detail .dmeta {
  display: flex; flex-wrap: wrap; gap: 16px;
  color: var(--text-3); font-size: 13px;
  margin: 14px 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail .content { font-size: 16px; line-height: 1.9; color: #374151; }
.detail .content p { margin-bottom: 16px; }
.detail .content h2 { font-size: 20px; margin: 24px 0 12px; }
.detail .content figure { margin: 20px 0; }
.detail .content figure img { border-radius: 8px; width: 100%; }
.detail .content figcaption { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.detail .content blockquote {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  color: #1e3a8a;
}
.pn-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 14px; color: var(--text-2); }
.pn-nav span { max-width: 48%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pn-nav a:hover { color: var(--primary); }

/* ============ 页脚 ============ */
.site-footer { margin-top: 40px; background: #fff; border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-bottom: 10px; font-size: 14px; color: var(--text-2); }
.footer-links a:hover { color: var(--primary); }

/* ============ 空状态 ============ */
.empty { padding: 40px 0; text-align: center; color: var(--text-3); font-size: 14px; }

/* ============ 顶部通栏广告 ============ */
.ad-banner { margin-top: 16px; }
.ad-banner img { width: 100%; border-radius: var(--radius); }
.ad-ph {
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 14px;
  background: repeating-linear-gradient(45deg, #fafafa 0 10px, #fff 10px 20px);
}

/* ============ 详情页封面 ============ */
.detail .cover { margin: 20px 0; border-radius: 8px; overflow: hidden; }
.detail .cover img { width: 100%; max-height: 460px; object-fit: cover; }
.detail .content img { max-width: 100%; border-radius: 8px; }

/* ============ 联系我们 ============ */
.contact-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; margin-top: 16px; }
.contact-card h1 { font-size: 24px; margin-bottom: 16px; }
.contact-card p { color: var(--text-2); margin-bottom: 12px; line-height: 1.8; }
.contact-card .contact-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.contact-card .contact-item:last-child { border-bottom: none; }
.contact-card .contact-item .label { color: var(--text-3); width: 80px; flex: none; }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .small-grid { grid-template-columns: repeat(2, 1fr); }
  .rec-grid { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .rec-row:nth-last-child(-n+2) { border-bottom: 1px dashed var(--border); }
  .rec-row:nth-last-child(1) { border-bottom: none; }
  .banner { height: 320px; }
  .banner-caption h3 { font-size: 18px; }
  .header-date { display: none; }
  .site-nav { gap: 18px; }
}
@media (max-width: 600px) {
  .banner { height: 240px; }
  .banner-thumbs { display: none; }
  .banner-caption { bottom: 44px; left: 16px; right: 16px; }
  .banner-caption h3 { font-size: 16px; }
  .news-row-thumb { width: 110px; height: 74px; }
  .detail { padding: 20px 16px; }
  .detail h1 { font-size: 20px; }
  .pn-nav { flex-direction: column; gap: 6px; }
  .pn-nav span { max-width: 100%; }
}
