
/* ============ 全局基础 ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: #fafbfc; color: #1a202c;
  line-height: 1.75; font-size: 16px;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: #2b6cb0; text-decoration: none; transition: color .15s; }
a:hover { color: #1a365d; text-decoration: underline; }

/* ============ 排版 ============ */
.container { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============ 顶栏 ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e3e8ee;
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-size: 18px; font-weight: 700; color: #1a202c;
  letter-spacing: -0.3px; text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: #2c5282; }
.site-logo em { font-style: normal; color: #718096; font-weight: 400; font-size: 13px; margin-left: 4px;}
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  padding: 8px 14px; color: #4a5568; font-size: 14px;
  border-radius: 4px; text-decoration: none;
}
.site-nav a:hover { color: #1a202c; background: #edf2f7; }
.site-nav a.active { color: #2c5282; background: #ebf4ff; font-weight: 500; }

/* ============ Hero ============ */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #2b6cb0 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(99,179,237,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(159,122,234,0.25) 0%, transparent 50%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: 44px; font-weight: 800; margin: 0 0 16px;
  letter-spacing: -1px; line-height: 1.2;
}
.hero h1 em { font-style: normal; color: #fbd38d; }
.hero-sub {
  font-size: 17px; opacity: 0.92; max-width: 580px; margin: 0 auto 28px;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 22px; font-size: 14px;
  border-radius: 6px; cursor: pointer; text-decoration: none;
  transition: all .15s; font-weight: 500;
  border: 1px solid transparent;
}
.btn-primary { background: #fff; color: #2c5282; }
.btn-primary:hover { background: #f7fafc; text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; text-decoration: none; }

/* ============ 文章内容 ============ */
.post-body {
  font-size: 16.5px; line-height: 1.85; color: #2d3748;
}
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  margin-top: 2em; margin-bottom: 0.6em; line-height: 1.4;
  font-weight: 700; color: #1a202c;
  scroll-margin-top: 80px;
}
.post-body h1 { font-size: 32px; }
.post-body h2 {
  font-size: 26px; padding-bottom: 0.3em;
  border-bottom: 1px solid #e2e8f0;
}
.post-body h3 { font-size: 20px; }
.post-body p { margin: 1em 0; }
.post-body ul, .post-body ol { margin: 1em 0; padding-left: 1.6em; }
.post-body li { margin: 0.4em 0; }
.post-body blockquote {
  margin: 1.5em 0; padding: 0.8em 1.2em;
  border-left: 4px solid #cbd5e0; background: #f7fafc;
  color: #4a5568; font-style: italic;
  border-radius: 0 4px 4px 0;
}
.post-body blockquote p { margin: 0.4em 0; }
.post-body hr { border: none; border-top: 1px dashed #cbd5e0; margin: 2.5em 0; }
.post-body table {
  width: 100%; margin: 1.5em 0; border-collapse: collapse; font-size: 14px;
}
.post-body th {
  text-align: left; padding: 8px 12px; background: #edf2f7;
  border: 1px solid #e2e8f0; font-weight: 600; color: #2d3748;
}
.post-body td {
  padding: 8px 12px; border: 1px solid #e2e8f0; color: #2d3748;
}
.post-body img {
  margin: 1.5em auto; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.post-body strong { font-weight: 700; color: #1a202c; }
.post-body a { color: #2b6cb0; }

/* ============ 代码高亮 ============ */
.post-body code {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
  font-size: 0.92em; padding: 0.2em 0.4em;
  background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 3px;
  color: #c7254e;
}
.post-body pre {
  margin: 1.2em 0; padding: 16px 18px; overflow-x: auto;
  background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  line-height: 1.6;
}
.post-body pre code {
  background: none; border: none; padding: 0; color: inherit; font-size: 13.5px;
}
.codehilite { background: #f7fafc; }
.codehilite pre { background: transparent; margin: 0; padding: 0; }

/* ============ TOC ============ */
.toc {
  background: #f7fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 14px 18px; margin: 1.5em 0;
  font-size: 14px;
}
.toc-title { font-weight: 600; color: #2d3748; margin-bottom: 8px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 4px 0; }
.toc-l2 { padding-left: 0; }
.toc-l3 { padding-left: 16px; font-size: 13px; color: #4a5568; }
.toc a { color: #4a5568; }
.toc a:hover { color: #2c5282; }

/* ============ 卡片网格 ============ */
.card-grid {
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  overflow: hidden; transition: all .2s ease;
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: #cbd5e0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.card-cover {
  aspect-ratio: 16 / 9; background: #edf2f7;
  overflow: hidden; position: relative;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #4299e1 0%, #9f7aea 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: 700;
}
.card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.card-meta {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: #718096; margin-bottom: 8px;
}
.card-meta .dot { width: 3px; height: 3px; background: #cbd5e0; border-radius: 50%; }
.card h3 {
  font-size: 18px; font-weight: 600; margin: 0 0 8px; line-height: 1.4;
}
.card h3 a { color: #1a202c; }
.card h3 a:hover { color: #2c5282; text-decoration: none; }
.card-summary {
  color: #4a5568; font-size: 14px; line-height: 1.6; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tag {
  font-size: 11px; padding: 2px 8px;
  background: #edf2f7; color: #4a5568; border-radius: 3px;
}
.card-footer {
  font-size: 12px; color: #718096; padding-top: 10px;
  border-top: 1px solid #edf2f7; display: flex; gap: 12px;
}
.card-footer a { color: #4a5568; }
.card-footer a:hover { color: #2c5282; }

/* ============ 列表页 ============ */
.page-header {
  padding: 50px 0 30px; text-align: center;
  border-bottom: 1px solid #e2e8f0; background: #fff;
}
.page-header h1 {
  font-size: 36px; font-weight: 700; margin: 0 0 8px;
  color: #1a202c; letter-spacing: -0.5px;
}
.page-header p { color: #718096; margin: 0; font-size: 15px; }

.list-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; gap: 12px; flex-wrap: wrap;
}
.list-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.list-filters a {
  padding: 5px 12px; border: 1px solid #e2e8f0; border-radius: 4px;
  color: #4a5568; font-size: 13px; text-decoration: none;
}
.list-filters a:hover { border-color: #cbd5e0; color: #1a202c; }
.list-filters a.active { background: #2c5282; color: #fff; border-color: #2c5282; }

/* ============ 文章详情 ============ */
.post-page { padding: 50px 0 30px; }
.post-page-header { margin-bottom: 36px; }
.post-eyebrow {
  display: inline-block; padding: 3px 10px; font-size: 12px;
  background: #ebf4ff; color: #2c5282; border-radius: 3px;
  font-weight: 500; letter-spacing: 1px; margin-bottom: 14px;
}
.post-title {
  font-size: 36px; font-weight: 800; margin: 0 0 12px;
  color: #1a202c; letter-spacing: -0.5px; line-height: 1.3;
}
.post-subtitle {
  font-size: 18px; color: #4a5568; margin: 0 0 20px;
  font-weight: 400;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 13px; color: #718096; padding: 14px 0;
  border-top: 1px solid #edf2f7; border-bottom: 1px solid #edf2f7;
}
.post-meta-item { display: flex; align-items: center; gap: 4px; }
.post-meta-item strong { color: #4a5568; font-weight: 500; }
.post-cover {
  margin: 30px 0; border-radius: 8px; overflow: hidden;
  background: #edf2f7;
}
.post-cover img { width: 100%; }

.post-summary {
  font-size: 17px; color: #2d3748; line-height: 1.8;
  padding: 20px 24px; background: #f7fafc;
  border-left: 4px solid #2c5282; border-radius: 0 6px 6px 0;
  margin: 30px 0;
}

.tech-stack {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0;
}
.tech-stack .tag { background: #ebf4ff; color: #2c5282; }

/* ============ 上下篇 ============ */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin: 60px 0 30px; padding-top: 30px; border-top: 1px solid #e2e8f0;
}
.post-nav a {
  padding: 18px 22px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px;
  text-decoration: none; transition: all .15s;
}
.post-nav a:hover { border-color: #cbd5e0; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.post-nav .label { font-size: 11px; color: #718096; letter-spacing: 2px; margin-bottom: 6px; text-transform: uppercase; }
.post-nav .title { font-size: 15px; color: #1a202c; font-weight: 500; }
.post-nav .next { text-align: right; }
.post-nav a.disabled { opacity: 0.3; pointer-events: none; }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid #e2e8f0; padding: 36px 0;
  background: #fff; color: #718096; font-size: 13px;
}
.site-footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: #4a5568; }
.site-footer-links { display: flex; gap: 18px; }
.site-footer-meta { font-family: monospace; font-size: 11px; }

/* ============ 关于页 ============ */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; padding: 50px 0; }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.avatar-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 30px; text-align: center;
}
.avatar {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px;
  background: linear-gradient(135deg, #4299e1 0%, #9f7aea 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: #fff; font-weight: 700;
}
.avatar-name { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.avatar-role { font-size: 13px; color: #2c5282; margin: 0 0 18px; }
.avatar-links { display: flex; justify-content: center; gap: 10px; }
.avatar-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid #e2e8f0; border-radius: 50%;
  color: #4a5568; text-decoration: none;
}
.avatar-links a:hover { border-color: #2c5282; color: #2c5282; }

.about-content h2 {
  font-size: 30px; margin: 0 0 18px; color: #1a202c; letter-spacing: -0.5px;
}
.about-content h2 em { font-style: normal; color: #2c5282; }
.about-content p { color: #2d3748; line-height: 1.85; margin: 0 0 18px; }
.skills-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 30px 0;
}
.skill-cat {
  padding: 16px 18px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px;
}
.skill-cat h4 {
  font-size: 13px; color: #2c5282; margin: 0 0 8px;
  letter-spacing: 1px; font-weight: 600;
}
.skill-cat .items { font-size: 13px; color: #4a5568; }
.skill-cat .items span { display: inline-block; margin-right: 8px; }

/* ============ 404 / 空状态 ============ */
.empty-state { padding: 80px 20px; text-align: center; color: #718096; }
.empty-state h2 { font-size: 24px; color: #1a202c; margin: 0 0 12px; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* ============ 评论 ============ */
.comments-section { margin-top: 60px; padding-top: 30px; border-top: 1px solid #e2e8f0; }
.comments-title { font-size: 20px; margin: 0 0 24px; color: #1a202c; }
.comment {
  padding: 16px 20px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 12px;
}
.comment-author { font-weight: 600; color: #1a202c; margin-bottom: 4px; }
.comment-meta { font-size: 12px; color: #718096; margin-bottom: 8px; }
.comment-body { color: #2d3748; line-height: 1.7; }
.comment-form {
  margin-top: 24px; padding: 20px; background: #f7fafc;
  border: 1px solid #e2e8f0; border-radius: 6px;
}
.comment-form input, .comment-form textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0;
  border-radius: 4px; font-family: inherit; font-size: 14px; margin-bottom: 8px;
}
.comment-form textarea { min-height: 100px; resize: vertical; }
.comment-form button {
  padding: 8px 18px; background: #2c5282; color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 14px;
}
.comment-form button:hover { background: #2a4365; }

/* ============ 统计卡片(首页用) ============ */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin: 40px 0;
}
.stat-card {
  padding: 18px 20px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px;
}
.stat-card .lbl { font-size: 11px; color: #718096; letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.stat-card .num { font-size: 24px; font-weight: 700; color: #1a202c; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .hero { padding: 50px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .post-title { font-size: 28px; }
  .page-header h1 { font-size: 28px; }
  .card-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .site-nav a { padding: 6px 10px; font-size: 13px; }
  .skills-grid { grid-template-columns: 1fr; }
}
