/* ==========================================================
   TechNotes 技术笔记 · 个人经验分享站
   全局样式 - 浅色主题 / 阅读排版 / 响应式
   ========================================================== */

:root {
  --bg: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1f2430;
  --text-secondary: #5b6472;
  --text-muted: #8a93a2;
  --border: #e6e9ef;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf1ff;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo,
    monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- 顶部导航 ---------------- */

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 6px;
}

.nav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

/* ---------------- 首页英雄区 ---------------- */

.hero {
  padding: 56px 0 40px;
}

.hero h1 {
  font-size: 32px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 640px;
}

.hero .badge-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------------- 区块标题 ---------------- */

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .more {
  font-size: 14px;
  font-weight: 500;
}

/* ---------------- 文章卡片列表 ---------------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.post-card h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}

.post-card h2 a {
  color: var(--text);
}

.post-card h2 a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.post-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 15px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.green {
  background: var(--green-soft);
  color: #157a3b;
}

/* ---------------- 分类面板 ---------------- */

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 8px;
}

.cat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.cat-item .cat-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-item .cat-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------------- 文章正文页 ---------------- */

.page-main {
  padding: 36px 0 48px;
}

.post-header {
  max-width: 760px;
  margin: 0 auto 28px;
}

.post-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.post-header .post-meta {
  font-size: 14px;
}

.article {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
}

.article h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}

.article p {
  margin-bottom: 16px;
  color: #333a46;
}

.article ul,
.article ol {
  margin: 0 0 16px 24px;
  color: #333a46;
}

.article li {
  margin-bottom: 6px;
}

.article blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #f0f2f7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #c026d3;
}

.article pre {
  background: #1e2330;
  color: #e5e9f0;
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.article img {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.post-nav {
  max-width: 760px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.post-nav a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 48%;
  box-shadow: var(--shadow);
}

.post-nav a:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  text-decoration: none;
}

.post-nav .next {
  text-align: right;
}

/* ---------------- 关于页 ---------------- */

.about-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
}

.about-card .avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.about-card h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.about-card p {
  color: #333a46;
  margin-bottom: 14px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}

.info-table th,
.info-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

.info-table th {
  background: var(--bg);
  font-weight: 600;
  width: 140px;
  white-space: nowrap;
}

/* ---------------- 页脚（含备案区） ---------------- */

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding: 28px 0 24px;
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-dark);
}

.beian a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.beian a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.beian .shield {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

.copyright {
  margin-top: 4px;
}

/* ---------------- 404 ---------------- */

.notfound {
  text-align: center;
  padding: 80px 20px;
}

.notfound h1 {
  font-size: 72px;
  color: var(--text-muted);
  font-weight: 800;
}

.notfound p {
  color: var(--text-secondary);
  margin: 8px 0 20px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 640px) {
  .hero {
    padding: 36px 0 28px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .post-card {
    padding: 18px;
  }

  .article,
  .about-card {
    padding: 24px 20px;
  }

  .post-header h1 {
    font-size: 23px;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav a {
    max-width: 100%;
  }

  .post-nav .next {
    text-align: left;
  }
}
