/* ============================================
   shileo 的个人网站 · 全站统一样式
   风格：暖纸底色 + 衬线标题 + 卡片式布局
   修改颜色只需改下面 :root 里的变量
   ============================================ */

:root {
  --paper: #faf7f2;          /* 页面底色：暖纸白 */
  --card: #ffffff;           /* 卡片底色 */
  --ink: #2b2620;            /* 正文主色：暖黑 */
  --ink-soft: #6b6154;       /* 次要文字 */
  --ink-faint: #a89a86;      /* 更弱文字（日期、提示） */
  --accent: #b4632a;         /* 强调色：赭橙 */
  --accent-soft: #f6e8dc;    /* 强调色浅底 */
  --line: #e8e0d4;           /* 分隔线 */
  --radius: 14px;
  --shadow: 0 2px 10px rgba(90, 66, 40, 0.06);
  --shadow-hover: 0 8px 28px rgba(90, 66, 40, 0.12);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-title: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

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

html { font-size: 16px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局容器 ---------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-logo span { color: var(--accent); }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  margin-left: 22px;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- 首页 Hero ---------- */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-family: var(--font-title);
  font-size: 2.1rem;
  line-height: 1.35;
  margin-bottom: 14px;
}
.hero p {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 560px;
}

/* ---------- 区块标题 ---------- */
.section { padding: 44px 0 8px; }
.section-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
  transform: translateY(-4px);
}
.section-desc {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-bottom: 22px;
}

/* ---------- 工具卡片 ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tool-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.tool-card p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}
.tool-card .tool-tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; }
.post-item {
  border-bottom: 1px solid var(--line);
}
.post-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 4px;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s;
}
.post-item a:hover { color: var(--accent); }
.post-item .post-title { font-size: 1.02rem; }
.post-item .post-date {
  color: var(--ink-faint);
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 文章正文页 ---------- */
.post-header { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.post-header h1 {
  font-family: var(--font-title);
  font-size: 1.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
}
.post-meta { color: var(--ink-faint); font-size: 0.88rem; }

.post-body { padding: 36px 0 60px; }
.post-body h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  margin: 40px 0 14px;
}
.post-body h3 { font-size: 1.1rem; margin: 30px 0 10px; }
.post-body p { margin-bottom: 16px; }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--accent); }
.post-body code {
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.88em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.post-body pre {
  background: #2b2620;
  color: #f2ece2;
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin-bottom: 18px;
  font-size: 0.85rem;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 18px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 18px;
  color: var(--ink-soft);
}
.post-body img { max-width: 100%; border-radius: 10px; }

/* 文章底部返回链接 */
.post-footer { padding-bottom: 56px; }
.post-footer a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
}
.post-footer a:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  margin-top: 48px;
  color: var(--ink-faint);
  font-size: 0.84rem;
  text-align: center;
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 600px) {
  .hero { padding: 44px 0 30px; }
  .hero h1 { font-size: 1.6rem; }
  .post-header h1 { font-size: 1.45rem; }
  .site-nav a { margin-left: 14px; }
}
