/* ============================================================
 * 睡个好觉³³ · 全局样式 v2 —— 暖纸 · 衬线 · 编辑排版
 * 设计基调：奶油纸底 + 墨色衬线大字 + 一点玫瑰色
 * 页头页脚是框架主角：页脚为深墨色块，LBS 是管理入口
 * ============================================================ */
:root {
  --bg: #f7f3ec;
  --bg-soft: #efe9df;
  --ink: #2c2924;
  --ink-deep: #211e1a;
  --ink-soft: #6d675c;
  --ink-faint: #a39b8d;
  --accent: #b96d7d;
  --accent-deep: #a55a6b;
  --accent-soft: #f3e2e5;
  --sage: #7d8f81;
  --sage-soft: #e9efe9;
  --line: #e3dccc;
  --line-dark: rgba(243, 239, 231, .16);
  --card: #fffdf8;
  --cream: #f3efe7;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(44, 41, 36, .05), 0 10px 30px rgba(44, 41, 36, .07);
  --shadow-hover: 0 2px 6px rgba(44, 41, 36, .07), 0 18px 44px rgba(44, 41, 36, .13);
  --serif: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", SimSun, Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.19, .66, .22, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
main { flex: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
em { font-style: normal; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ---- 全站纸纹颗粒（极淡） ---- */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ===== 页头 ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 243, 236, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 76px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.site-title {
  font-family: var(--serif);
  font-size: 23px; font-weight: 600; letter-spacing: 2px;
  display: flex; align-items: baseline; gap: 12px; line-height: 1.2;
}
.site-title em { color: var(--accent); }
.site-title .en {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: .34em; color: var(--ink-faint); text-transform: uppercase;
  transform: translateY(-2px);
}
.site-nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.site-nav a {
  font-size: 14.5px; color: var(--ink-soft);
  position: relative; padding: 4px 0;
  transition: color .2s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--accent);
  transition: right .3s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }
.site-nav a.active { color: var(--accent); font-weight: 500; }
.site-nav a.active::after { right: 0; }

/* ===== 主体通用 ===== */
main { padding: 0 0 96px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.35; }

/* 页面标题头（文章/相册/友链等内页统一用） */
.page-head { padding: clamp(56px, 10vh, 96px) 0 0; }
.page-head .eyebrow {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.page-head .eyebrow::after { content: ""; flex: 1; max-width: 72px; height: 1px; background: var(--line); }
.page-head h1 {
  font-size: clamp(44px, 8vw, 76px); letter-spacing: .02em; line-height: 1.08;
}
.page-head .en {
  display: block; margin-top: 12px;
  font-family: var(--sans); font-size: clamp(14px, 2.2vw, 19px); font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px var(--ink-faint);
}
.page-head .sub { margin-top: 22px; color: var(--ink-soft); font-size: 15.5px; max-width: 34em; }
.page-head .sub em { color: var(--accent); }

.section-label {
  font-size: 12px; color: var(--ink-faint); letter-spacing: .3em;
  margin-bottom: 24px; display: flex; align-items: center; gap: 16px;
  text-transform: uppercase;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ===== 按钮 ===== */
.btn {
  font: inherit; font-size: 15px; cursor: pointer;
  background: var(--ink); color: var(--cream);
  border: none; border-radius: 999px; padding: 12px 34px;
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(165, 90, 107, .25); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); box-shadow: none; }
.btn-danger { background: #a8524b; }
.btn-danger:hover { background: #8f423c; box-shadow: none; }

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

/* ===== 首页 ===== */
.home-hero { padding: clamp(72px, 14vh, 140px) 0 clamp(48px, 8vh, 80px); position: relative; }
.home-hero .hero-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; display: block; margin-bottom: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 5px var(--card);
}
.home-hero .eyebrow {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 26px;
}
.home-hero h1 {
  font-size: clamp(40px, 7.4vw, 84px);
  letter-spacing: .01em; line-height: 1.18; max-width: 12em;
}
.home-hero h1 em { color: var(--accent); }
.home-hero .lead {
  margin-top: 30px; color: var(--ink-soft);
  font-size: 16.5px; max-width: 32em;
}
.home-hero .lead a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); transition: border-color .2s; }
.home-hero .lead a:hover { border-color: var(--accent); }
.home-hero .hero-rule {
  margin-top: 44px; height: 1px; background: var(--line);
  position: relative;
}
.home-hero .hero-rule::before {
  content: ""; position: absolute; left: 0; top: -1px;
  width: 64px; height: 3px; background: var(--accent); border-radius: 2px;
}

/* 快捷入口：三行大列表（替代卡片） */
.home-menu { display: flex; flex-direction: column; margin-bottom: clamp(56px, 10vh, 88px); }
.home-menu a {
  display: grid; grid-template-columns: 64px 1fr auto 28px;
  align-items: center; gap: 22px;
  padding: clamp(18px, 3.4vh, 28px) 10px;
  border-top: 1px solid var(--line);
  transition: background .25s, padding-left .3s var(--ease);
}
.home-menu a:last-child { border-bottom: 1px solid var(--line); }
.home-menu .no {
  font-family: var(--serif); font-size: 13px; color: var(--ink-faint);
  transition: color .25s;
}
.home-menu .name { font-family: var(--serif); font-size: clamp(22px, 3.6vw, 32px); font-weight: 600; transition: color .25s, transform .3s var(--ease); display: inline-block; }
.home-menu .hint { font-size: 13px; color: var(--ink-faint); letter-spacing: .06em; }
.home-menu .arrow { color: var(--ink-faint); font-size: 18px; transition: transform .3s var(--ease), color .25s; }
.home-menu a:hover { background: rgba(185, 109, 125, .045); padding-left: 22px; }
.home-menu a:hover .name { color: var(--accent); }
.home-menu a:hover .no { color: var(--accent); }
.home-menu a:hover .arrow { transform: translateX(6px); color: var(--accent); }

/* ===== 文章列表（编辑式行，替代卡片堆） ===== */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid; grid-template-columns: 116px 1fr; gap: 26px;
  padding: clamp(20px, 3.6vh, 30px) 8px;
  border-top: 1px solid var(--line);
  transition: background .25s, padding-left .3s var(--ease);
}
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item .meta { font-size: 12.5px; color: var(--ink-faint); padding-top: 7px; }
.post-item .meta time { display: block; letter-spacing: .04em; }
.post-item .meta .tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.post-item .meta .tag { font-size: 11px; padding: 1px 10px; }
.post-item h2 {
  font-size: clamp(19px, 2.8vw, 25px); margin-bottom: 6px;
  transition: color .25s;
}
.post-item p { color: var(--ink-soft); font-size: 14.5px; }
.post-item:hover { background: rgba(185, 109, 125, .04); padding-left: 20px; }
.post-item:hover h2 { color: var(--accent); }

.list-empty {
  text-align: center; color: var(--ink-soft);
  padding: clamp(56px, 12vh, 96px) 24px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(243, 226, 229, .25), rgba(233, 239, 233, .3));
}
.list-empty .big { font-family: var(--serif); font-size: 30px; color: var(--ink); margin-bottom: 8px; }
.list-empty p { font-size: 14px; color: var(--ink-soft); }

/* ===== 文章正文 ===== */
.prose { font-size: 16.5px; line-height: 2; }
.prose p { margin: 1.15em 0; }
.prose h2 { font-size: 23px; margin: 1.9em 0 .8em; }
.prose h3 { font-size: 18.5px; margin: 1.5em 0 .7em; }
.prose ul, .prose ol { padding-left: 1.6em; margin: 1em 0; }
.prose li { margin: .35em 0; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 8px 22px; margin: 1.3em 0;
  color: var(--ink-soft); background: rgba(243, 226, 229, .3); border-radius: 0 12px 12px 0;
}
.prose img { border-radius: var(--radius); margin: 1.4em auto; }
.prose code { background: var(--bg-soft); padding: 2px 8px; border-radius: 6px; font-size: .88em; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }

.post-cover { border-radius: var(--radius-lg); margin: 12px 0 32px; width: 100%; }
.post-meta { color: var(--ink-faint); font-size: 13.5px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back-link { margin-top: 36px; font-size: 14px; }
.back-link a { color: var(--accent); }
.back-link a:hover { border-bottom: 1px solid var(--accent); }

/* ===== 相册 ===== */
.gal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 34px 0 30px; }
.gal-tab {
  font: inherit; font-size: 13.5px; cursor: pointer;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  transition: all .2s;
}
.gal-tab:hover { border-color: var(--accent); color: var(--accent); }
.gal-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.gal-tab .n { font-size: 11px; opacity: .55; margin-left: 6px; }

.gallery-grid { columns: 2; column-gap: 16px; }
.gallery-grid figure {
  break-inside: avoid; margin-bottom: 16px; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-soft); cursor: zoom-in;
  position: relative; box-shadow: var(--shadow);
}
.gallery-grid img { width: 100%; transition: transform .35s var(--ease); }
.gallery-grid figure:hover img { transform: scale(1.035); }
.gallery-grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 16px 12px; color: #fff; font-size: 13px;
  background: linear-gradient(transparent, rgba(33, 30, 26, .6));
  opacity: 0; transition: opacity .25s;
}
.gallery-grid figure:hover figcaption { opacity: 1; }

.gallery-empty {
  text-align: center; padding: clamp(64px, 14vh, 110px) 28px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(243, 226, 229, .28), rgba(233, 239, 233, .32));
}
.gallery-empty .big { font-family: var(--serif); font-size: clamp(24px, 4vw, 34px); color: var(--ink); margin-bottom: 12px; }
.gallery-empty p { color: var(--ink-soft); font-size: 14.5px; max-width: 30em; margin: 0 auto; }
.gallery-empty a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.gallery-empty a:hover { border-color: var(--accent); }
.gallery-empty code { background: var(--card); padding: 2px 8px; border-radius: 6px; font-size: .9em; }

.lightbox {
  position: fixed; inset: 0; background: rgba(33, 30, 26, .88);
  display: none; align-items: center; justify-content: center;
  z-index: 80; padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; }

/* ===== 通用状态 ===== */
.msg-status { color: var(--ink-faint); font-size: 14px; text-align: center; padding: 20px 0; }
.msg-status.err { color: var(--accent); }
.empty { color: var(--ink-faint); font-size: 13.5px; text-align: center; padding: 22px 12px; }

/* ===== 页脚（深墨块 · LBS 为管理入口） ===== */
.site-footer {
  background: var(--ink-deep); color: var(--cream);
  margin-top: auto;
}
.site-footer .wrap { padding-top: clamp(52px, 9vh, 84px); padding-bottom: 30px; }
.foot-top {
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding-bottom: clamp(36px, 6vh, 56px);
}
.foot-brand .wordmark {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 34px);
  font-weight: 600; letter-spacing: 2px;
}
.foot-brand .wordmark em { color: #d98d9b; }
.foot-brand .foot-say {
  margin-top: 14px; color: rgba(243, 239, 231, .55);
  font-size: 14px; line-height: 2;
}
.foot-nav { display: flex; gap: 34px; flex-wrap: wrap; }
.foot-nav .col-title {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(243, 239, 231, .4); margin-bottom: 14px;
}
.foot-nav ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.foot-nav a {
  color: rgba(243, 239, 231, .72); font-size: 14px;
  transition: color .2s, padding-left .25s var(--ease);
}
.foot-nav a:hover { color: #d98d9b; padding-left: 6px; }
.foot-rule { height: 1px; background: var(--line-dark); }
.foot-base {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; padding-top: 22px;
  font-size: 12.5px; color: rgba(243, 239, 231, .5);
}
.foot-base .copyright { letter-spacing: .04em; }
.foot-base .lbs {
  color: rgba(243, 239, 231, .55);
  border-bottom: 1px dashed rgba(243, 239, 231, .3);
  padding-bottom: 1px; letter-spacing: .14em; font-size: 11.5px;
  transition: color .2s, border-color .2s;
}
.foot-base .lbs:hover { color: #d98d9b; border-color: #d98d9b; }
.foot-routes { display: flex; gap: 18px; }
.foot-routes a {
  color: rgba(243, 239, 231, .45); font-size: 12px;
  border-bottom: 1px dashed transparent; transition: color .2s;
}
.foot-routes a:hover { color: rgba(243, 239, 231, .8); }

/* ===== 404 ===== */
.notfound { text-align: center; padding: 96px 0; }
.notfound .big { font-family: var(--serif); font-size: 76px; color: var(--accent); }

/* ===== 滚动入场（页面可选用 .rv） ===== */
.rv { opacity: 0; }
.rv.in { animation: rv-rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes rv-rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.rv[data-d="1"] { --d: 1; } .rv[data-d="2"] { --d: 2; } .rv[data-d="3"] { --d: 3; }
.rv[data-d="4"] { --d: 4; } .rv[data-d="5"] { --d: 5; } .rv[data-d="6"] { --d: 6; }
.rv[data-d="7"] { --d: 7; } .rv[data-d="8"] { --d: 8; } .rv[data-d="9"] { --d: 9; }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .wrap, .wrap-wide { padding: 0 20px; }
  .site-header .wrap { min-height: 64px; }
  .site-title { font-size: 20px; }
  .site-title .en { display: none; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13.5px; }
  .home-menu a { grid-template-columns: 44px 1fr auto; }
  .home-menu .hint { display: none; }
  .home-menu .arrow { justify-self: end; }
  .post-item { grid-template-columns: 1fr; gap: 8px; padding: 22px 6px; }
  .post-item .meta { display: flex; gap: 10px; align-items: center; padding-top: 0; }
  .post-item .meta .tags { margin-top: 0; }
  .gallery-grid { columns: 1; }
  .foot-top { flex-direction: column; gap: 30px; }
  .page-head h1 { font-size: 42px; }
}

/* 尊重系统减弱动态效果设置 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1 !important; }
}