/* ============ 模板 default：蓝色门户风 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --primary: #1e6fd9; --primary-dark: #1558b0; --text: #23324d; --muted: #7a869a; --bg: #f3f6fb; --card: #ffffff; --line: #e4eaf3; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

/* ---------- 头部 ---------- */
.site-header { background: #fff; box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(24, 60, 120, .06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img { height: 40px; width: auto; }
.logo-mark { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #63a4f4); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.logo-text { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 16px; border-radius: 8px; font-size: 15px; color: #46536b; transition: all .2s; }
.main-nav a:hover { color: var(--primary); background: #eef4fd; }
.main-nav a.active { color: #fff; background: var(--primary); }

/* ---------- 横幅 ---------- */
.hero { min-height: 240px; background-size: cover; background-position: center; position: relative; }
.hero-fallback { background: linear-gradient(120deg, var(--primary), #63a4f4); }
.hero-inner { position: relative; z-index: 2; padding: 64px 0; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.hero-inner h2 { font-size: 34px; letter-spacing: 1px; }
.hero-inner p { margin-top: 8px; opacity: .92; max-width: 640px; }

/* ---------- 广告 ---------- */
.ad-wrap { margin-top: 20px; }
.ad-slot { margin-bottom: 16px; }
.ad-slot img { width: 100%; border-radius: 10px; }
.ad-header img { border-radius: 10px; }

/* ---------- 主体 ---------- */
.site-main { padding: 28px 0 48px; }
.section { background: var(--card); border-radius: 14px; padding: 24px; margin-bottom: 22px; box-shadow: 0 2px 10px rgba(24, 60, 120, .05); }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-title { font-size: 20px; letter-spacing: .5px; position: relative; padding-left: 12px; }
.section-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--primary); }
.section-title a:hover { color: var(--primary); }
.section-line { flex: 1; height: 1px; background: var(--line); }
.section-more { font-size: 13px; color: var(--muted); }
.section-more:hover { color: var(--primary); }
.section-count { font-size: 13px; color: var(--muted); }

/* ---------- 推荐卡片 ---------- */
.recommend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(24, 60, 120, .12); }
.card-cover { display: block; aspect-ratio: 1200 / 500; overflow: hidden; background: linear-gradient(135deg, #dbe7f7, #eef4fd); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--primary); font-weight: 700; font-size: 22px; letter-spacing: 2px; }
.card-body { padding: 16px; }
.card-title { font-size: 16px; margin: 8px 0; line-height: 1.5; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.card-body time { display: block; margin-top: 10px; font-size: 12px; color: #98a3b5; }
.badge { display: inline-block; background: #eaf2fe; color: var(--primary); font-size: 12px; padding: 2px 10px; border-radius: 20px; }

/* ---------- 双栏布局 ---------- */
.layout-2col { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 86px; }
.widget { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(24, 60, 120, .05); }
.widget-title { font-size: 16px; margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--primary); }
.widget-nav { list-style: none; }
.widget-nav li { border-bottom: 1px dashed var(--line); }
.widget-nav li:last-child { border-bottom: 0; }
.widget-nav a { display: block; padding: 9px 4px; font-size: 14px; color: #46536b; }
.widget-nav a:hover { color: var(--primary); padding-left: 8px; transition: all .2s; }
.widget-nav li.on a { color: var(--primary); font-weight: 700; }
.ad-widget { padding: 10px; }

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; }
.post-item { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: 0; padding-bottom: 0; }
.post-thumb { flex: 0 0 220px; border-radius: 10px; overflow: hidden; aspect-ratio: 1200 / 630; background: #eef4fd; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-info h3 { font-size: 17px; line-height: 1.5; }
.post-info h3 a:hover { color: var(--primary); }
.post-info p { font-size: 13.5px; color: var(--muted); margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #98a3b5; }
.post-meta a { color: var(--primary); }
.empty-tip { color: var(--muted); text-align: center; padding: 30px 0; }

/* ---------- 点状链接列表 ---------- */
.dot-list { list-style: none; }
.dot-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dot-list li:last-child { border-bottom: 0; }
.dot-list a { font-size: 14.5px; color: #33415c; }
.dot-list a::before { content: "•"; color: var(--primary); margin-right: 8px; }
.dot-list a:hover { color: var(--primary); }
.dot-list time { font-size: 12px; color: #98a3b5; white-space: nowrap; }

/* ---------- 面包屑 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb em { font-style: normal; color: var(--text); }

/* ---------- 文章详情 ---------- */
.article-detail { background: var(--card); border-radius: 14px; padding: 32px; margin-bottom: 22px; box-shadow: 0 2px 10px rgba(24, 60, 120, .05); }
.article-title { font-size: 28px; line-height: 1.45; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.article-summary { margin: 18px 0; padding: 14px 18px; background: #f4f8fd; border-left: 4px solid var(--primary); border-radius: 8px; color: #4a5a78; font-size: 14px; }
.article-cover { margin: 18px 0; border-radius: 12px; overflow: hidden; }
.article-content { font-size: 15.5px; color: #333f56; padding: 8px 0 18px; }
.article-content h2 { font-size: 21px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-content h3 { font-size: 18px; margin: 20px 0 10px; }
.article-content p { margin: 12px 0; }
.article-content ul, .article-content ol { margin: 12px 0 12px 26px; }
.article-content li { margin: 6px 0; }
.article-content img { border-radius: 10px; margin: 14px 0; }
.article-content code { background: #eef2f8; padding: 2px 8px; border-radius: 6px; font-size: 13.5px; color: #c2410c; }
.article-content blockquote { margin: 14px 0; padding: 12px 18px; background: #f6f9fd; border-left: 4px solid #9fbbe8; color: #4a5a78; border-radius: 6px; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.pager-item { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pager-item span { color: var(--muted); }
.pager-item a { color: var(--text); font-weight: 600; }
.pager-item a:hover { color: var(--primary); }
.pager-item em { font-style: normal; color: #b7c0cf; }
.pager-item.next { text-align: right; }

/* ---------- 页脚 ---------- */
.site-footer { background: #17233d; color: #a9b5cc; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding: 36px 0 24px; flex-wrap: wrap; }
.footer-brand strong { color: #fff; font-size: 18px; }
.footer-brand p { font-size: 13px; margin-top: 8px; max-width: 460px; color: #8593ad; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-nav a { font-size: 14px; color: #a9b5cc; }
.footer-nav a:hover { color: #fff; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .08); padding: 16px 0 22px; text-align: center; font-size: 13px; color: #72809b; }
.copyright .ad-slot { margin-bottom: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout-2col { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .post-thumb { flex-basis: 150px; }
  .article-detail { padding: 22px; }
  .article-title { font-size: 23px; }
  .article-pager { grid-template-columns: 1fr; }
  .pager-item.next { text-align: left; }
}
@media (max-width: 560px) {
  .post-item { flex-direction: column; }
  .post-thumb { width: 100%; }
  .hero-inner h2 { font-size: 26px; }
}
