/* ============================================================
   疼惜的博客 — 白底手绘插画线条风
   米白纸底 · 墨黑线稿 · 一点点彩色的糖
   ============================================================ */

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

:root {
  /* 墨与纸 */
  --ink: #3a3633;          /* 主线条 */
  --ink-soft: #6b655f;     /* 弱线条 */
  --ink-faint: #b3aca3;    /* 极淡线条 */
  --paper: #fffdf6;        /* 米白纸 */
  --paper-dim: #f7f2e4;    /* 淡米色块 */
  --paper-line: rgba(58, 54, 51, 0.08);

  /* 彩色的糖 */
  --coral: #ff8a70;
  --coral-deep: #ef7355;
  --sky: #6fb1e3;
  --matcha: #8fc07f;
  --matcha-deep: #6da15b;
  --sun: #f6c453;
  --peach: #f5a8bd;
  --lav: #a99fd8;

  /* 字体 */
  --hand: "Yuanti SC", "Chalkboard SE", "PingFang SC", "Microsoft YaHei", sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --mono: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --doodle-eng: "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
}

html { scroll-behavior: smooth; }

::selection { background: rgba(246, 196, 83, 0.45); color: var(--ink); }

body {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2;
  color: var(--ink);
  background-color: var(--paper);
  /* 手账纸的点阵 */
  background-image: radial-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 26px 26px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------- 手绘小工具 ---------------- */

/* 不规则圆角 = 手绘框的招牌 */
.scribble {
  border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* 手绘叠笔：给边框一个淡淡的错位副本 */
.scribble-shadow { position: relative; }
.scribble-shadow::after {
  content: '';
  position: absolute;
  inset: -7px -5px -9px -7px;
  border: 1.5px solid rgba(58, 54, 51, 0.22);
  border-radius: 12px 240px 18px 225px / 225px 12px 240px 18px;
  pointer-events: none;
  z-index: 0;
}

/* 手绘标签（彩色小贴纸） */
.sticker {
  display: inline-block;
  padding: 2px 10px;
  font-family: var(--hand);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  border-radius: 6px;
  transform: rotate(-1.2deg);
  box-shadow: 1.5px 1.5px 0 rgba(58, 54, 51, 0.18);
}
.sticker-coral  { background: var(--coral); }
.sticker-sky    { background: var(--sky); }
.sticker-matcha { background: var(--matcha); }
.sticker-sun    { background: var(--sun); }
.sticker-peach  { background: var(--peach); }
.sticker-lav    { background: var(--lav); }

/* ---------------- 页头 ---------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 28px 22px;
}
.brand {
  font-family: var(--kai);
  font-size: 23px;
  letter-spacing: 0.28em;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand:hover svg { animation: sway 0.9s ease-in-out infinite; }
.site-nav { display: flex; gap: 10px; }
.nav-link {
  position: relative;
  padding: 6px 14px;
  font-family: var(--hand);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  border: 2px solid transparent;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: all 0.3s;
}
.nav-link:hover { color: var(--ink); border-color: var(--ink-faint); transform: rotate(-1deg); }
.nav-link.active {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(246, 196, 83, 0.16);
  transform: rotate(-1.5deg);
}

/* ---------------- 主区 ---------------- */
.main { max-width: 860px; margin: 0 auto; padding: 0 28px 90px; }

/* ---------------- 首页 hero ---------------- */
.hero {
  position: relative;
  text-align: center;
  padding: 40px 0 10px;
}

/* hero 插画场景 */
.hero-scene {
  position: absolute;
  inset: 0 0 0 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero-scene svg { width: 100%; height: auto; }
.hero-scene .layer-back { animation: bob 7s ease-in-out infinite; }
.hero-scene .layer-front { animation: bob 9s ease-in-out infinite reverse; }

.hero-inner { position: relative; z-index: 1; padding: 118px 0 96px; }

.hero-eng {
  font-family: var(--doodle-eng);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.hero-eng::before,
.hero-eng::after {
  content: '';
  display: inline-block;
  width: 46px;
  height: 2px;
  background: var(--ink-faint);
  border-radius: 2px;
}
.hero-eng::before { transform: rotate(-1deg); }
.hero-eng::after { transform: rotate(1deg); }

.hero-title {
  font-family: var(--kai);
  font-weight: 500;
  font-size: 74px;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  margin: 20px 0 18px;
  line-height: 1.1;
  position: relative;
  display: inline-block;
}
/* 标题底下的手绘波浪线 */
.hero-title::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -8px;
  height: 12px;
  background:
    radial-gradient(circle at 6px 6px, rgba(255, 138, 112, 0.85) 3px, transparent 4px) repeat-x;
  background-size: 18px 12px;
  opacity: 0.85;
}

.hero-tagline {
  margin-top: 30px;
  font-family: var(--kai);
  font-style: italic;
  font-size: 16.5px;
  color: var(--ink-soft);
}
.hero-tagline .dot { color: var(--coral); font-style: normal; padding: 0 4px; }

/* ---------------- 文章卡片 ---------------- */
.posts { position: relative; z-index: 1; margin-top: 26px; }

.card {
  position: relative;
  background: rgba(255, 253, 246, 0.92);
  border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 30px 32px 26px;
  margin-bottom: 34px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1.4), box-shadow 0.35s;
}
.card::after {
  content: '';
  position: absolute;
  inset: -7px -5px -9px -7px;
  border: 1.5px solid rgba(58, 54, 51, 0.18);
  border-radius: 12px 240px 18px 225px / 225px 12px 240px 18px;
  pointer-events: none;
}
.card:hover {
  transform: rotate(-0.4deg) translateY(-4px);
  box-shadow: 6px 8px 0 rgba(58, 54, 51, 0.09);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
/* 卡片角上的手绘小插画 */
.card-doodle {
  flex: none;
  width: 54px;
  height: 54px;
  margin-top: 2px;
}
.card-doodle svg { width: 100%; height: 100%; }

.card-meta {
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  line-height: 1.7;
}
.card-meta .tag {
  display: inline-block;
  margin: 0 4px 0 0;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transform: rotate(-1deg);
}

.card-title {
  margin: 8px 0 10px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 25px;
  letter-spacing: 0.05em;
}
.card-title a {
  background-image: linear-gradient(transparent 68%, rgba(246, 196, 83, 0.55) 68%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.45s ease;
  padding: 0 2px;
}
.card-title a:hover { background-size: 100% 100%; }

.card-excerpt { font-size: 14.5px; color: var(--ink-soft); }

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 16px;
  font-family: var(--hand);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: all 0.3s;
}
.card-more:hover {
  background: var(--sun);
  transform: rotate(1.5deg) translateY(-2px);
  box-shadow: 2px 3px 0 rgba(58, 54, 51, 0.2);
}

/* ---------------- 文章页 ---------------- */
.post { position: relative; z-index: 1; padding-top: 34px; }
.post-head { text-align: center; padding-bottom: 36px; position: relative; }
.post-meta {
  font-family: var(--hand);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.post-meta .tag {
  display: inline-block;
  margin: 0 4px;
  padding: 1px 9px;
  font-size: 11.5px;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.post-title {
  margin-top: 18px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: 0.08em;
  line-height: 1.35;
  display: inline-block;
  position: relative;
}
.post-title::after {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -10px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 5px, rgba(111, 177, 227, 0.8) 2.5px, transparent 3.5px) repeat-x;
  background-size: 15px 10px;
  opacity: 0.8;
}

.post-body { padding-top: 46px; position: relative; z-index: 1; }
.post-body h2 {
  font-family: var(--kai);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.06em;
  margin: 46px 0 16px;
  position: relative;
  display: inline-block;
  padding: 0 4px;
}
.post-body h2::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 7px;
  background: rgba(246, 196, 83, 0.5);
  z-index: -1;
  border-radius: 3px;
}
.post-body h3 {
  font-family: var(--kai);
  font-weight: 500;
  font-size: 19px;
  margin: 34px 0 12px;
  letter-spacing: 0.05em;
}
.post-body p { margin: 0 0 22px; }
.post-body strong { font-weight: 600; }
.post-body em { font-family: var(--kai); font-style: normal; background: rgba(255, 138, 112, 0.18); padding: 0 4px; border-radius: 3px; }
.post-body a {
  color: var(--coral-deep);
  border-bottom: 1.5px dashed var(--coral-deep);
  transition: all 0.3s;
}
.post-body a:hover { background: rgba(255, 138, 112, 0.16); }
.post-body blockquote {
  margin: 30px 0;
  padding: 16px 22px;
  background: var(--paper-dim);
  border: 1.5px solid var(--ink-faint);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  font-family: var(--kai);
  font-style: italic;
  color: var(--ink-soft);
  transform: rotate(-0.3deg);
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 1.5em; }
.post-body li { margin-bottom: 9px; }
.post-body li::marker { color: var(--coral); }
.post-body ol li::marker { font-family: var(--hand); }
.post-body img {
  margin: 30px auto;
  border-radius: 12px;
  box-shadow: 0 2px 0 rgba(58, 54, 51, 0.08);
}
.post-body hr { border: 0; margin: 46px 0; text-align: center; color: var(--ink-faint); font-size: 14px; }
.post-body hr::after { content: '✿ ❀ ✿'; letter-spacing: 0.8em; padding-left: 0.8em; font-size: 12px; }
.post-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-dim);
  color: var(--ink-soft);
  padding: 2px 7px;
  border: 1px solid var(--paper-line);
  border-radius: 5px;
}
.post-body pre {
  background: var(--paper-dim);
  border: 1.5px solid var(--ink-faint);
  border-radius: 14px;
  padding: 18px 22px;
  overflow-x: auto;
  margin: 0 0 24px;
}
.post-body pre code { background: none; border: none; padding: 0; font-size: 13px; }
.post-body video { width: 100%; margin: 28px auto; display: block; border-radius: 12px; }

.post-end { text-align: center; margin: 60px 0 26px; color: var(--ink-faint); font-size: 13px; }
.post-end span { letter-spacing: 0.5em; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-family: var(--hand);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: all 0.3s;
}
.back-link:hover {
  background: var(--sky);
  transform: rotate(-1.2deg) translateX(-3px);
  box-shadow: 2px 3px 0 rgba(58, 54, 51, 0.2);
}

/* 关于页 */
.about-body { padding-top: 30px; }
.about-body::first-letter { font-size: 2.6em; font-family: var(--kai); color: var(--coral-deep); line-height: 1; padding-right: 4px; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  text-align: center;
  padding: 34px 28px 120px;
  position: relative;
  z-index: 1;
}
.foot-orn { margin-bottom: 14px; }
.foot-orn svg { width: 64px; height: 64px; margin: 0 auto; animation: bob 6s ease-in-out infinite; }
.foot-line {
  font-family: var(--hand);
  font-size: 12.5px;
  letter-spacing: 0.26em;
  color: var(--ink-soft);
}
.foot-sub {
  margin-top: 8px;
  font-family: var(--kai);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------------- 背景音乐 ---------------- */
.music-btn {
  position: fixed;
  left: 22px; bottom: 22px;
  z-index: 60;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 246, 0.9);
  color: var(--ink);
  font-size: 19px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 2px 3px 0 rgba(58, 54, 51, 0.15);
  transition: all 0.35s;
}
.music-btn:hover { background: var(--sun); transform: rotate(-6deg) scale(1.06); }
.music-btn.playing .music-note { animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.music-toast {
  position: fixed;
  left: 82px; bottom: 30px;
  z-index: 60;
  max-width: 300px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--hand);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px 16px;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.35s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.music-toast.show { opacity: 1; transform: translateY(0); }

/* ---------------- 鼠标小星星 ---------------- */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 70;
  font-size: 14px;
  transform: translate(-50%, -50%);
  animation: sparkle-pop 0.7s ease-out forwards;
}
@keyframes sparkle-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(0deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1.1) rotate(40deg); }
}

/* ---------------- 线稿描绘动画 ---------------- */
.draw path,
.draw circle,
.draw ellipse,
.draw line,
.draw polyline,
.draw rect {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  animation: draw-line 1.6s cubic-bezier(0.55, 0, 0.3, 1) forwards;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* ---------------- 缓动动画 ---------------- */
.js .reveal { opacity: 0; transform: translateY(20px) rotate(-1deg); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1.3); }
.js .reveal.in { opacity: 1; transform: none; }

/* 云朵缓慢飘动 */
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-9px) rotate(0.6deg); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .site-header { padding: 22px 18px 16px; }
  .main { padding: 0 18px 70px; }
  .hero-inner { padding: 92px 0 66px; }
  .hero-title { font-size: 48px; letter-spacing: 0.18em; padding-left: 0.18em; }
  .hero-eng { font-size: 12px; }
  .card { padding: 22px 20px 20px; }
  .card-doodle { width: 44px; height: 44px; }
  .card-title { font-size: 21px; }
  .post-title { font-size: 26px; }
  .post-body { padding-top: 36px; }
  .music-btn { left: 14px; bottom: 14px; width: 44px; height: 44px; }
  .music-toast { left: 68px; bottom: 22px; max-width: 230px; }
}
