/* ==========================================================
   清清哥的小屋 · 前台样式（诗与远方 · 藏青夜空风）
   暖纸底色 × 藏青夜色 × 月光金点缀 × 衬线标题
   ========================================================== */
:root {
  --navy: #2b4a72;          /* 藏青 · 主色 */
  --navy-dark: #1d3557;
  --navy-deep: #14233f;     /* 深色区（横幅/页脚） */
  --mist: #7d93b0;          /* 雾蓝 · 辅助 */
  --gold: #e8c987;          /* 月光金 · 点缀 */
  --gold-deep: #b98a2f;     /* 深金 · 强调/hover */
  --paper: #eef1f6;         /* 冷灰蓝 · 页面底色（夜空天光） */
  --card: #fbfcfe;          /* 冷白 · 卡片 */
  --ink: #2f3644;           /* 墨色正文（微蓝） */
  --ink-soft: #69727f;      /* 浅墨 */
  --line: #d9dfe8;          /* 冷色分隔线 */
  --tint: #e4eaf2;          /* 淡藏青（选中/hover 底） */
  --serif: Georgia, "Noto Serif SC", "Songti SC", "STSong", "SimSun", "KaiTi", "STKaiti", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 35, 63, .07), 0 6px 18px rgba(20, 35, 63, .06);
  --shadow-lg: 0 10px 34px rgba(20, 35, 63, .16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  background-image: radial-gradient(rgba(74, 111, 165, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); text-decoration: none; transition: color .18s; }
a:hover { color: var(--gold-deep); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
.narrow { max-width: 820px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(238, 241, 246, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }

.logo { display: flex; align-items: center; gap: 9px; color: var(--navy-deep); font-size: 19px; letter-spacing: 1px; }
.logo-mark { width: 30px; height: 30px; color: var(--navy); flex-shrink: 0; transition: color .18s; }
.logo span { font-family: var(--serif); font-weight: 700; }
.logo:hover { color: var(--gold-deep); }
.logo:hover .logo-mark { color: var(--gold-deep); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 7px 15px; border-radius: 8px; color: var(--ink-soft); font-size: 15px; font-weight: 500;
  transition: all .18s;
}
.nav-link:hover { color: var(--navy); background: var(--tint); }
.nav-link.active { color: var(--navy-dark); background: var(--tint); font-weight: 700; }
.nav-search { display: flex; align-items: center; margin-left: 8px; }
.nav-search input {
  width: 130px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px 0 0 8px;
  font-size: 14px; outline: none; background: var(--card); color: var(--ink); transition: width .2s;
}
.nav-search input:focus { width: 190px; border-color: var(--gold-deep); }
.nav-search button {
  padding: 7px 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0;
  background: var(--card); cursor: pointer; font-size: 13px;
}
.nav-admin { margin-left: 6px; font-size: 15px; opacity: .75; }
.nav-admin:hover { opacity: 1; color: var(--navy); }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); }

/* ---------- Hero（藏青月夜） ---------- */
.hero {
  background:
    radial-gradient(560px 300px at 78% -8%, rgba(232, 201, 135, .18), transparent 62%),
    radial-gradient(640px 360px at 12% 115%, rgba(123, 156, 210, .14), transparent 60%),
    linear-gradient(165deg, var(--navy-deep), #1a2e4d 55%, #213a5e);
  color: #f2ecdc;
  padding: 66px 0 58px;
  position: relative;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-moon {
  position: absolute; top: 34px; right: 13%;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #f7e6b8, var(--gold) 62%, #d9b26a);
  box-shadow: 0 0 46px rgba(232, 201, 135, .6);
  animation: moonGlow 5s ease-in-out infinite;
}
@keyframes moonGlow { 0%, 100% { box-shadow: 0 0 46px rgba(232,201,135,.6); } 50% { box-shadow: 0 0 66px rgba(232,201,135,.8); } }
.hero-birds { position: absolute; top: 44px; left: 12%; width: 150px; color: rgba(242, 236, 220, .5); }
.hero-mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 52%; }
.hero-inner { position: relative; text-align: center; }
.hero-poem {
  font-family: var(--serif); font-style: italic; color: var(--gold);
  font-size: 15.5px; letter-spacing: 3px; margin-bottom: 14px; opacity: .95;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; font-size: 38px; letter-spacing: 2px;
  margin-bottom: 12px; color: #fbf6e9; text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero-sub { font-size: 16.5px; color: #b9c7dd; max-width: 620px; margin: 0 auto 30px; letter-spacing: 1px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; }

.btn {
  display: inline-block; padding: 10px 26px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .18s; text-align: center; font-family: var(--sans);
}
.btn-primary {
  background: linear-gradient(135deg, #f0d9a6, var(--gold) 55%, #d9b26a);
  color: var(--navy-dark) !important;
}
.btn-primary:hover { background: linear-gradient(135deg, #f5e2b5, #eccf8f); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #f2ecdc !important; border-color: rgba(232, 201, 135, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.btn-outline { background: var(--card); color: var(--navy) !important; border-color: var(--navy); }
.btn-outline:hover { background: var(--tint); }
.btn-danger { background: #b3563f; color: #fff !important; }
.btn-danger:hover { background: #97432f; }
.btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 统计卡片（星笺） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -34px; position: relative; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; text-align: center; transition: all .2s; color: var(--ink);
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.stat-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.stat-num { font-size: 25px; font-weight: 800; color: var(--gold-deep); font-family: var(--serif); }
.stat-label { color: var(--ink-soft); font-size: 14px; }

/* ---------- 区块标题（带装饰） ---------- */
.section { padding: 46px 0 10px; }
.section-title {
  font-family: var(--serif); font-size: 22px; font-weight: 700; margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px; color: var(--navy-dark);
}
.section-title::before { content: '❦'; color: var(--gold-deep); font-size: 16px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }

/* ---------- Tab ---------- */
.tab-bar { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-soft); transition: all .18s;
}
.tab-btn:hover { border-color: var(--navy); color: var(--navy); }
.tab-btn.active { background: var(--navy); color: #f2ecdc; border-color: var(--navy); }

/* ---------- 卡片（纸笺） ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.list-grid { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: all .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.card-cover img { width: 100%; height: 150px; object-fit: cover; display: block; }
.card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.5; font-family: var(--serif); }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--gold-deep); }
.card-summary { color: var(--ink-soft); font-size: 14px; flex: 1; }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 11px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--tint); color: var(--navy-dark);
}
.badge-cat { background: #dbe7f5; color: #2b4a72; }
.badge-top { background: #f6e3c2; color: #96633a; }
.tag-mini { color: var(--mist); font-size: 12.5px; }
.meta-date, .meta-views { white-space: nowrap; }

.more-link { display: inline-block; margin-top: 18px; color: var(--gold-deep); font-weight: 700; }
.more-link:hover { color: var(--navy); text-decoration: underline; }

/* ---------- 首页 about 条 ---------- */
.about-strip {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 38px; margin: 42px auto 12px;
}
.about-strip p { color: var(--ink-soft); margin-bottom: 18px; }

/* ---------- 列表页 ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--navy-dark); }
.page-sub { color: var(--ink-soft); margin-top: 4px; letter-spacing: 1px; }
.list-layout { display: grid; grid-template-columns: 224px 1fr; gap: 26px; padding: 26px 20px 44px; }
.sidebar {
  position: sticky; top: 80px; align-self: start; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.sidebar h3 { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; font-weight: 700; letter-spacing: 2px; }
.side-link {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14px; margin-bottom: 2px;
}
.side-link em { font-style: normal; color: var(--ink-soft); font-size: 12px; background: var(--paper); padding: 1px 8px; border-radius: 10px; }
.side-link:hover, .side-link.active { background: var(--tint); color: var(--navy); }
.list-main.full { grid-column: 1 / -1; }
.empty-state { text-align: center; padding: 60px 0; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 15px; border-radius: 8px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font-size: 14px;
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: #f2ecdc; border-color: var(--navy); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- 详情页 ---------- */
.post-page { max-width: 860px; }
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 44px 48px; margin-top: 28px;
}
.post-header { margin-bottom: 26px; }
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.post h1 { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.4; color: var(--navy-dark); }
.post-summary {
  margin-top: 14px; padding: 14px 20px; background: var(--tint); border-left: 3px solid var(--gold-deep);
  color: var(--ink-soft); border-radius: 0 8px 8px 0; font-size: 15px; font-style: italic;
}
.post-cover { width: 100%; border-radius: 10px; margin-top: 18px; max-height: 420px; object-fit: cover; border: 1px solid var(--line); }
.post-footer { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.tag { background: var(--tint); padding: 3px 13px; border-radius: 20px; font-size: 13px; color: var(--navy); border: 1px solid transparent; }
.tag:hover { background: #dbe7f5; color: var(--navy-dark); }
.post-nav { display: flex; gap: 14px; }
.pn-card {
  flex: 1; display: flex; flex-direction: column; gap: 4px; background: var(--paper); padding: 14px 18px;
  border-radius: 10px; color: var(--ink); transition: all .18s; border: 1px solid transparent;
}
.pn-card.right { text-align: right; }
.pn-card:hover { background: var(--tint); border-color: var(--line); }
.pn-card span { font-size: 12.5px; color: var(--ink-soft); }
.pn-card b { font-size: 14px; font-weight: 600; }

/* ---------- Markdown 正文 ---------- */
.markdown-body { font-size: 16px; line-height: 1.9; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--serif); font-weight: 700; margin: 1.6em 0 .7em; line-height: 1.45; color: var(--navy-dark);
}
.markdown-body h1 { font-size: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.markdown-body h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: .9em 0; }
.markdown-body a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body a:hover { color: var(--gold-deep); }
.markdown-body img { max-width: 100%; border-radius: 10px; margin: .6em 0; border: 1px solid var(--line); }
.markdown-body blockquote {
  margin: 1.1em 0; padding: 13px 20px; background: var(--tint); border-left: 4px solid var(--gold-deep);
  border-radius: 0 8px 8px 0; color: #4a5568; font-style: italic;
}
.markdown-body blockquote::before { content: '「'; color: var(--gold-deep); }
.markdown-body blockquote::after { content: '」'; color: var(--gold-deep); }
.markdown-body code {
  background: var(--tint); padding: 2px 7px; border-radius: 6px; font-family: Consolas, "Courier New", monospace;
  font-size: .88em; color: #3d5a80;
}
.markdown-body pre {
  background: var(--navy-deep); color: #e4e9f2; padding: 18px 20px; border-radius: 12px; overflow-x: auto;
  margin: 1.1em 0; line-height: 1.65; border: 1px solid rgba(232, 201, 135, .18);
}
.markdown-body pre code { background: none; color: inherit; padding: 0; font-size: 14px; }
.markdown-body ul, .markdown-body ol { margin: .8em 0; padding-left: 1.7em; }
.markdown-body li { margin: .3em 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1.1em 0; font-size: 15px; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 9px 14px; text-align: left; }
.markdown-body th { background: var(--tint); font-weight: 700; color: var(--navy-dark); }
.markdown-body tr:nth-child(even) td { background: #f3f6fa; }
.markdown-body hr { border: 0; border-top: 2px solid var(--line); margin: 1.6em 0; }

/* ---------- 评论区 ---------- */
.comments { margin: 40px 0 60px; }
.comment-list { margin-bottom: 24px; }
.comment-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 12px;
}
.comment-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.comment-head b { color: var(--navy); }
.comment-head span { color: var(--ink-soft); }
.comment-item p { font-size: 14.5px; color: #475069; }
.comment-empty { color: var(--ink-soft); text-align: center; padding: 26px; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; }
.comment-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; }
.comment-form h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 14px; color: var(--navy-dark); }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row input { flex: 1; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; background: var(--paper); color: var(--ink);
  transition: border-color .18s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--gold-deep); background: #fff; }
.comment-form textarea { min-height: 100px; resize: vertical; margin-bottom: 12px; }
.form-tip { margin-left: 12px; color: var(--ink-soft); font-size: 13px; }
.form-msg { margin-top: 10px; font-size: 14px; }

/* ---------- 关于页 ---------- */
.about-hero {
  background:
    radial-gradient(560px 300px at 78% -8%, rgba(232, 201, 135, .18), transparent 62%),
    radial-gradient(640px 360px at 12% 115%, rgba(123, 156, 210, .14), transparent 60%),
    linear-gradient(165deg, var(--navy-deep), #1a2e4d 55%, #213a5e);
  color: #f2ecdc; text-align: center; padding: 64px 0 56px; position: relative; overflow: hidden;
}
.about-hero-inner { position: relative; }
.about-hero h1 { font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: 2px; color: #fbf6e9; }
.about-subtitle { color: #b9c7dd; margin-top: 8px; font-size: 15.5px; letter-spacing: 1px; }
.about-stat-badges { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.ab-badge {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(232, 201, 135, .3);
  padding: 6px 18px; border-radius: 24px; font-size: 13px; color: #f0e8d2;
}
.about-section { padding-top: 38px; padding-bottom: 44px; }
.about-grid { display: grid; grid-template-columns: 1fr 310px; gap: 24px; align-items: start; }
.about-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 20px;
}
.about-card-title {
  font-family: var(--serif); font-size: 19px; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; color: var(--navy-dark);
  padding-bottom: 12px; border-bottom: 2px solid var(--line);
}
.about-card h3 { font-size: 15px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); color: var(--navy-dark); }
.about-words .markdown-body { font-size: 15.5px; }
.about-info-list { list-style: none; }
.about-info-list li {
  display: flex; justify-content: space-between; gap: 14px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.about-info-list li:last-child { border-bottom: 0; }
.about-info-list span { color: var(--ink-soft); flex-shrink: 0; }
.about-info-list b { font-weight: 600; text-align: right; }
.about-features { list-style: none; }
.about-features li { padding: 7px 0; font-size: 14px; color: #475069; border-bottom: 1px dashed var(--line); }
.about-features li:last-child { border-bottom: 0; }
.about-follow p { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 14px; }
.about-follow .btn { margin-right: 8px; margin-bottom: 6px; }

/* ---------- 页脚（夜色） ---------- */
.site-footer {
  margin-top: auto; background: linear-gradient(170deg, var(--navy-deep), #101c33);
  color: #9fb0c9; text-align: center; padding: 38px 0 30px; font-size: 14px;
  border-top: 3px solid rgba(232, 201, 135, .3);
}
.site-footer p { margin: 6px 0; }
.footer-poem {
  font-family: var(--serif); font-style: italic; color: var(--gold);
  letter-spacing: 4px; font-size: 15px; margin-bottom: 10px !important;
}
.footer-line { color: #c6d2e4; }
.icp { display: inline-block; margin-top: 6px; color: #8ba0bd; font-size: 13px; }
.icp:hover { color: var(--gold); }
.footer-tip { opacity: .7; font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .card-grid, .list-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); margin-top: -20px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 48px 0 40px; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--paper);
    flex-direction: column; padding: 14px 20px; box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--line);
  }
  .main-nav.open { display: flex; }
  .nav-search { width: 100%; margin: 8px 0; }
  .nav-search input { flex: 1; width: auto; }
  .hero { padding: 50px 0 44px; }
  .hero h1 { font-size: 27px; }
  .hero-moon { width: 52px; height: 52px; top: 22px; right: 8%; }
  .hero-birds { width: 100px; top: 30px; }
  .card-grid, .list-grid { grid-template-columns: 1fr; }
  .list-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post { padding: 26px 20px; }
  .post h1 { font-size: 24px; }
  .post-nav { flex-direction: column; }
  .form-row { flex-direction: column; }
  .about-strip { padding: 26px 22px; }
}
