:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #33322e;
  --muted: #8a8578;
  --line: #ece5da;
  --accent: #c96f4a;
  --accent-dark: #a8573a;
  --green: #5f9d6b;
  --blue: #5b86c4;
  --orange: #d99a4e;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(80, 60, 30, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
}
.container { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #e2a25f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.brand-text { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.nav { display: flex; align-items: center; gap: 16px; }
.nav-link { text-decoration: none; color: var(--muted); font-size: 14px; transition: color .2s; }
.nav-link:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff; padding: 7px 16px;
  border-radius: 20px; font-weight: 600;
}
.nav-cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Main ---------- */
.main { padding: 36px 20px 60px; min-height: 70vh; }

/* ---------- Flash ---------- */
.flash {
  padding: 11px 16px; border-radius: 12px; margin-bottom: 18px;
  font-size: 14px; border: 1px solid transparent;
}
.flash-ok { background: #eef6ef; color: #3c7a4a; border-color: #cfe6d3; }
.flash-warn { background: #fdf3e7; color: #9a6a2d; border-color: #f0dfc3; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 46px 0 38px; }
.hero-title { font-size: 32px; letter-spacing: 1px; }
.hero-sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.hero-btn {
  display: inline-block; margin-top: 22px;
  background: linear-gradient(135deg, var(--accent), #e2a25f);
  color: #fff; padding: 11px 28px; border-radius: 26px;
  text-decoration: none; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 16px rgba(201, 111, 74, .3);
  transition: transform .2s, box-shadow .2s;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201, 111, 74, .4); }

/* ---------- Filter ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  justify-content: space-between; margin-bottom: 26px;
}
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 6px 16px; border-radius: 20px; text-decoration: none;
  font-size: 13.5px; color: var(--muted); background: var(--card);
  border: 1px solid var(--line); transition: all .2s;
}
.tab:hover { color: var(--accent); border-color: var(--accent); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.archive-picker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.archive-picker select {
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 13px;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.entry { position: relative; padding-left: 34px; margin-bottom: 26px; }
.entry-dot {
  position: absolute; left: 0; top: 22px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; border: 4px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 111, 74, .12);
}
.entry-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(80,60,30,.1); }
.entry-cover img { width: 100%; height: 220px; object-fit: cover; display: block; }
.entry-body { padding: 18px 22px 20px; }
.entry-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.entry-date { letter-spacing: .5px; }
.entry-tag { color: var(--blue); }
.entry-title { font-size: 19px; margin-top: 8px; }
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.entry-excerpt { color: var(--muted); font-size: 14px; margin-top: 8px; }
.entry-more { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 13.5px; text-decoration: none; }

/* ---------- Badge ---------- */
.badge { padding: 2px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #fff; }
.badge-生活 { background: var(--green); }
.badge-学习 { background: var(--blue); }
.badge-随笔 { background: var(--orange); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 70px 0; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty .hero-btn { margin-top: 16px; }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 26px; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Form ---------- */
.post-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 30px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: #4a463e; }
.field input[type="text"], .field input[type="date"], .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 14.5px; background: #fff; color: var(--ink);
  font-family: inherit; outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 180px; line-height: 1.7; }
.field input[type="file"] { font-size: 13px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.cover-preview { margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.cover-preview img { width: 140px; height: 78px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.btn-primary {
  background: var(--accent); color: #fff; border: none; padding: 11px 30px;
  border-radius: 24px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  display: inline-block; padding: 9px 20px; border-radius: 24px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; font-size: 14px; transition: border-color .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: #f8e8e6; color: #b3503c; border: 1px solid #ecc7c0;
  padding: 9px 20px; border-radius: 24px; font-size: 14px; cursor: pointer;
}
.btn-danger:hover { background: #f0d5d0; }

/* ---------- Article detail ---------- */
.article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px 34px; box-shadow: var(--shadow); }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.article-title { font-size: 27px; margin-top: 12px; line-height: 1.4; }
.article-cover { margin-top: 20px; }
.article-cover img { width: 100%; border-radius: 14px; max-height: 420px; object-fit: cover; }
.article-body { margin-top: 24px; font-size: 15.5px; }
.article-body p { margin-bottom: 16px; }
.article-actions { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }

/* ---------- About ---------- */
.about-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 36px; text-align: center; box-shadow: var(--shadow); }
.about-icon { font-size: 48px; margin-bottom: 18px; }
.about-card p { margin-bottom: 14px; color: #4a463e; }
.about-card hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.about-foot { color: var(--accent); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 34px; text-align: center; }
.site-footer p { font-size: 13px; color: var(--muted); }
.footer-sub { font-size: 12px; margin-top: 4px; opacity: .8; }

@media (max-width: 560px) {
  .hero-title { font-size: 24px; }
  .entry-cover img { height: 160px; }
  .article { padding: 22px 18px 26px; }
  .article-title { font-size: 22px; }
}
