/* ============ 设计变量 ============ */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1a1a2e;
  --muted: #6f6f85;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --border: #e9e6e0;
  --code-bg: #f1f0ec;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, .06), 0 1px 2px rgba(26, 26, 46, .04);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, .10), 0 2px 8px rgba(26, 26, 46, .06);
  --serif: Georgia, "Times New Roman", "Source Han Serif SC", "Noto Serif SC", "STZhongsong", "SimSun", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 247, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700; letter-spacing: .04em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-family: var(--serif);
  box-shadow: var(--shadow-sm);
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a {
  font-size: .95rem; color: var(--muted); position: relative; padding: 4px 0;
  transition: color .2s;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s; border-radius: 2px;
}
.site-header nav a:hover::after { width: 100%; }

/* ============ 首页 Hero ============ */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(124, 58, 237, .55), transparent),
    radial-gradient(ellipse 70% 70% at 20% 0%, rgba(79, 70, 229, .75), transparent),
    #1e1b4b;
  color: #fff;
  position: relative;
  padding: 110px 24px 150px;
  text-align: center;
}
.hero-inner { max-width: 820px; margin: 0 auto; }
.hero-kicker {
  font-size: .8rem; letter-spacing: .35em; margin: 0 0 18px;
  color: rgba(255, 255, 255, .65); font-weight: 600;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  margin: 0 0 20px; letter-spacing: .06em; font-weight: 700;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255, 255, 255, .78);
  margin: 0; max-width: 560px; margin-inline: auto; line-height: 1.9;
}
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; }
.hero-wave svg { width: 100%; height: 90px; display: block; }

/* ============ 文章卡片区 ============ */
.archive { max-width: 1120px; margin: 0 auto; padding: 30px 24px 80px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
}
.section-head h2 {
  font-family: var(--serif); font-size: 1.7rem; margin: 0; letter-spacing: .05em;
}
.section-head .more { color: var(--muted); font-size: .92rem; transition: color .2s; }
.section-head .more:hover { color: var(--accent); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 28px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(233, 230, 224, .8);
  display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card-cover {
  display: block; aspect-ratio: 16 / 9; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #312e81, #4f46e5 55%, #7c3aed);
}
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }
.cover-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 3.2rem; color: rgba(255, 255, 255, .9);
  letter-spacing: 0;
}
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px;
}
.card-title { margin: 0 0 10px; font-family: var(--serif); font-size: 1.18rem; line-height: 1.5; }
.card-title a { transition: color .2s; }
.card-title a:hover { color: var(--accent); }
.card-summary {
  margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.8; flex: 1;
}

/* ============ 分页 ============ */
.pagination { margin-top: 48px; display: flex; justify-content: center; gap: 8px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  font-size: .9rem; color: var(--muted); transition: all .2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; }

/* ============ 文章页 ============ */
.post { max-width: 780px; margin: 0 auto; padding: 0 24px 70px; }
.post-head { padding: 60px 0 10px; text-align: center; }
.post-title {
  font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.4; margin: 0 0 18px; letter-spacing: .03em;
}
.post-hero {
  height: min(52vh, 460px);
  background-size: cover; background-position: center;
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
  margin: 0 calc(50% - 50vw);
  width: 100vw;
}
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 38, .15), rgba(20, 18, 38, .78));
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 24px 44px; text-align: center; color: #fff;
}
.post-hero-title {
  font-family: var(--serif); font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  margin: 0 0 16px; line-height: 1.4; letter-spacing: .03em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}
.post-hero-meta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: .88rem; color: rgba(255, 255, 255, .85); letter-spacing: .1em;
}
.post:not(:has(.post-hero)) .post-hero-meta { color: var(--muted); }

/* 正文排版 */
.content { padding-top: 36px; font-size: 1.04rem; }
.content p { margin: 0 0 1.35em; color: #2c2c3e; text-align: justify; }
.content h2 {
  font-family: var(--serif); font-size: 1.55rem; margin: 2.4em 0 1em;
  letter-spacing: .04em; position: relative; padding-left: 16px;
}
.content h2::before {
  content: ""; position: absolute; left: 0; top: .28em; bottom: .28em; width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.content h3 { font-family: var(--serif); font-size: 1.25rem; margin: 2em 0 .9em; }
.content a { color: var(--accent); border-bottom: 1px solid rgba(79, 70, 229, .3); }
.content a:hover { border-bottom-color: var(--accent); }
.content ul, .content ol { padding-left: 1.5em; margin: 0 0 1.35em; }
.content li { margin-bottom: .45em; color: #2c2c3e; }
.content blockquote {
  margin: 1.8em 0; padding: 16px 22px;
  background: linear-gradient(90deg, rgba(79, 70, 229, .06), transparent);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0; color: #44445c;
}
.content blockquote p:last-child { margin-bottom: 0; }
.content code {
  background: var(--code-bg); padding: .15em .45em; border-radius: 6px;
  font-size: .88em; font-family: Consolas, "Courier New", monospace;
}
.content pre {
  background: #191927; color: #e6e6f0; padding: 20px 24px; border-radius: 14px;
  overflow-x: auto; font-size: .9rem; line-height: 1.7; box-shadow: var(--shadow-sm);
}
.content pre code { background: none; padding: 0; color: inherit; }
.content figure { margin: 2.2em 0; }
.content figure img {
  width: 100%; border-radius: 14px; box-shadow: var(--shadow-md);
}
.content figcaption {
  text-align: center; margin-top: 12px; font-size: .85rem; color: var(--muted);
  letter-spacing: .05em;
}
.content table {
  width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: .94rem;
}
.content th {
  background: #f3f1ec; font-weight: 600; text-align: left; letter-spacing: .04em;
}
.content th, .content td { padding: 10px 14px; border: 1px solid var(--border); }
.content hr { border: none; border-top: 1px solid var(--border); margin: 2.6em 0; }

/* 文章尾部 */
.post-foot { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 26px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tag {
  font-size: .82rem; padding: 5px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: all .2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.post-sign { text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: .12em; margin: 0; }

/* ============ 列表页标题 ============ */
.page-head {
  background: linear-gradient(135deg, #1e1b4b, #4f46e5);
  color: #fff; text-align: center; padding: 52px 24px 44px;
}
.page-title { font-family: var(--serif); font-size: 1.9rem; margin: 0; letter-spacing: .08em; }

/* ============ 关于页 ============ */
.about .content { padding-top: 20px; }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center; padding: 44px 24px 40px; color: var(--muted);
}
.footer-brand {
  font-family: var(--serif); font-size: 1.15rem; color: var(--ink);
  margin: 0 0 8px; letter-spacing: .1em;
}
.site-footer p { margin: 0 0 6px; font-size: .88rem; }
.footer-meta { font-size: .8rem; opacity: .75; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .hero { padding: 76px 20px 120px; }
  .card-grid { grid-template-columns: 1fr; gap: 22px; }
  .header-inner { padding: 12px 18px; }
  .site-header nav { gap: 18px; }
  .archive { padding: 22px 18px 60px; }
  .post-hero { height: 42vh; }
}
