/* ======================================
   🌿 全局变量 - 浅色清新版 (✏️ 可编辑)
====================================== */
:root {
  --primary: #4ade80;          /* 清新绿 */
  --primary-hover: #22c55e;    /* 深绿悬停 */
  --accent: #f472b6;           /* 点缀粉 */
  
  /* 浅色毛玻璃变量 */
  --glass-bg: rgba(255, 255, 255, 0.5); /* 菜单/卡片背景 */
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  
  --bg-overlay: rgba(255,255,255,0.2); /* 背景遮罩，让背景图透出来 */
  --text-main: #334155;        /* 深灰文字 */
  --text-light: #64748b;       /* 浅灰文字 */
  
  --font: "Nunito", "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 20px;              /* 大圆角 */
  --sidebar-width: 320px;      /* 弹出菜单宽度 */
}

/* 全局重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  /* 建议搭配浅色或清新的风景图 */
  background: url("https://free.picui.cn/free/2026/04/13/69dc9f270c32a.jpeg") center/cover fixed no-repeat;
  background-color: #f8fafc;
  font-family: var(--font);
  color: var(--text-main);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* 全局遮罩 */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 0;
  pointer-events: none;
}

/* 隐藏广告 & 原生侧边栏 (我们要把它们搬家) */
#ad_c1, #ad_c2, .c_ad, .blog_stats, #ad_under_profile, #ad_side_1, .ad_text, #sideBar { display: none !important; }

/* 动态特效画布 */
#fall-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* 核心布局 */
/* 核心布局 */
#home { 
    position: relative; 
    z-index: 2; 
    max-width: 1050px; 
    margin: 0 auto; 
    padding: 35px 40px; 
    
    /* 👇 新增/修改：添加动画过渡和默认完全显示的状态 */
    transition: opacity 0.8s ease, clip-path 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    clip-path: circle(150% at 50% 50%); /* 默认全屏可见 */
}
#main { width: 100% !important; margin: 0 auto !important; float: none !important; }


/* ======================================
   🍔 触发按钮 (左上角悬浮球)
====================================== */
.menu-trigger {
  position: fixed;
  top: 25px; left: 25px;
  width: 50px; height: 50px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  box-shadow: var(--glass-shadow);
  z-index: 1000;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}
.menu-trigger:hover { transform: scale(1.1); background: #fff; }
.menu-trigger.active { transform: rotate(90deg); }

/* ======================================
   📦 左侧弹出式菜单 (Drawer)
====================================== */
.custom-sidebar-nav {
  position: fixed; left: 0; top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  box-shadow: 5px 0 30px rgba(0,0,0,0.05);
  z-index: 999;
  transform: translateX(-100%); /* 默认隐藏在左侧 */
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow-y: auto;
  padding: 90px 25px 30px 25px; /* 顶部留出按钮空间 */
}

/* 菜单激活状态 */
.custom-sidebar-nav.open { transform: translateX(0); }

/* 遮罩层 (点击关闭菜单) */
.menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.menu-overlay.active { opacity: 1; pointer-events: auto; }

/* 菜单内内容 */
.nav-profile { text-align: center; margin-bottom: 30px; }
.nav-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  object-fit: cover;
  margin-bottom: 15px;
}
.nav-nickname { font-size: 20px; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.nav-stats { font-size: 13px; color: var(--text-light); }

/* 导航链接 */
.nav-list { list-style: none; margin-bottom: 30px; }
.nav-list a {
  display: flex; align-items: center;
  padding: 12px 15px;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
  font-weight: 500;
}
.nav-list a:hover { background: rgba(74, 222, 128, 0.15); color: var(--primary-hover); transform: translateX(5px); }
.nav-list a i { margin-right: 12px; font-style: normal; font-size: 18px; }

/* 小组件容器 */
.sidebar-widget-container {
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #fff;
}
.widget-title {
  font-size: 14px; font-weight: 700; color: var(--text-light);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;
}

/* 强制日历/搜索适应新菜单 */
#blog-calendar, #sidebar_search, .sidebar-block {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: var(--text-main) !important;
}
#blog-calendar table td { border-color: #e2e8f0 !important; color: var(--text-main) !important; }
.CalDayHeader { color: var(--primary) !important; font-weight: bold; }
.CalTitle { color: var(--text-main) !important; }

/* ======================================
   📝 文章卡片 (清新卡片风)
====================================== */
.post, .entrylistItem, .day {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }

.postTitle a, .entrylistPosttitle a {
  font-size: 22px !important; color: var(--text-main) !important; font-weight: 700;
  text-decoration: none !important; transition: color 0.3s;
}
.postTitle a:hover { color: var(--primary) !important; }
.postCon { color: var(--text-light); margin-top: 12px; font-size: 15px; }
.postDesc { margin-top: 15px; color: #94a3b8; font-size: 13px; text-align: right; }

/* 代码块 */
.cnblogs_code, .cnblogs_code div, pre.prettyprint {
  background: #f8fafc !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
}
.cnblogs_code::before {
  content: '● ● ●'; color: #cbd5e1;
  position: absolute; top: 0; left: 0; right: 0;
  height: 24px; background: #e2e8f0;
  border-radius: 12px 12px 0 0;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 4px; font-size: 8px;
}

/* 返回顶部 */
#back-to-top {
  position: fixed; right: 25px; bottom: 30px;
  width: 45px; height: 45px;
  background: #fff; color: var(--primary);
  border-radius: 50%; display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  z-index: 900; border: 1px solid #e2e8f0;
}
#back-to-top.show { display: flex; }

/* 响应式 */
@media (max-width: 768px) {
  :root { --sidebar-width: 85%; }
  .post { padding: 20px; }
}

/* ======================================
   🚫 隐藏博客园默认顶部导航
====================================== */
#navigator, #navList, .blogStats, #top_nav, .headerDiv {
    display: none !important;
}


/* ======================================
   🌟 欢迎引导页 (修正版)
====================================== */

/* 关键：当处于欢迎页模式时，隐藏所有干扰元素 */
body.welcome-active::before {
    display: none !important; /* 隐藏全局白色蒙版，露出清晰背景 */
}
body.welcome-active #home {
    /* 👇 修改这里：不要 display: none，改为 opacity: 0 以便做动画 */
    opacity: 0 !important; 
    clip-path: circle(0% at 50% 50%) !important; /* 初始为一个点 */
    pointer-events: none; /* 防止遮挡点击 */
}
body.welcome-active .menu-trigger {
    display: none !important; /* 隐藏左上角菜单按钮 */
}
body.welcome-active #back-to-top {
    display: none !important; /* 隐藏返回顶部 */
}

#welcome-screen {
    position: fixed; inset: 0;
    z-index: 10000;
    background: transparent; /* 确保自身完全透明 */
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    cursor: pointer;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#welcome-screen.fade-out {
    opacity: 0; visibility: hidden; pointer-events: none;
}

.welcome-text {
    font-size: clamp(1.5rem, 5vw, 3rem); /* 字体更大更醒目 */
    color: #ffffff;
    /* 加强阴影，防止在亮色背景（向日葵）下看不清 */
    text-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 10px rgba(0,0,0,0.3); 
    font-weight: 300; letter-spacing: 6px;
    margin-bottom: 100px;
    opacity: 0; transform: translateY(30px);
    animation: welcomeFadeIn 1.2s ease forwards 0.5s;
}

.welcome-prompt {
    position: absolute; bottom: 60px;
    color: rgba(255,255,255,0.9);
    font-size: 14px; letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    opacity: 0; animation: welcomeFadeIn 1s ease forwards 1.2s;
}

.prompt-arrow {
    font-size: 24px;
    animation: bounceArrow 2s infinite;
}

@keyframes welcomeFadeIn { to { opacity: 1; transform: translateY(0); } }
@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* 欢迎页显示期间禁止页面滚动 */
body.welcome-active { overflow: hidden; }

/* ======================================
   📦 侧边栏模块美化 (新增加)
====================================== */

/* 通用模块盒子 */
.widget-box {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.5);
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(74, 222, 128, 0.3); /* 绿色下划线 */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 链接列表通用样式 (用于索引、排行) */
.widget-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-box li {
    margin: 4px 0;
    font-size: 13px;
}
.widget-box a {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
}
.widget-box a:hover {
    background: rgba(74, 222, 128, 0.15);
    color: var(--primary);
    transform: translateX(4px);
}

/* 索引分组样式 */
.index-group {
    margin-bottom: 10px;
}
.index-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 600;
}

/* 统计数字样式 */
.stats-group {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
}
.stats-group span {
    font-weight: bold;
    color: var(--text-main);
}

/* 搜索框美化 */
#sidebar_search input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.8);
    outline: none;
    font-size: 13px;
    transition: all 0.3s;
}
#sidebar_search input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
#sidebar_search input[type="button"] {
    display: none; /* 隐藏原生按钮，回车即可搜索，或者你可以保留 */
}

/* 日历美化适配 */
#blog-calendar {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}
.CalTitle {
    text-align: center;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 5px;
}
.CalDayHeader {
    color: var(--primary) !important;
    font-size: 12px;
}
.CalOtherMonthDay {
    color: #cbd5e1 !important;
}
