/* ==================================================================
   拾光笔记 · 可爱手账版  main.css
   奶油纸面 + 点阵网格 + 和纸胶带 + 贴纸按钮 + 手绘涂鸦；浅色单主题。
   接入自托管「霞鹜文楷」子集后取消下方注释（见 README「字体」）：
   ------------------------------------------------------------------
   @font-face {
     font-family: "LXGW WenKai";
     src: url("../fonts/LXGWWenKai-subset.woff2") format("woff2");
     font-display: swap;
   }
   ================================================================== */

:root {
  color-scheme: light;
  --paper: #fbf2e0;
  --paper-dot: #ecdcbb;
  --card: #fffdf6;
  --card-border: #ecdfc4;
  --surface: #fffdf6;              /* 公安徽标内瓣用色，勿改名 */
  --ink: #584438;
  --text: var(--ink);
  --muted: #9a8570;
  --berry: #ef7c8e;                /* 草莓粉 */
  --berry-deep: #d9647a;
  --butter: #f2c94c;               /* 黄油 */
  --leaf: #8fbf88;                 /* 叶绿 */
  --sky: #8fbfe0;                  /* 天蓝 */
  --pill: rgba(239, 124, 142, 0.13);
  --line: rgba(154, 133, 112, 0.28);
  --shadow: 0 12px 26px rgba(151, 116, 66, 0.14);

  --radius-lg: 24px; --radius-md: 16px;
  --container: 1080px;
  --font-kai: "LXGW WenKai", "LXGW WenKai Screen", "霞鹜文楷", "Kaiti SC", "STKaiti", "KaiTi", "楷体",
    "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  --doodle-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='10'%3E%3Cpath d='M2 6 Q 9.5 1.5, 17 6 T 32 6 T 47 6 T 58 6' fill='none' stroke='%23EF7C8E' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0; min-width: 320px;
  color: var(--ink);
  background: radial-gradient(var(--paper-dot) 1.3px, transparent 1.4px) 0 0 / 26px 26px, var(--paper);
  font: 16px/1.85 var(--font-kai);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--butter); color: var(--ink); }

/* 纸面纤维 */
.grain { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
#motes { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ------------------------------ 和纸胶带与贴纸基元 ------------------------------ */
.tape {
  position: absolute; top: -13px; left: 50%; z-index: 2;
  width: 112px; height: 27px; transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(245, 158, 173, 0.85) 0 9px, rgba(255, 214, 122, 0.85) 9px 18px);
  border-radius: 2px; opacity: 0.92;
  box-shadow: 0 2px 5px rgba(120, 90, 60, 0.18);
  clip-path: polygon(0 0, 100% 0, 97% 22%, 100% 44%, 97% 66%, 100% 88%, 98% 100%, 0 100%, 2% 82%, 0 60%, 3% 38%, 0 16%);
  pointer-events: none;
}
.tape--b { transform: translateX(-50%) rotate(2.5deg); background: repeating-linear-gradient(45deg, rgba(143, 191, 224, 0.85) 0 9px, rgba(200, 228, 197, 0.85) 9px 18px); }
.tape--corner { left: 26px; top: -11px; transform: rotate(-14deg); width: 96px; }

/* ------------------------------ 顶栏 ------------------------------ */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; border-bottom: 2px dashed transparent; }
.header-inner {
  max-width: var(--container); min-height: 68px; margin-inline: auto; padding-inline: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-header.scrolled { background: rgba(255, 252, 244, 0.92); border-color: var(--card-border); box-shadow: 0 6px 20px rgba(151, 116, 66, 0.12); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #fff6e6; }
.brand-mark { width: 40px; height: 40px; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(151, 116, 66, 0.25); }
.brand-text { min-width: 0; line-height: 1.25; }
.brand-title { display: block; overflow: hidden; font-size: 17px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.brand-subtitle { display: block; margin-top: 1px; color: var(--muted); font-size: 12.5px; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  min-height: 42px; display: inline-flex; align-items: center; padding: 0 13px;
  border-radius: 999px; font-size: 15px;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav a:hover, .nav a[aria-current="true"] { background: var(--pill); color: var(--berry); }

/* ------------------------------ 首屏 ------------------------------ */
.hero {
  min-height: 92vh; min-height: 92svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; padding: 110px 24px 84px; text-align: center;
}
.sticker-avatar { position: relative; display: inline-block; margin-bottom: 22px; transform: rotate(-3deg); }
.sticker-avatar .hero-avatar {
  width: 108px; height: 108px; border-radius: 30px;
  border: 6px solid #fff; box-shadow: 0 10px 24px rgba(151, 116, 66, 0.28);
}
.sticker-avatar .tape { top: -15px; width: 92px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 7px 17px;
  border-radius: 999px; background: var(--card); border: 2px dashed #e9c99a;
  color: var(--ink); font-size: 14px; box-shadow: 0 4px 12px rgba(151, 116, 66, 0.12);
  transform: rotate(-1deg);
}
.eyebrow-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--butter); box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.3); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(242, 201, 76, 0.14); } }
h1 {
  margin: 0; max-width: 760px;
  font-family: var(--font-kai); font-weight: 700;
  font-size: clamp(33px, 5.4vw, 54px); line-height: 1.36; letter-spacing: 0.02em;
  text-wrap: balance;
}
h1 span { position: relative; color: var(--berry); padding-bottom: 0.14em;
  background: var(--doodle-line) repeat-x left bottom / 60px 9px; }
.hero-description { min-height: 1.9em; max-width: 600px; margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.caret { display: inline-block; width: 2.5px; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: var(--berry); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 32px; }
.btn {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 27px; border-radius: 20px 24px 19px 25px;
  font-family: var(--font-kai); font-size: 16.5px; font-weight: 700; letter-spacing: 0.05em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { color: #fff; background: var(--berry); border: 3px solid #fff; box-shadow: 0 5px 0 var(--berry-deep), 0 10px 20px rgba(217, 100, 122, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--berry-deep), 0 14px 24px rgba(217, 100, 122, 0.34); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--berry-deep); }
.btn-secondary { color: var(--berry-deep); background: var(--card); border: 2.5px dashed #eeb3bd; box-shadow: 0 4px 12px rgba(151, 116, 66, 0.12); }
.btn-secondary:hover { transform: translateY(-2px) rotate(-0.6deg); }
.doodle { position: absolute; color: var(--ink); opacity: 0.85; pointer-events: none; }
.doodle svg { display: block; }
.doodle--star { top: 17%; left: 12%; color: var(--butter); animation: wiggle 4s ease-in-out infinite; }
.doodle--heart { top: 24%; right: 12%; color: var(--berry); animation: wiggle 4.6s ease-in-out infinite reverse; }
.doodle--spiral { bottom: 21%; left: 16%; color: var(--sky); }
.doodle--sparkle { bottom: 26%; right: 15%; color: var(--leaf); animation: wiggle 5s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(9deg) translateY(-5px); } }
.scroll-hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); color: var(--berry); opacity: 0.85; animation: bobble 1.9s ease-in-out infinite; }
@keyframes bobble { 50% { transform: translate(-50%, 8px); } }

/* ------------------------------ 手账卡片 ------------------------------ */
.content { max-width: var(--container); margin-inline: auto; padding: 6px 20px 0; }
.card {
  position: relative; margin-bottom: 34px; padding: 34px 34px 32px;
  background: var(--card); border: 2px solid var(--card-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card:nth-of-type(odd) { transform: rotate(-0.35deg); }
.card:nth-of-type(even) { transform: rotate(0.3deg); }
.section-kicker {
  display: inline-block; margin: 0 0 10px; padding: 3px 14px;
  background: #ffe9a6; color: #8a6b3f; border-radius: 3px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  transform: rotate(-1.6deg); box-shadow: 0 2px 4px rgba(151, 116, 66, 0.18);
}
.section-title { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 700; line-height: 1.35; letter-spacing: 0.02em; }
.section-description { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; }
.section-header { margin-bottom: 24px; }

/* 今日便签 */
.date-label { color: #b08a4e; font-family: var(--font-sans); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; }
.card-title { margin: 8px 0 6px; font-size: 23px; font-weight: 700; line-height: 1.45; letter-spacing: 0.02em; }
.card-text { margin: 0; color: var(--muted); font-size: 15.5px; }
.mini-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 24px; }
.mini-item {
  display: grid; grid-template-columns: 47px minmax(0, 1fr); gap: 13px; align-items: start;
  padding: 16px; border: 2px dashed #e6cfa6; border-radius: var(--radius-md); background: #fffef9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mini-item:hover { transform: translateY(-4px) rotate(-0.5deg); box-shadow: 0 10px 20px rgba(151, 116, 66, 0.16); }
.mini-icon { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(151, 116, 66, 0.18); }
.mini-icon svg { width: 23px; height: 23px; }
.mini-item:nth-child(1) .mini-icon { background: #fbd8dd; color: #c05b6d; }
.mini-item:nth-child(2) .mini-icon { background: #fdeab7; color: #a3762e; }
.mini-item:nth-child(3) .mini-icon { background: #d4e9d2; color: #4e7d4c; }
.mini-item strong { display: block; margin-bottom: 1px; font-size: 16px; }
.mini-item span { color: var(--muted); font-size: 14px; }

/* 最新文章 · 贴纸封面卡 */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card {
  position: relative; display: flex; flex-direction: column; overflow: visible;
  border: 2px solid var(--card-border); border-radius: 20px; background: #fffef9;
  box-shadow: 0 8px 20px rgba(151, 116, 66, 0.13);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:nth-child(1) { transform: rotate(-0.7deg); }
.post-card:nth-child(2) { transform: rotate(0.5deg); }
.post-card:nth-child(3) { transform: rotate(-0.4deg); }
.post-card:hover { transform: translateY(-6px) rotate(0deg); box-shadow: 0 16px 32px rgba(151, 116, 66, 0.2); }
.cover { position: relative; aspect-ratio: 8 / 5; overflow: hidden; border-radius: 17px 17px 0 0; border-bottom: 2px dashed var(--card-border); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.post-card:hover .cover img { transform: scale(1.045) rotate(0.4deg); }
.cover .tag {
  position: absolute; top: 12px; right: 12px; padding: 2px 13px;
  border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: var(--berry); border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(151, 116, 66, 0.22); transform: rotate(3deg);
}
.post-card:nth-child(2) .tag { background: #e0a63c; }
.post-card:nth-child(3) .tag { background: #6d9e6a; }
.post-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.post-body time { color: #b08a4e; font-size: 13px; font-family: var(--font-sans); letter-spacing: 0.05em; }
.post-body h3 { margin: 5px 0 0; font-size: 17.5px; font-weight: 700; line-height: 1.5; transition: color 0.2s ease; }
.post-card:hover h3 { color: var(--berry-deep); }
.post-body p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-link { margin-top: auto; padding-top: 14px; align-self: start; color: var(--berry-deep); font-size: 14px; font-weight: 700; }
.post-link:hover { background: var(--doodle-line) repeat-x left bottom / 60px 9px; padding-bottom: 6px; }

/* 记录时间线 · 图钉与旗标 */
.timeline { position: relative; max-width: 720px; padding-left: 32px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 0;
  border-left: 3px dashed #ddbe8e;
}
.timeline-item { position: relative; display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 18px; padding: 16px 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -29px; top: 23px; width: 15px; height: 15px; border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 34% 30%, #ffe08e, var(--butter) 70%);
  box-shadow: 0 3px 7px rgba(151, 116, 66, 0.35);
}
.timeline-item:nth-child(2)::before { background: radial-gradient(circle at 34% 30%, #f9aab8, var(--berry) 70%); }
.timeline-item:nth-child(3)::before { background: radial-gradient(circle at 34% 30%, #b7d9b2, var(--leaf) 70%); }
.timeline-date {
  align-self: start; justify-self: start; padding: 3px 20px 3px 13px;
  background: #ffe9a6; color: #8a6b3f; font-size: 13.5px; font-weight: 700; font-family: var(--font-sans);
  clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 50%, 100% 100%, 0 100%);
}
.timeline-content h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.timeline-content p { margin: 0; color: var(--muted); font-size: 15px; }

/* 关于 */
.about-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr); gap: 26px; align-items: start; }
.about-text { max-width: 640px; margin: 14px 0 0; color: var(--muted); }
.profile-box {
  position: relative; padding: 22px 22px 20px; border-radius: var(--radius-md);
  background: #fdf0d6; border: 2px dashed #e2c186; transform: rotate(0.8deg);
}
.profile-box strong { display: block; margin-bottom: 8px; color: #b0642f; font-size: 16px; letter-spacing: 0.04em; }
.profile-box span { position: relative; display: block; padding: 4px 0 4px 20px; color: var(--ink); font-size: 14.5px; }
.profile-box span::before { content: ""; position: absolute; left: 1px; top: 12px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--berry); box-shadow: 0 1px 3px rgba(151, 116, 66, 0.3); }
.profile-box span:nth-of-type(2)::before { background: var(--butter); }
.profile-box span:nth-of-type(3)::before { background: var(--leaf); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer { max-width: var(--container); margin: 8px auto 28px; padding-inline: 20px; }
.footer-inner {
  position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 28px;
  padding: 20px 28px; border-radius: var(--radius-lg);
  background: var(--card); border: 2px solid var(--card-border); border-top: 3px dashed #ddbe8e;
  box-shadow: var(--shadow); color: var(--muted); font-size: 13.5px;
}
.copyright { margin: 0; line-height: 1.7; }
.filing-list { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.filing-list a { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); transition: color 0.2s ease; }
.filing-list a:hover { color: var(--berry-deep); }
.filing-list li + li { position: relative; }
.filing-list li + li::before { content: ""; position: absolute; left: -9px; top: 50%; width: 1px; height: 14px; transform: translateY(-50%); background: var(--line); }
.police-icon { width: 18px; height: 18px; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; }
.police-icon-image, .police-icon-fallback { width: 18px; height: 18px; display: block; object-fit: contain; }
.police-icon-fallback { display: none; color: var(--muted); }
.police-icon.is-fallback .police-icon-image { display: none; }
.police-icon.is-fallback .police-icon-fallback { display: block; }

/* 返回顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 25;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 3px solid #fff; border-radius: 16px 18px 15px 19px;
  background: var(--butter); color: #7a5a24; cursor: pointer;
  box-shadow: 0 4px 0 #d9ac2e, 0 10px 20px rgba(151, 116, 66, 0.25);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-2px) rotate(-3deg); }
.to-top:active { transform: translateY(2px); box-shadow: 0 2px 0 #d9ac2e; }

/* ------------------------------ 动效与响应式 ------------------------------ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.card.reveal { transform: translateY(20px) rotate(0deg); }
.card.reveal.in:nth-of-type(odd) { transform: rotate(-0.35deg); }
.card.reveal.in:nth-of-type(even) { transform: rotate(0.3deg); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.d1 { animation-delay: 0.08s; } .d2 { animation-delay: 0.16s; } .d3 { animation-delay: 0.24s; } .d4 { animation-delay: 0.32s; }
.sticker-avatar.rise { animation-name: rise-tilt; }
@keyframes rise-tilt { from { opacity: 0; transform: translateY(16px) rotate(-3deg); } to { opacity: 1; transform: rotate(-3deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; }
  .card.reveal { transform: none; }
  .card.reveal.in:nth-of-type(odd), .card:nth-of-type(odd) { transform: rotate(-0.35deg); }
  .card.reveal.in:nth-of-type(even), .card:nth-of-type(even) { transform: rotate(0.3deg); }
}
@media (max-width: 880px) {
  .mini-list, .post-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .cover { aspect-ratio: 16 / 8; }
  .doodle--spiral, .doodle--sparkle { display: none; }
}
@media (max-width: 720px) {
  .doodle--star { top: 13%; left: 6%; }
  .doodle--heart { top: 16%; right: 7%; }
}
@media (max-width: 560px) {
  .header-inner { padding-inline: 14px; }
  .brand-subtitle { display: none; }
  .nav a { padding: 0 9px; font-size: 14px; }
  .content, .site-footer { padding-inline: 14px; }
  .card, .card:nth-of-type(odd), .card:nth-of-type(even),
  .card.reveal.in:nth-of-type(odd), .card.reveal.in:nth-of-type(even) { transform: none; }
  .card { padding: 26px 20px 24px; border-radius: 20px; }
  .post-card, .post-card:nth-child(1), .post-card:nth-child(2), .post-card:nth-child(3) { transform: none; }
  .hero { padding-inline: 18px; }
  .hero-actions { width: 100%; flex-direction: column; }
  .btn { width: 100%; }
  .doodle { display: none; }
  .timeline { padding-left: 28px; }
  .timeline-item { grid-template-columns: 1fr; gap: 7px; }
  .timeline-item::before { left: -27px; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
  .filing-list { flex-direction: column; align-items: flex-start; gap: 0; }
  .filing-list a { min-height: 36px; white-space: normal; }
  .filing-list li + li::before { display: none; }
}
