/* ==================================================================
   拾光笔记 · 治愈插画版  main.css
   暮色手绘场景 + 毛玻璃卡片；文楷/楷体字系；昼夜双主题。
   接入自托管「霞鹜文楷」子集后取消下方注释（见 README「字体」）：
   ------------------------------------------------------------------
   @font-face {
     font-family: "LXGW WenKai";
     src: url("../fonts/LXGWWenKai-subset.woff2") format("woff2");
     font-display: swap;
   }
   ================================================================== */

:root {
  color-scheme: light dark;
  --bg-day: url("../img/bg-day.svg");
  --bg-night: url("../img/bg-night.svg");

  /* 暮色 · 浅色主题 */
  --card: rgba(255, 250, 246, 0.82);
  --card-solid: #fffaf4;
  --card-border: rgba(255, 255, 255, 0.65);
  --surface: #fffdf9;              /* 公安徽标内瓣用色，勿改名 */
  --text: #46395a;
  --muted: #8b7b96;
  --primary: #e96f8f;              /* 霞粉 */
  --primary-2: #ffb98a;            /* 杏金 */
  --lav: #9b87c9;                  /* 暮紫 */
  --pill: rgba(233, 111, 143, 0.12);
  --pill-lav: rgba(155, 135, 201, 0.14);
  --hero-ink: #4a3a5e;
  --halo: rgba(255, 244, 235, 0.75);
  --scrim-1: rgba(250, 233, 226, 0.55);
  --shadow: 0 16px 48px rgba(122, 82, 130, 0.16);
  --line: rgba(139, 123, 150, 0.24);
  --glow: rgba(255, 214, 160, 0.55);

  --radius-lg: 26px; --radius-md: 18px; --radius-sm: 12px;
  --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;
}

/* 星夜 · 深色主题（跟随系统，或由右上角按钮手动切换） */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --card: rgba(30, 26, 52, 0.78);
  --card-solid: #221e3e;
  --card-border: rgba(255, 255, 255, 0.1);
  --surface: #262148;
  --text: #ece5f6;
  --muted: #a99cc0;
  --primary: #f59ab2;
  --primary-2: #ffd2a0;
  --lav: #b5a3e8;
  --pill: rgba(245, 154, 178, 0.15);
  --pill-lav: rgba(181, 163, 232, 0.16);
  --hero-ink: #f2ecfb;
  --halo: rgba(20, 16, 44, 0.6);
  --scrim-1: rgba(24, 20, 48, 0.62);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --line: rgba(169, 156, 192, 0.24);
  --glow: rgba(255, 233, 160, 0.5);
} }
:root[data-theme="dark"] {
  --card: rgba(30, 26, 52, 0.78);
  --card-solid: #221e3e;
  --card-border: rgba(255, 255, 255, 0.1);
  --surface: #262148;
  --text: #ece5f6;
  --muted: #a99cc0;
  --primary: #f59ab2;
  --primary-2: #ffd2a0;
  --lav: #b5a3e8;
  --pill: rgba(245, 154, 178, 0.15);
  --pill-lav: rgba(181, 163, 232, 0.16);
  --hero-ink: #f2ecfb;
  --halo: rgba(20, 16, 44, 0.6);
  --scrim-1: rgba(24, 20, 48, 0.62);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --line: rgba(169, 156, 192, 0.24);
  --glow: rgba(255, 233, 160, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0; min-width: 320px;
  color: var(--text); background: #cbb4d8;
  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(--primary); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--primary); color: #fff; }

/* ------------------------------ 背景与氛围层 ------------------------------ */
.bg, .bg::before, .bg-scrim, .grain { position: fixed; inset: 0; pointer-events: none; }
.bg { z-index: -3; background: var(--bg-day) center / cover no-repeat #cbb4d8; }
.bg::before {
  content: ""; background: var(--bg-night) center / cover no-repeat;
  opacity: 0; transition: opacity 0.9s ease;
}
:root[data-theme="dark"] .bg::before { opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bg::before { opacity: 1; } }
.bg-scrim {
  z-index: -2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 46%, var(--scrim-1) 100%);
}
#motes { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.grain {
  z-index: 40; opacity: 0.05; mix-blend-mode: soft-light;
  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");
}

/* ------------------------------ 顶栏 ------------------------------ */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; transition: background 0.3s ease, box-shadow 0.3s ease; }
.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 .brand-title, .site-header .nav a, .site-header .theme-toggle { color: var(--hero-ink); text-shadow: 0 1px 10px var(--halo); }
.site-header.scrolled {
  background: var(--card);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 6px 26px rgba(90, 60, 110, 0.12);
}
.site-header.scrolled .brand-title, .site-header.scrolled .nav a, .site-header.scrolled .theme-toggle { color: var(--text); text-shadow: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  flex: 0 0 auto; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(150, 100, 150, 0.35);
  background: #ffe3c2;
}
.brand-mark { width: 40px; height: 40px; }
.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; }
.site-header:not(.scrolled) .brand-subtitle { color: var(--hero-ink); opacity: 0.78; text-shadow: 0 1px 8px var(--halo); }
.header-right { display: flex; align-items: center; gap: 4px; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative; 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(--primary) !important; text-shadow: none; }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.theme-toggle:hover { background: var(--pill); transform: rotate(16deg); }
.theme-toggle .i-moon, :root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

/* ------------------------------ 首屏 ------------------------------ */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; padding: 100px 24px 92px; text-align: center;
}
.hero-avatar { width: 104px; height: 104px; border-width: 4px; margin-bottom: 20px; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.35), 0 14px 40px var(--glow); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 7px 16px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text); font-size: 14px; box-shadow: 0 6px 20px rgba(122, 82, 130, 0.14);
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb257; box-shadow: 0 0 0 4px rgba(255, 178, 87, 0.28); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 178, 87, 0.12); } }
h1 {
  margin: 0; max-width: 760px;
  color: var(--hero-ink); font-family: var(--font-kai); font-weight: 700;
  font-size: clamp(33px, 5.6vw, 56px); line-height: 1.32; letter-spacing: 0.02em;
  text-shadow: 0 2px 20px var(--halo); text-wrap: balance;
}
h1 span {
  background: linear-gradient(115deg, var(--primary) 20%, var(--primary-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--primary);
}
.hero-description {
  min-height: 1.9em; max-width: 600px; margin: 16px 0 0;
  color: var(--hero-ink); opacity: 0.86; font-size: 17px; text-shadow: 0 1px 12px var(--halo);
}
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 30px; }
.btn {
  min-height: 47px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 27px; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-kai); font-size: 16px; font-weight: 700; letter-spacing: 0.04em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, #f2839e, #ffb98a); box-shadow: 0 10px 28px rgba(233, 111, 143, 0.45); }
.btn-secondary {
  color: var(--text); background: var(--card); border-color: var(--card-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(122, 82, 130, 0.16);
}
.btn:hover { transform: translateY(-2px); }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); color: var(--hero-ink); opacity: 0.75; 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 {
  margin-bottom: 28px; padding: 32px 34px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow);
}
.section-kicker {
  display: inline-flex; margin: 0 0 8px; padding: 3px 13px;
  border-radius: 999px; background: var(--pill-lav); color: var(--lav);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: var(--font-sans);
}
.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: var(--muted); font-size: 14px; letter-spacing: 0.08em; font-family: var(--font-sans); }
.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: 14px; margin-top: 24px; }
.mini-item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 13px; align-items: start;
  padding: 16px; border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card-solid) 62%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mini-item:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(122, 82, 130, 0.18); }
.mini-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #8a5a46; }
.mini-icon svg { width: 23px; height: 23px; }
.mini-item:nth-child(1) .mini-icon { background: linear-gradient(135deg, #ffe0be, #ffc9a2); }
.mini-item:nth-child(2) .mini-icon { background: linear-gradient(135deg, #ddd0f5, #c3b1ef); color: #5a4a8e; }
.mini-item:nth-child(3) .mini-icon { background: linear-gradient(135deg, #cfe9d4, #aedcbc); color: #3e6e50; }
.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: 20px; }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--card-border); border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid) 72%, transparent);
  box-shadow: 0 6px 22px rgba(122, 82, 130, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(122, 82, 130, 0.22); }
.cover { position: relative; aspect-ratio: 8 / 5; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.post-card:hover .cover img { transform: scale(1.06); }
.cover .tag {
  position: absolute; top: 12px; left: 12px; padding: 2px 12px;
  border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: rgba(70, 50, 90, 0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.post-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.post-body time { color: var(--muted); font-size: 13px; font-family: var(--font-sans); letter-spacing: 0.04em; }
.post-body h3 { margin: 5px 0 0; font-size: 17.5px; font-weight: 700; line-height: 1.5; letter-spacing: 0.01em; transition: color 0.2s ease; }
.post-card:hover h3 { color: var(--primary); }
.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; color: var(--primary); font-size: 14px; font-weight: 700; }
.post-link:hover { text-decoration: underline; text-underline-offset: 5px; }

/* 记录时间线 · 萤火 */
.timeline { position: relative; max-width: 720px; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--lav) 55%, transparent));
}
.timeline-item { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 16px 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -25px; top: 26px; width: 9px; height: 9px; border-radius: 50%;
  background: #ffdf9e; box-shadow: 0 0 0 4px rgba(255, 200, 120, 0.28), 0 0 14px 3px var(--glow);
  animation: firefly 3s ease-in-out infinite;
}
.timeline-item:nth-child(2)::before { animation-delay: 1s; }
.timeline-item:nth-child(3)::before { animation-delay: 2s; }
@keyframes firefly { 50% { box-shadow: 0 0 0 4px rgba(255, 200, 120, 0.16), 0 0 22px 6px var(--glow); } }
.timeline-date {
  align-self: start; justify-self: start; padding: 2px 13px; border-radius: 999px;
  background: var(--pill); color: var(--primary); font-size: 13.5px; font-weight: 700; font-family: var(--font-sans);
}
.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 {
  padding: 20px 22px; border-radius: var(--radius-md);
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 10%, transparent), color-mix(in srgb, var(--lav) 18%, transparent));
  border: 1px solid var(--card-border);
}
.profile-box strong { display: block; margin-bottom: 8px; color: var(--primary); font-size: 16px; letter-spacing: 0.04em; }
.profile-box span { position: relative; display: block; padding: 4px 0 4px 18px; color: var(--text); font-size: 14.5px; }
.profile-box span::before { content: ""; position: absolute; left: 2px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer { max-width: var(--container); margin: 4px auto 26px; padding-inline: 20px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 28px;
  padding: 18px 28px; border-radius: var(--radius-lg);
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  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(--primary); }
.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: 47px; height: 47px; display: grid; place-items: center;
  border: 1px solid var(--card-border); border-radius: 50%;
  background: var(--card); color: var(--primary); cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(122, 82, 130, 0.26);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: #fff; background: linear-gradient(135deg, #f2839e, #ffb98a); }

/* ------------------------------ 动效与响应式 ------------------------------ */
.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; }
@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; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 880px) {
  .mini-list, .post-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .cover { aspect-ratio: 16 / 8; }
}
@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 { padding: 24px 20px; border-radius: 20px; }
  .hero { padding-inline: 18px; }
  .hero-actions { width: 100%; flex-direction: column; }
  .btn { width: 100%; }
  .timeline { padding-left: 26px; }
  .timeline-item { grid-template-columns: 1fr; gap: 7px; }
  .timeline-item::before { left: -23px; }
  .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; }
}
