/* ============================================================
   小小仔的博客网站 · 二次元极客博客
   主题：白色简约 · 液体玻璃 · 浅灰绿点缀
   ============================================================ */

:root {
  /* 白色简约配色（浅灰绿点缀） */
  --pink: #8a9385;
  --pink-deep: #5c6457;
  --pink-soft: #dce0d5;
  --lavender: #aab3a2;
  --lavender-soft: #e6eae0;
  --sky: #b6bfae;
  --sky-soft: #eef1e9;
  --mint: #e4e8de;
  --peach: #f2f4ee;
  --cyan: #6c7566;
  --cyan-soft: #8a9385;
  --magenta: #cfd4c8;
  --cream: #ffffff;
  --ink: #2a2e28;
  --ink-soft: #5f6860;
  --ink-faint: #9aa39a;
  --card: rgba(255, 255, 255, 0.14);
  --card-solid: #ffffff;
  --line: rgba(42, 46, 40, 0.08);
  --shadow: 0 18px 45px rgba(42, 46, 40, 0.07);
  --shadow-hover: 0 26px 60px rgba(42, 46, 40, 0.13);
  --radius: 22px;
  --radius-sm: 14px;
  --grad-hero: linear-gradient(135deg, #ffffff 0%, #f2f4ee 45%, #e6eae0 100%);
  --grad-accent: linear-gradient(135deg, #8a9385 0%, #5c6457 100%);
  --grad-text: linear-gradient(120deg, #2a2e28, #5c6457 60%, #8a9385);
  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 暗色：夜灰绿 · 星河 */
html[data-theme="dark"] {
  --cream: #121512;
  --ink: #eef0ea;
  --ink-soft: #c2c8bd;
  --ink-faint: #8b9385;
  --card: rgba(255, 255, 255, 0.04);
  --card-solid: #1a1e1a;
  --line: rgba(170, 180, 160, 0.2);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 26px 60px rgba(0, 0, 0, 0.65);
  --grad-hero: linear-gradient(135deg, #121512 0%, #181c17 45%, #1c211b 100%);
  --grad-accent: linear-gradient(135deg, #8a9385 0%, #5c6457 100%);
  --grad-text: linear-gradient(120deg, #dce0d5, #9aa39a 50%, #6c7566);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 600px at 85% -5%, rgba(220, 224, 213, 0.2), transparent 60%),
    radial-gradient(1000px 520px at -10% 20%, rgba(182, 191, 174, 0.16), transparent 55%),
    radial-gradient(900px 500px at 50% 110%, rgba(230, 234, 224, 0.2), transparent 60%);
  background-attachment: fixed;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

::selection { background: rgba(92, 100, 87, 0.28); }

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

/* ---------------- 樱花画布 ---------------- */
#sakura-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* 星星（暗色模式） */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.stars span {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

/* ---------------- 容器 ---------------- */
.container { width: min(1160px, 92%); margin-inline: auto; position: relative; z-index: 2; }

/* ---------------- 导航栏 ---------------- */
.navbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin: 14px auto 0;
  width: min(1160px, 92%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.navbar:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.35rem; }
.logo .logo-emoji {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--grad-accent); border-radius: 12px; font-size: 1.2rem;
  box-shadow: 0 6px 16px rgba(92, 100, 87, 0.35);
}
.logo .logo-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  color: var(--ink-soft); transition: 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--pink-deep); background: rgba(138, 147, 133, 0.14); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); cursor: pointer; font-size: 1.15rem;
  display: grid; place-items: center; transition: 0.3s ease;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }

.menu-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); cursor: pointer; font-size: 1.2rem; color: var(--ink);
}

/* ---------------- Hero ---------------- */
.hero { padding: 70px 0 46px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(10px); color: var(--ink-soft); margin-bottom: 22px;
  animation: float 5s ease-in-out infinite;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.15; margin-bottom: 18px;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { max-width: 620px; margin: 0 auto 30px; color: var(--ink-soft); font-size: 1.08rem; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  transition: 0.28s ease; cursor: pointer; border: none;
}
.btn-primary {
  background: var(--grad-accent); color: #fff;
  box-shadow: 0 12px 28px rgba(92, 100, 87, 0.4);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(92, 100, 87, 0.5); }
.btn-ghost {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--pink); color: var(--pink-deep); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------------- 分类标签 ---------------- */
.categories {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 10px 0 8px;
}
.chip {
  padding: 8px 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
  cursor: pointer; transition: 0.25s ease; backdrop-filter: blur(8px);
}
.chip:hover { transform: translateY(-2px); color: var(--pink-deep); border-color: var(--pink); }
.chip.active { background: var(--grad-accent); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(92, 100, 87, 0.35); }

/* ---------------- 精选文章 ---------------- */
.section-title {
  display: flex; align-items: center; gap: 12px; font-family: var(--font-display);
  font-size: 1.7rem; margin: 34px 0 20px;
}
.section-title::before {
  content: ""; width: 8px; height: 30px; border-radius: 6px; background: var(--grad-accent);
}

.featured-card {
  display: grid; grid-template-columns: 1.05fr 1fr; border-radius: var(--radius);
  overflow: hidden; background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(16px); box-shadow: var(--shadow); transition: 0.35s ease;
}
.featured-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.featured-cover {
  position: relative; min-height: 320px; display: grid; place-items: center;
  overflow: hidden; font-size: 4rem;
}
.featured-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 55%);
}
.featured-body { padding: 38px 36px; display: flex; flex-direction: column; gap: 14px; }
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-faint); }
.post-meta .tag {
  padding: 3px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: rgba(138, 147, 133, 0.16); color: var(--pink-deep);
}
.featured-body h2 { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.3; }
.featured-body h2 a:hover { color: var(--pink-deep); }
.featured-body p { color: var(--ink-soft); }
.read-more { font-weight: 700; color: var(--pink-deep); display: inline-flex; align-items: center; gap: 6px; }
.read-more:hover { gap: 10px; }

/* ---------------- 文章列表 ---------------- */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; padding: 20px 0 60px; }
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; backdrop-filter: blur(14px); box-shadow: var(--shadow);
  transition: 0.35s ease; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-8px) rotate(-0.3deg); box-shadow: var(--shadow-hover); }
.post-cover {
  height: 190px; display: grid; place-items: center; font-size: 3.2rem; position: relative; overflow: hidden;
}
.post-cover .cover-blob {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.28); filter: blur(2px); animation: blob 8s ease-in-out infinite;
}
.post-cover .cover-emoji { position: relative; z-index: 2; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15)); transition: 0.4s ease; }
.post-card:hover .cover-emoji { transform: scale(1.15) rotate(-6deg); }
@keyframes blob {
  0%, 100% { transform: translate(-30px, -10px) scale(1); }
  50% { transform: translate(30px, 12px) scale(1.15); }
}
.post-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post-body h3 { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.35; }
.post-body h3 a:hover { color: var(--pink-deep); }
.post-body p { color: var(--ink-soft); font-size: 0.95rem; }
.post-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 0.85rem; color: var(--ink-faint); }
.post-foot .read { color: var(--pink-deep); font-weight: 700; }

/* ---------------- 侧边栏 ---------------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 96px; }
.widget {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.widget h4 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.profile { text-align: center; }
.profile .avatar {
  width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 30px;
  background: var(--grad-accent); display: grid; place-items: center; font-size: 2.6rem;
  box-shadow: 0 12px 28px rgba(92, 100, 87, 0.35); border: 3px solid #fff;
}
.profile h3 { font-family: var(--font-display); }
.profile .bio { color: var(--ink-soft); font-size: 0.9rem; margin: 8px 0 16px; }
.socials { display: flex; justify-content: center; gap: 10px; }
.socials a {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); font-size: 1.05rem; transition: 0.25s ease;
}
.socials a:hover { background: var(--grad-accent); transform: translateY(-3px); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: rgba(138, 147, 133, 0.12); color: var(--ink-soft); transition: 0.25s ease;
}
.tag-cloud a:hover { background: var(--grad-accent); color: #fff; transform: translateY(-2px); }

.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.recent-item:last-child { border-bottom: none; }
.recent-item .r-emoji {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 12px; font-size: 1.3rem; background: var(--grad-accent);
}
.recent-item .r-title { font-size: 0.9rem; font-weight: 600; line-height: 1.4; }
.recent-item .r-title:hover { color: var(--pink-deep); }
.recent-item .r-date { font-size: 0.78rem; color: var(--ink-faint); }

/* ---------------- 关于页 / 文章页 ---------------- */
.page { padding: 56px 0 70px; }
.page-head { text-align: center; margin-bottom: 40px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }
.page-head p { color: var(--ink-soft); max-width: 640px; margin: 0 auto; }

.about-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.about-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center; backdrop-filter: blur(14px); box-shadow: var(--shadow);
  transition: 0.3s ease;
}
.about-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.about-card .icon { font-size: 2.4rem; margin-bottom: 12px; display: inline-block; animation: float 5s ease-in-out infinite; }
.about-card h3 { font-family: var(--font-display); margin-bottom: 8px; }
.about-card p { color: var(--ink-soft); font-size: 0.92rem; }

.article { max-width: 820px; margin: 0 auto; }
.article .post-meta { justify-content: center; margin: 18px 0; }
.article h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.3; text-align: center; }
.article-cover {
  border-radius: var(--radius); height: 260px; display: grid; place-items: center; font-size: 5rem;
  margin: 24px 0; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.article-content {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 44px; backdrop-filter: blur(14px); box-shadow: var(--shadow); font-size: 1.05rem;
}
.article-content h2 { font-family: var(--font-display); margin: 28px 0 14px; font-size: 1.5rem; }
.article-content h2:first-child { margin-top: 0; }
.article-content p { margin-bottom: 16px; color: var(--ink-soft); }
.article-content p strong { color: var(--ink); }
.article-content blockquote {
  border-left: 4px solid var(--pink); padding: 14px 20px; margin: 18px 0;
  background: rgba(138, 147, 133, 0.08); border-radius: 0 14px 14px 0; color: var(--ink-soft); font-style: italic;
}
.article-content ul { margin: 0 0 16px 22px; color: var(--ink-soft); }
.article-content li { margin-bottom: 8px; }

.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; font-weight: 700; color: var(--pink-deep); }
.back-link:hover { gap: 12px; }

.empty { text-align: center; padding: 60px 0; color: var(--ink-soft); grid-column: 1 / -1; }
.empty .emoji { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ---------------- 页脚 ---------------- */
.footer {
  margin-top: 30px; padding: 40px 0 34px; text-align: center;
  border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(138, 147, 133, 0.06));
}
.footer .heart { color: var(--pink-deep); display: inline-block; animation: beat 1.3s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.footer-links { display: flex; justify-content: center; gap: 22px; margin-bottom: 14px; font-weight: 600; }
.footer-links a:hover { color: var(--pink-deep); }

/* ---------------- 回到顶部 ---------------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 30;
  width: 50px; height: 50px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); backdrop-filter: blur(12px); cursor: pointer; font-size: 1.3rem;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(20px); transition: 0.3s ease; color: var(--ink);
}
.to-top.show { opacity: 1; transform: translateY(0); }
.to-top:hover { background: var(--grad-accent); color: #fff; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .widget { flex: 1 1 240px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-cover { min-height: 220px; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: calc(100% + 12px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--card-solid); border: 1px solid var(--line); border-radius: 22px;
    padding: 12px; box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { text-align: center; padding: 12px; }
  .menu-toggle { display: grid; }
  .posts-grid { grid-template-columns: 1fr; }
  .about-cards { grid-template-columns: 1fr; }
  .article-content { padding: 26px 22px; }
  .hero { padding: 48px 0 34px; }
}

/* 尊重减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   液体玻璃（Liquid Glass）+ 自定义背景
   ============================================================ */

/* 背景图片层 */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../images/bg.png') center / cover no-repeat;
  pointer-events: none;
}

/* 背景柔光 + 液态漂浮色块层 */
.bg-tint {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(220, 224, 213, 0.12), transparent 60%),
    radial-gradient(1000px 600px at -10% 30%, rgba(230, 234, 224, 0.12), transparent 55%);
}
html[data-theme="dark"] .bg-tint {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(138, 147, 133, 0.22), transparent 60%),
    radial-gradient(1000px 600px at -10% 30%, rgba(170, 179, 162, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(10, 12, 10, 0.62), rgba(10, 12, 10, 0.44));
}

/* 液态漂浮色块 */
.bg-tint .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.3;
  animation: blobFloat 18s ease-in-out infinite;
}
.bg-tint .blob:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: 4%; background: linear-gradient(135deg, #dce0d5, #aab3a2); }
.bg-tint .blob:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 32%; background: linear-gradient(135deg, #cfd4c8, #8a9385); animation-delay: -7s; }
.bg-tint .blob:nth-child(3) { width: 34vw; height: 34vw; left: 26vw; bottom: -12vw; background: linear-gradient(135deg, #e6eae0, #b6bfae); animation-delay: -12s; }
html[data-theme="dark"] .bg-tint .blob { opacity: 0.32; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6vw, 4vh) scale(1.08); }
  66% { transform: translate(-4vw, 6vh) scale(0.94); }
}

/* 玻璃质感：更通透、更模糊、带顶部高光与斜向折射光 */
.navbar,
.featured-card,
.post-card,
.widget,
.article-content,
.about-card {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 26%, transparent 52%),
    var(--card);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}
.hero-badge,
.chip,
.btn-ghost,
.to-top {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .featured-card,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .about-card {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 26%, transparent 52%),
    var(--card);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .hero-badge,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .to-top {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 现代黑体：标题加粗、字距微调 */
h1, h2, h3, h4, .logo .logo-text {
  font-weight: 700;
  letter-spacing: 0.01em;
}
