/* 路由实验室 RouterLab - 主题样式 */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.8;
  font-size: 16px;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 页眉 */
.site-header { background: #111827; color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.brand-text { font-size: 19px; font-weight: 700; line-height: 1.25; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; color: #9ca3af; }
.nav a { color: #d1d5db; text-decoration: none; margin-left: 22px; font-size: 15px; }
.nav a:hover { color: #fff; }

/* 首页 hero */
.hero { text-align: center; padding: 52px 20px 36px; }
.hero h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: 2px; }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }

/* 文章卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 10px 0 30px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.card-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.card-title { font-size: 18px; margin: 0 0 10px; line-height: 1.5; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-desc { font-size: 14px; color: var(--muted); margin: 0 0 12px; line-height: 1.7; }
.read-more { font-size: 14px; color: var(--brand); text-decoration: none; font-weight: 600; }
.more { text-align: center; margin: 10px 0 40px; }
.more a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* 文章页布局 */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin: 30px 0 50px; align-items: start; }
.post { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 36px 40px; }
.post-title { font-size: 28px; line-height: 1.5; margin: 6px 0 18px; }
.post-meta { color: var(--muted); font-size: 14px; }
.post-body h2 { font-size: 22px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.post-body h3 { font-size: 18px; margin: 26px 0 10px; }
.post-body p { margin: 14px 0; }
.post-body a { color: var(--brand); }
.post-body img { max-width: 100%; border-radius: 8px; }
.post-body pre {
  background: #111827; color: #e5e7eb; padding: 16px 18px; border-radius: 8px;
  overflow-x: auto; font-size: 14px; line-height: 1.65;
}
.post-body code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: Consolas, Menlo, monospace; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body blockquote {
  border-left: 4px solid var(--brand); background: #eff6ff;
  margin: 18px 0; padding: 12px 18px; border-radius: 0 8px 8px 0;
}
.post-body blockquote p { margin: 6px 0; }
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin: 8px 0; }
.table-wrap { overflow-x: auto; margin: 18px 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.post-body th { background: var(--code-bg); }
.post-tags { margin: 26px 0 6px; }
.tag {
  display: inline-block; background: #eff6ff; color: var(--brand);
  font-size: 13px; padding: 4px 12px; border-radius: 20px; text-decoration: none; margin: 0 8px 8px 0;
}
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-nav a { color: var(--brand); text-decoration: none; font-size: 15px; max-width: 48%; }

/* 侧栏 */
.sidebar { position: sticky; top: 84px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.widget h3 { margin: 0 0 10px; font-size: 16px; }
.widget p { font-size: 14px; color: var(--muted); margin: 0; }

/* 广告位 */
.ad-slot { margin: 24px 0; text-align: center; min-height: 0; }

/* 归档 / 通用页面 */
.page-title { font-size: 26px; margin: 34px 0 18px; }
.archive { list-style: none; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 50px; }
.archive li { padding: 14px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 18px; align-items: baseline; }
.archive li:last-child { border-bottom: none; }
.archive a { color: var(--text); text-decoration: none; }
.archive a:hover { color: var(--brand); }
.arch-date { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* 页脚 */
.site-footer { background: #111827; color: #9ca3af; padding: 30px 0; margin-top: 20px; }
.footer-inner { text-align: center; font-size: 14px; }
.footer-inner p { margin: 6px 0; }
.footer-links a { color: #9ca3af; text-decoration: none; margin: 0 6px; }
.footer-links a:hover { color: #fff; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post { padding: 24px 20px; }
  .post-title { font-size: 23px; }
  .nav a { margin-left: 14px; }
  .brand-text small { display: none; }
}
