/* ===== 基础 ===== */
:root{
  --brand:#2563eb;
  --brand-dark:#1d4ed8;
  --ink:#111827;
  --text:#374151;
  --muted:#6b7280;
  --line:#e8ecf3;
  --bg:#f6f8fc;
  --card:#ffffff;
  --radius:16px;
  --shadow:0 1px 2px rgba(17,24,39,.04),0 8px 24px rgba(17,24,39,.05);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:15px;line-height:1.75;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1,h2,h3,h4{margin:0;color:var(--ink);line-height:1.4}
p{margin:0 0 1em}
.wrap{max-width:1140px;margin:0 auto;padding:0 20px}
.muted{color:var(--muted)}

/* ===== 头部 ===== */
.site-header{
  position:sticky;top:0;z-index:50;background:rgba(255,255,255,.88);
  backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--line);
}
.header-inner{display:flex;align-items:center;gap:22px;height:66px}
.brand{display:flex;align-items:center;gap:10px;flex-shrink:0}
.brand-mark{
  width:36px;height:36px;border-radius:11px;display:grid;place-items:center;
  background:linear-gradient(135deg,#3b82f6,#6366f1);color:#fff;font-weight:700;font-size:17px;
  box-shadow:0 6px 14px rgba(59,130,246,.32);
}
.brand-logo{height:34px;width:auto}
.brand-text{display:flex;flex-direction:column;line-height:1.25}
.brand-text strong{font-size:16px;color:var(--ink);letter-spacing:.2px}
.brand-text small{font-size:11px;color:var(--muted);max-width:230px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.main-nav{display:flex;gap:4px;margin-left:8px}
.main-nav a{padding:7px 12px;border-radius:9px;font-size:14px;color:var(--text);transition:.18s}
.main-nav a:hover{background:#eef4ff;color:var(--brand)}
.search{margin-left:auto;position:relative;display:flex;align-items:center}
.search input{
  width:230px;height:38px;border-radius:10px;border:1px solid var(--line);background:#fff;
  padding:0 40px 0 14px;font-size:13.5px;color:var(--ink);outline:none;transition:.18s;
}
.search input:focus{border-color:#bfd3fb;box-shadow:0 0 0 4px rgba(37,99,235,.08);width:260px}
.search button{
  position:absolute;right:4px;width:32px;height:32px;border:0;border-radius:8px;background:transparent;
  color:var(--muted);display:grid;place-items:center;cursor:pointer;transition:.18s;
}
.search button:hover{background:#eef4ff;color:var(--brand)}

/* ===== 布局 ===== */
.site-main{padding:26px 20px 50px}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 312px;gap:26px;align-items:start}
.content-col{min-width:0}

/* ===== 列表 ===== */
.page-head{margin:4px 0 18px}
.page-head h1{font-size:24px;letter-spacing:-.3px}
.page-head .muted{font-size:13px;margin-top:6px}
.post-list{display:flex;flex-direction:column;gap:14px}
.post-card{
  display:flex;gap:18px;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);transition:.2s;
}
.post-card:hover{transform:translateY(-2px);border-color:#d7e3fb;box-shadow:0 12px 30px rgba(37,99,235,.09)}
.post-thumb{width:172px;flex:0 0 172px;border-radius:12px;overflow:hidden;background:#eef2f8}
.post-thumb img{width:100%;height:118px;object-fit:cover;transition:.35s}
.post-card:hover .post-thumb img{transform:scale(1.05)}
.post-body{min-width:0;display:flex;flex-direction:column}
.post-tag{
  align-self:flex-start;font-size:11.5px;color:var(--brand);background:#eff5ff;
  padding:2px 9px;border-radius:999px;margin-bottom:7px;
}
.post-body h2{font-size:17px;font-weight:600;margin-bottom:6px}
.post-body h2 a{transition:.18s}
.post-body h2 a:hover{color:var(--brand)}
.post-desc{font-size:13.5px;color:var(--muted);margin:0;display:-webkit-box;-webkit-line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;line-height:1.7}
.post-meta{margin-top:auto;padding-top:9px;font-size:12px;color:#9aa3b2;display:flex;align-items:center;gap:7px}
.dot{opacity:.5}
.ai-flag{font-size:10px;font-weight:700;color:#7c3aed;background:#f3e8ff;border-radius:5px;padding:1px 5px}

/* ===== 分页 ===== */
.pager{display:flex;justify-content:center;gap:8px;margin:28px 0 0;flex-wrap:wrap}
.page-btn{
  min-width:38px;height:38px;padding:0 14px;display:grid;place-items:center;border-radius:10px;
  background:#fff;border:1px solid var(--line);font-size:13.5px;color:var(--text);transition:.18s;
}
.page-btn:hover{border-color:#bfd3fb;color:var(--brand)}
.page-btn.active{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}

/* ===== 侧栏 ===== */
.side-col{display:flex;flex-direction:column;gap:16px;position:sticky;top:82px}
.widget{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px 16px 12px;box-shadow:var(--shadow)}
.widget-title{font-size:14px;font-weight:700;margin-bottom:12px;padding-left:10px;position:relative}
.widget-title::before{content:"";position:absolute;left:0;top:3px;bottom:3px;width:3px;border-radius:2px;
  background:linear-gradient(180deg,#3b82f6,#6366f1)}
.hot-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.hot-list li{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;line-height:1.55}
.hot-list a{color:var(--text)}
.hot-list a:hover{color:var(--brand)}
.rank{flex:0 0 18px;height:18px;border-radius:6px;background:#f1f4f9;color:#98a2b3;
  font-size:11px;font-weight:700;display:grid;place-items:center;margin-top:2px}
.rank-1{background:#fee2e2;color:#dc2626}
.rank-2{background:#ffedd5;color:#ea580c}
.rank-3{background:#fef3c7;color:#d97706}
.mini-list{list-style:none;margin:0;padding:0}
.mini-list li{padding:8px 0;border-bottom:1px dashed var(--line);font-size:13.5px;display:flex;
  justify-content:space-between;gap:10px;align-items:baseline}
.mini-list li:last-child{border-bottom:0}
.mini-list a{color:var(--text);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.mini-list small{color:#a3acbb;font-size:11.5px;flex-shrink:0}
.tag-cloud{display:flex;flex-wrap:wrap;gap:7px}
.tag-cloud a{font-size:12.5px;color:var(--text);background:#f4f7fc;border:1px solid #eaf0fa;
  padding:3px 9px;border-radius:999px;transition:.18s}
.tag-cloud a:hover{background:#eef4ff;color:var(--brand);border-color:#d7e4fb}
.tag-cloud i{font-style:normal;color:#a9b3c1;font-size:10.5px;margin-left:4px}
.widget-cta p{font-size:13px;margin:0 0 8px}

/* ===== 文章详情 ===== */
.crumbs{font-size:12.5px;color:var(--muted);margin-bottom:12px;display:flex;gap:6px;flex-wrap:wrap}
.crumbs a:hover{color:var(--brand)}
.post-detail{background:#fff;border:1px solid var(--line);border-radius:18px;padding:30px 34px;box-shadow:var(--shadow)}
.post-header h1{font-size:26px;letter-spacing:-.4px;margin-bottom:12px;line-height:1.45}
.post-meta{font-size:12.5px;color:#9aa3b2;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.post-lead{margin:18px 0 6px;padding:14px 18px;background:linear-gradient(90deg,#f5f9ff,#fbfcff);
  border-left:3px solid var(--brand);border-radius:0 10px 10px 0;color:#4b5563;font-size:14px}
.post-content{margin-top:20px;font-size:16px;color:#2f3744;line-height:1.95}
.post-content h2{font-size:20px;margin:32px 0 14px;padding-left:12px;border-left:4px solid var(--brand);line-height:1.5}
.post-content h3{font-size:17px;margin:24px 0 10px;color:#1f2937}
.post-content p{margin:0 0 1.1em}
.post-content ul,.post-content ol{padding-left:22px;margin:0 0 1.1em}
.post-content li{margin-bottom:.5em}
.post-content strong{color:#111827}
.post-content figure{margin:18px 0}
.post-content figure img{border-radius:12px;width:100%;height:auto}
.post-content table{width:100%;border-collapse:collapse;margin:16px 0;font-size:14px}
.post-content th,.post-content td{border:1px solid var(--line);padding:8px 10px;text-align:left}
.post-content th{background:#f7f9fc}
.post-footer{margin-top:26px;padding-top:16px;border-top:1px dashed var(--line)}
.post-tags{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:13px}
.post-tags a{color:var(--brand);background:#eff5ff;padding:2px 9px;border-radius:999px}

.post-nav{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}
.post-nav-item{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px;
  display:flex;flex-direction:column;gap:4px;transition:.18s;box-shadow:var(--shadow)}
.post-nav-item:hover{border-color:#d7e3fb;transform:translateY(-2px)}
.post-nav-item.next{text-align:right;align-items:flex-end}
.post-nav-label{font-size:11.5px;color:#9aa3b2}
.post-nav-title{font-size:14px;color:var(--ink)}

.related{margin-top:22px}
.section-title{font-size:17px;margin-bottom:14px;padding-left:11px;border-left:4px solid var(--brand)}
.related-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.related-item{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden;
  box-shadow:var(--shadow);transition:.18s}
.related-item:hover{transform:translateY(-2px);border-color:#d7e3fb}
.related-item img{width:100%;height:96px;object-fit:cover}
.related-item span{display:block;padding:9px 10px;font-size:12.5px;color:var(--text);line-height:1.5}

/* ===== 空状态 ===== */
.empty-state{background:#fff;border:1px dashed #dbe3ef;border-radius:16px;padding:56px 20px;text-align:center}
.empty-icon{font-size:34px;margin-bottom:8px}
.empty-state h3{font-size:16px;margin-bottom:6px}

/* ===== 页脚 ===== */
.site-footer{border-top:1px solid var(--line);background:#fff;padding:24px 0;margin-top:10px}
.footer-inner{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.footer-links{display:flex;gap:14px}
.footer-links a:hover{color:var(--brand)}

/* ===== 响应式 ===== */
@media (max-width:980px){
  .layout{grid-template-columns:1fr}
  .side-col{position:static;flex-direction:row;flex-wrap:wrap}
  .side-col .widget{flex:1 1 260px}
  .related-grid{grid-template-columns:repeat(2,1fr)}
  .main-nav{display:none}
}
@media (max-width:640px){
  .header-inner{height:58px;gap:10px}
  .brand-text small{display:none}
  .search input{width:130px}
  .search input:focus{width:160px}
  .site-main{padding:16px 14px 36px}
  .post-card{flex-direction:column;gap:12px;padding:13px}
  .post-thumb{width:100%;flex:auto}
  .post-thumb img{height:150px}
  .post-detail{padding:20px 16px;border-radius:14px}
  .post-header h1{font-size:20px}
  .post-content{font-size:15.5px;line-height:1.9}
  .post-nav{grid-template-columns:1fr}
  .related-grid{grid-template-columns:repeat(2,1fr)}
}
