/* ═══════════════════════════════════════════
   弈剑博客 · 全站统一样式（首页/单页/内容页通用）
   ═══════════════════════════════════════════ */

/* ─────── 基础 ─────── */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --bg:#f5f4f0;
  --card:rgba(255,255,255,.62);
  --stroke:rgba(255,255,255,.45);
  --text:#1f2430;
  --sub:#6b7280;
  --accent:#6c5ce7;
  --radius:20px;
  --shadow:0 8px 32px rgba(31,38,135,.08);
}
html{ scroll-behavior:smooth; }
body{
  font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  background:var(--bg); color:var(--text);
  line-height:1.6; overflow-x:hidden;
}
a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; }
.wrap{ max-width:1200px; margin:0 auto; padding:0 20px; }
svg{ flex-shrink:0; vertical-align:-2px; }

/* ─────── 弥散光背景 ─────── */
.bg-glow{ position:fixed; inset:0; z-index:-1; overflow:hidden; }
.glow{ position:absolute; border-radius:50%; filter:blur(90px); opacity:.5; }
.g1{ width:420px; height:420px; background:#a29bfe; top:-120px; left:-80px; }
.g2{ width:380px; height:380px; background:#fd79a8; top:30%; right:-120px; }
.g3{ width:400px; height:400px; background:#81ecec; bottom:-140px; left:30%; }

/* ─────── 玻璃卡片通用 ─────── */
.glass{
  background:var(--card);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* ─────── 导航 ─────── */
.site-header{
  position:sticky; top:12px; z-index:99;
  margin:12px auto 0; max-width:1200px; border-radius:60px;
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; height:56px; padding:0 24px; }
.logo{ font-weight:800; font-size:20px; background:linear-gradient(90deg,#6c5ce7,#fd79a8); -webkit-background-clip:text; background-clip:text; color:transparent; }
.nav ul{ display:flex; gap:6px; list-style:none; }
.nav a{ padding:8px 14px; border-radius:30px; font-size:15px; transition:.25s; }
.nav a:hover{ background:rgba(108,92,231,.12); color:var(--accent); }
.menu-btn{ display:none; background:none; border:none; color:var(--text); cursor:pointer; padding:6px; }

/* ─────── 首页 Bento 网格 ─────── */
.bento{ display:grid; grid-template-columns:1fr 340px; gap:18px; padding:24px 20px 60px; align-items:start; }
.bento > .section-title,
.bento > .post-grid,
.bento > .more-wrap,
.bento > .hero,
.bento > .feature{ grid-column:1; }
.bento > .side{ grid-column:2; grid-row:2 / span 8; }

/* Hero 博主卡 */
.hero{ grid-column:1 / -1; display:flex; align-items:center; gap:22px; padding:24px 28px; flex-wrap:wrap; }
.avatar-ring{ width:76px; height:76px; border-radius:50%; padding:3px; background:linear-gradient(135deg,#6c5ce7,#fd79a8,#81ecec); }
.avatar-ring img{ width:100%; height:100%; border-radius:50%; object-fit:cover; background:#fff; }
.hero-text h1{ font-size:22px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.badge{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:500; color:var(--accent); background:rgba(108,92,231,.12); padding:3px 12px; border-radius:20px; }
.hero-text p{ color:var(--sub); font-size:14px; }
.hero-social{ margin-left:auto; display:flex; gap:10px; }
.hero-social a{ width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:rgba(255,255,255,.6); border:1px solid var(--stroke); color:var(--accent); transition:.3s; }
.hero-social a:hover{ transform:translateY(-3px); background:var(--accent); color:#fff; }

/* 头条大卡 */
.feature{ overflow:hidden; }
.feature-link{ display:grid; grid-template-columns:1.1fr 1fr; }
.feature .cover{ height:260px; border-radius:var(--radius) 0 0 var(--radius); }
.feature-body{ padding:26px; display:flex; flex-direction:column; gap:12px; justify-content:center; }
.feature-body h2{ font-size:22px; line-height:1.4; }
.intro{ color:var(--sub); font-size:14px; }
.tag-chip{ display:inline-flex; align-items:center; gap:5px; align-self:flex-start; font-size:12px; color:#fff; background:linear-gradient(90deg,#6c5ce7,#fd79a8); padding:4px 14px; border-radius:20px; }

/* 小节标题 */
.section-title{ display:flex; align-items:center; gap:14px; margin-top:10px; }
.section-title h2{ font-size:19px; }
.section-title .line{ flex:1; height:1px; background:linear-gradient(90deg,var(--accent),transparent); }

/* 文章卡流 */
.post-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }
.post{ overflow:hidden; display:flex; flex-direction:column; transition:transform .3s ease, box-shadow .3s ease; }
.post:hover{ transform:translateY(-5px); box-shadow:0 16px 40px rgba(31,38,135,.14); }
.post .cover{ height:150px; border-radius:var(--radius) var(--radius) 0 0; overflow:hidden; }
.post .cover img, .feature .cover img{ width:100%; height:100%; object-fit:cover; }
.post-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.post-title{ font-size:16px; line-height:1.45; }
.post-title a:hover{ color:var(--accent); }
.post-intro{ color:var(--sub); font-size:13px; flex:1; }
.meta{ color:#9ca3af; font-size:12px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.dot{ opacity:.5; }

/* 查看更多 */
.more-wrap{ text-align:center; margin:8px 0 20px; }
.btn-more{ display:inline-flex; align-items:center; gap:8px; padding:12px 42px; border-radius:40px; font-size:15px; font-weight:600; color:var(--accent); transition:.3s; }
.btn-more:hover{ background:var(--accent); color:#fff; transform:translateY(-2px); }

/* ─────── 侧栏（首页/内容页共用） ─────── */
.side{ display:flex; flex-direction:column; gap:18px; position:sticky; top:86px; }
.side-box{ padding:20px; }
.box-title{ display:flex; align-items:center; gap:8px; font-size:16px; margin-bottom:14px; color:var(--accent); }
.hot-list{ list-style:none; display:flex; flex-direction:column; gap:12px; }
.hot-item{ display:flex; gap:10px; align-items:center; }
.hot-cover{ width:56px; height:44px; border-radius:10px; overflow:hidden; flex-shrink:0; }
.hot-cover img{ width:100%; height:100%; object-fit:cover; }
.hot-txt{ font-size:13px; line-height:1.45; color:var(--text); }
.hot-list li:hover .hot-txt{ color:var(--accent); }
.hot-list li:nth-child(1) .hot-cover{ border-left:3px solid #fd79a8; }
.hot-list li:nth-child(2) .hot-cover{ border-left:3px solid #6c5ce7; }
.hot-list li:nth-child(3) .hot-cover{ border-left:3px solid #81ecec; }

/* 标签云 */
.tag-cloud{ display:flex; flex-wrap:wrap; gap:8px; }
.tag-pill{ font-size:12px; padding:5px 12px; border-radius:20px; transition:.25s; }
.tag-pill i{ font-style:normal; opacity:.6; margin-left:3px; }
.c0{ background:#e8e6ff; color:#5b4bcf; } .c1{ background:#ffe3ee; color:#d63384; }
.c2{ background:#e0f7f7; color:#0b8c8c; } .c3{ background:#fff3d6; color:#b37700; }
.c4{ background:#e3f2e3; color:#2e7d32; }
.tag-pill:hover{ transform:translateY(-2px); filter:brightness(.96); }

.notice{ font-size:13px; color:var(--sub); }

/* ─────── 内容页 / 单页布局 ─────── */
.page-layout{ display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:18px; padding:24px 20px 60px; align-items:start; }
.page-main{ display:flex; flex-direction:column; gap:18px; min-width:0; }

/* 面包屑 */
.crumbs{ display:flex; align-items:center; gap:8px; padding:12px 20px; font-size:13px; color:var(--sub); border-radius:14px; }
.crumbs a:hover{ color:var(--accent); }
.crumbs .sep{ display:flex; opacity:.5; }
.crumbs svg{ color:var(--accent); }

/* 正文卡 */
.page-card{ padding:32px 36px 28px; }
.page-head h1{ font-size:26px; line-height:1.35; }
.page-sub{ display:flex; align-items:center; gap:6px; color:var(--sub); font-size:14px; margin-top:8px; }
.page-sub svg{ color:var(--accent); }
.divider{ height:1px; margin:22px 0; background:linear-gradient(90deg,var(--accent),rgba(108,92,231,.05)); }

/* 文章元信息 */
.art-meta{ display:flex; flex-wrap:wrap; gap:16px; color:var(--sub); font-size:13px; margin-top:10px; }
.m-item{ display:inline-flex; align-items:center; gap:5px; }
.m-item svg{ color:var(--accent); }

/* 联系信息拼卡（单页用） */
.contact-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-bottom:26px; }
.contact-item{
  display:flex; flex-direction:column; gap:3px; padding:18px;
  background:rgba(255,255,255,.55); border:1px solid var(--stroke);
  border-radius:16px; transition:transform .3s ease, box-shadow .3s ease;
}
.contact-item:hover{ transform:translateY(-4px); box-shadow:0 12px 30px rgba(31,38,135,.12); }
.ci-icon{ width:42px; height:42px; display:grid; place-items:center; border-radius:12px; margin-bottom:6px; color:#fff; }
.i1{ background:linear-gradient(135deg,#6c5ce7,#a29bfe); }
.i2{ background:linear-gradient(135deg,#fd79a8,#e17055); }
.i3{ background:linear-gradient(135deg,#0984e3,#74b9ff); }
.i4{ background:linear-gradient(135deg,#00b894,#55efc4); }
.ci-label{ font-size:12px; color:#9ca3af; }
.ci-value{ font-size:14px; font-weight:600; color:var(--text); word-break:break-all; }

/* 普通正文排版（单页用） */
.page-content{ font-size:15px; color:#374151; }
.page-content p{ margin:0 0 14px; }
.page-content h2,.page-content h3{ color:var(--text); margin:24px 0 12px; }
.page-content a{ color:var(--accent); border-bottom:1px dashed rgba(108,92,231,.4); }
.page-content img{ border-radius:14px; margin:10px 0; }
.page-content ul,.page-content ol{ padding-left:22px; margin:0 0 14px; }
.page-content blockquote{
  margin:0 0 14px; padding:12px 18px; border-left:3px solid var(--accent);
  background:rgba(108,92,231,.06); border-radius:0 12px 12px 0; color:var(--sub);
}
.page-content table{ width:100%; border-collapse:collapse; margin:0 0 14px; }
.page-content th,.page-content td{ border:1px solid rgba(0,0,0,.08); padding:8px 12px; font-size:14px; }

/* 文章正文排版（内容页用，阅读优化） */
.art-content{ font-size:15.5px; line-height:1.85; color:#374151; }
.art-content h1,.art-content h2,.art-content h3{ color:var(--text); line-height:1.4; margin:28px 0 14px; }
.art-content h2{ font-size:20px; padding-left:12px; border-left:4px solid var(--accent); }
.art-content h3{ font-size:17px; }
.art-content p{ margin:0 0 16px; }
.art-content a{ color:var(--accent); border-bottom:1px dashed rgba(108,92,231,.4); }
.art-content img{ border-radius:14px; margin:12px auto; box-shadow:var(--shadow); }
.art-content ul,.art-content ol{ padding-left:24px; margin:0 0 16px; }
.art-content li{ margin-bottom:6px; }
.art-content blockquote{
  margin:0 0 16px; padding:14px 18px; border-left:3px solid var(--accent);
  background:rgba(108,92,231,.06); border-radius:0 12px 12px 0; color:var(--sub);
}
.art-content pre{
  background:#1f2430; color:#e5e7eb; border-radius:14px;
  padding:16px 18px; overflow-x:auto; margin:0 0 16px; font-size:13.5px; line-height:1.7;
}
.art-content code{ background:rgba(108,92,231,.1); color:var(--accent); padding:2px 7px; border-radius:6px; font-size:.9em; }
.art-content pre code{ background:none; color:inherit; padding:0; }
.art-content table{ width:100%; border-collapse:collapse; margin:0 0 16px; }
.art-content th{ background:rgba(108,92,231,.08); }
.art-content th,.art-content td{ border:1px solid rgba(0,0,0,.08); padding:9px 13px; font-size:14px; }

/* 本文标签 */
.art-tags{ margin-top:28px; padding-top:20px; border-top:1px dashed rgba(0,0,0,.08); }
.at-label{ display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--sub); margin-bottom:10px; }
.at-label svg{ color:var(--accent); }

/* 上一篇 / 下一篇 */
.pn-nav{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.pn-box{ padding:18px 22px; transition:transform .3s ease, box-shadow .3s ease; }
.pn-box:hover{ transform:translateY(-4px); box-shadow:0 14px 34px rgba(31,38,135,.14); }
.pn-box.next{ text-align:right; }
.pn-label{ display:inline-flex; align-items:center; gap:4px; font-size:12px; color:#9ca3af; }
.pn-label svg{ color:var(--accent); }
.pn-title{ margin-top:6px; font-size:14.5px; font-weight:600; line-height:1.5; }
.pn-title a{ color:var(--text); }
.pn-title a:hover{ color:var(--accent); }

/* 评论区 */
.comment-card{ padding:26px 30px 30px; }
.cm-count{ font-size:12px; font-weight:400; color:#9ca3af; margin-left:6px; }
.comment-card input[type=text],.comment-card textarea{
  width:100%; padding:11px 15px; border-radius:12px; font-size:14px;
  border:1px solid rgba(0,0,0,.1); background:rgba(255,255,255,.7);
  outline:none; transition:.25s; font-family:inherit;
}
.comment-card input:focus,.comment-card textarea:focus{
  border-color:var(--accent); box-shadow:0 0 0 3px rgba(108,92,231,.15);
}
.comment-card textarea{ min-height:110px; resize:vertical; }
.comment-card input[type=submit],.comment-card button{
  display:inline-flex; align-items:center; gap:6px; padding:11px 34px;
  border:none; border-radius:40px; cursor:pointer; font-size:14px; font-weight:600;
  background:linear-gradient(90deg,#6c5ce7,#a29bfe); color:#fff; transition:.3s;
}
.comment-card input[type=submit]:hover,.comment-card button:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(108,92,231,.35); }
.comment-card .pl-item{ padding:16px 0; border-bottom:1px dashed rgba(0,0,0,.07); }
.comment-card .pl-item:last-child{ border-bottom:none; }

/* 页面底部操作 */
.page-foot{ margin-top:26px; padding-top:20px; border-top:1px dashed rgba(0,0,0,.08); display:flex; justify-content:space-between; }
.btn-ghost{
  display:inline-flex; align-items:center; gap:6px; padding:10px 26px;
  border-radius:40px; border:1px solid rgba(108,92,231,.35);
  color:var(--accent); font-size:14px; transition:.3s;
}
.btn-ghost:hover{ background:var(--accent); color:#fff; transform:translateY(-2px); }

/* ─────── 页脚 / 返回顶部 ─────── */
.site-footer{ text-align:center; padding:30px 0 40px; color:#9ca3af; font-size:13px; }
.back-top{
  position:fixed; right:24px; bottom:30px; width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:50%; border:none; cursor:pointer;
  background:var(--accent); color:#fff; opacity:0; pointer-events:none;
  transition:.3s; box-shadow:0 8px 24px rgba(108,92,231,.4); z-index:99;
}
.back-top.show{ opacity:1; pointer-events:auto; }
.back-top:hover{ transform:translateY(-4px); }

/* ─────── 骨架屏 & 懒加载动效 ─────── */
.skeleton{
  background:linear-gradient(90deg,#ececec 25%,#f7f7f7 50%,#ececec 75%);
  background-size:200% 100%;
  animation:shimmer 1.4s infinite;
}
@keyframes shimmer{ to{ background-position:-200% 0; } }
.cover img{ opacity:0; transform:scale(1.06); transition:opacity .6s ease, transform .6s ease; }
.cover img.loaded{ opacity:1; transform:scale(1); }

/* 滚动渐入 */
[data-animate]{ opacity:0; transform:translateY(24px); transition:opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1); }
[data-animate].in{ opacity:1; transform:translateY(0); }

/* ─────── 移动端自适应 ─────── */
@media (max-width:900px){
  .bento{ grid-template-columns:1fr; }
  .bento > .side{ grid-column:1; grid-row:auto; position:static; }
  .page-layout{ grid-template-columns:1fr; }
  .side{ position:static; }
  .feature-link{ grid-template-columns:1fr; }
  .feature .cover{ border-radius:var(--radius) var(--radius) 0 0; height:180px; }
  .nav{ display:none; }
  .menu-btn{ display:block; }
  .nav.open{ display:block; position:absolute; top:60px; left:12px; right:12px;
    background:rgba(255,255,255,.95); border-radius:16px; padding:10px; box-shadow:var(--shadow); }
  .nav.open ul{ flex-direction:column; }
  .hero-social{ margin-left:0; }
  .page-card{ padding:24px 20px; }
  .page-foot{ flex-direction:column; gap:12px; }
  .pn-nav{ grid-template-columns:1fr; }
  .pn-box.next{ text-align:left; }
  .comment-card{ padding:20px 18px; }
}



/* ═══════════ 列表页 ═══════════ */
.list-head{ padding:24px 30px; }
.list-head h1{ display:flex; align-items:center; gap:10px; font-size:24px; }
.list-head h1 svg{ color:var(--accent); }
.lh-count{ font-size:12px; font-weight:500; color:var(--accent); background:rgba(108,92,231,.12); padding:3px 12px; border-radius:20px; }

/* 横版文章卡 */
.list-wrap{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.list-card{ display:grid; grid-template-columns:230px 1fr; overflow:hidden; transition:transform .3s ease, box-shadow .3s ease; }
.list-card:hover{ transform:translateY(-4px); box-shadow:0 16px 40px rgba(31,38,135,.14); }
.list-cover{ height:150px; overflow:hidden; }
.list-cover:first-child{ border-radius:var(--radius) 0 0 var(--radius); }
.list-cover img{ width:100%; height:100%; object-fit:cover; }
.list-body{ padding:18px 24px; display:flex; flex-direction:column; gap:8px; }
.list-body .post-title{ font-size:17px; }
.list-body .post-intro{ color:var(--sub); font-size:13.5px; flex:1; }
.list-body .meta{ margin-top:auto; }

/* 分页 */
.pagination{ padding:18px 24px; text-align:center; font-size:14px; color:var(--sub); }
.pagination a, .pagination b{
  display:inline-block; padding:7px 15px; margin:3px; border-radius:10px;
  background:rgba(255,255,255,.6); border:1px solid var(--stroke);
  color:var(--text); font-weight:400; transition:.25s;
}
.pagination b{ background:linear-gradient(90deg,#6c5ce7,#a29bfe); color:#fff; border-color:transparent; }
.pagination a:hover{ background:var(--accent); color:#fff; transform:translateY(-2px); }

@media (max-width:900px){
  .list-card{ grid-template-columns:120px 1fr; }
  .list-cover{ height:100%; min-height:100px; }
  .list-cover:first-child{ border-radius:var(--radius) 0 0 var(--radius); }
  .list-body{ padding:14px 16px; }
  .list-head{ padding:20px; }
  .list-head h1{ font-size:20px; }
}


/* ═══════════ 长文分页导航 ═══════════ */
.art-pagebar{ margin-top:26px; padding-top:20px; border-top:1px dashed rgba(0,0,0,.08); text-align:center; font-size:14px; color:var(--sub); }
.art-pagebar a, .art-pagebar b{
  display:inline-block; padding:7px 16px; margin:3px; border-radius:10px;
  background:rgba(255,255,255,.6); border:1px solid var(--stroke);
  color:var(--text); transition:.25s;
}
.art-pagebar b{ background:linear-gradient(90deg,#6c5ce7,#a29bfe); color:#fff; border-color:transparent; }
.art-pagebar a:hover{ background:var(--accent); color:#fff; transform:translateY(-2px); }
