/* ===== CodeDuo 技术博客样式 ===== */
:root {
  --bg: #0b1020;
  --bg-soft: #111a2e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --text: #e8edf7;
  --text-muted: #9aa8bd;
  --text-dim: #64748b;
  --primary: #38bdf8;
  --accent: #a78bfa;
  --accent-2: #34d399;
  --warn: #fbbf24;
  --radius: 16px;
  --max-w: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.bg-glow { position: fixed; border-radius: 50%; filter: blur(120px); opacity: .3; pointer-events: none; z-index: 0; }
.bg-glow.one { width: 500px; height: 500px; top: -160px; right: -120px; background: #6d28d9; opacity: .18; }
.bg-glow.two { width: 420px; height: 420px; bottom: -180px; left: -100px; background: #0369a1; opacity: .16; }

/* 导航 */
header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px); background: rgba(11,16,32,.76); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg,var(--primary),var(--accent)); display: grid; place-items: center; color: #06121f; font-weight: 800; font-size: .9rem; font-family: ui-monospace,monospace; }
.brand small { font-weight: 400; color: var(--text-dim); font-size: .78rem; margin-left: 2px; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .88rem; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.nav-back { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: .82rem; color: var(--text) !important; }
.nav-back:hover { border-color: var(--primary); }

/* 页头 */
.page-head { padding: 72px 0 44px; }
.page-head .kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-size: .78rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
.page-head .kicker::before { content: ""; width: 22px; height: 1px; background: var(--primary); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; letter-spacing: -.8px; line-height: 1.2; }
.page-head h1 .grad { background: linear-gradient(100deg,var(--primary),var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { color: var(--text-muted); max-width: 660px; margin-top: 16px; font-size: 1rem; }
.meta-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; color: var(--text-dim); font-size: .82rem; }
.meta-row span { display: inline-flex; align-items: center; gap: 7px; }
.meta-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }

/* 筛选 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.filter { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .82rem; cursor: pointer; transition: all .2s; }
.filter:hover { border-color: var(--border-strong); color: var(--text); }
.filter.active { background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.4); color: var(--primary); }

/* 文章卡片 */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; padding-bottom: 50px; }
.post {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s, background .25s;
  cursor: pointer;
}
.post:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.post:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-hover); box-shadow: 0 22px 50px rgba(0,0,0,.35); }
.cover { position: relative; height: 152px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%); }
.cover-shape { position: relative; z-index: 1; display: flex; gap: 8px; align-items: flex-end; height: 66px; }
.cover-shape span { display: block; width: 12px; border-radius: 3px 3px 0 0; background: rgba(255,255,255,.82); }
.cover-badge { position: absolute; z-index: 2; top: 13px; left: 14px; font-size: .68rem; font-weight: 700; letter-spacing: .5px; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.32); color: #fff; backdrop-filter: blur(4px); }
.cover-type { position: absolute; z-index: 2; right: 14px; bottom: 12px; font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.92); }
.post-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.post h2 { font-size: 1.16rem; font-weight: 700; line-height: 1.45; margin-bottom: 9px; }
.post p { color: var(--text-muted); font-size: .87rem; flex: 1; }
.post-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--text-dim); }
.post-foot .read { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.post-tag { display: inline-block; margin-top: 12px; font-size: .72rem; padding: 3px 9px; border-radius: 6px; background: rgba(167,139,250,.1); color: #c4b5fd; border: 1px solid rgba(167,139,250,.2); align-self: flex-start; }

/* 提示条 */
.tipbar { display: flex; gap: 12px; align-items: flex-start; padding: 15px 18px; border-radius: 12px; background: rgba(52,211,153,.06); border: 1px solid rgba(52,211,153,.18); color: #a7f3d0; font-size: .86rem; margin-bottom: 30px; }
.tipbar svg { flex: none; margin-top: 2px; }

/* 页脚 */
footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 10px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; color: var(--text-dim); font-size: .82rem; }
.foot a { color: var(--text-muted); text-decoration: none; }
.foot a:hover { color: var(--primary); }
.foot-links { display: flex; gap: 18px; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .page-head { padding: 52px 0 34px; }
  .posts { grid-template-columns: 1fr; }
}
