/* =========================================
   全局变量与浅色主题设置
   ========================================= */
:root {
    --glass-bg: rgba(255, 255, 255, 0.45); 
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --text-main: #2c3e50;
    --text-muted: #6c7a89;
    
    --accent-1: #a1c4fd; 
    --accent-3: #ffb199; 
    --accent-4: #ff0844;

    --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Georgia", serif;
    --font-sans: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent-1), var(--accent-3)); border-radius: 10px; }

html { scroll-behavior: auto; }

body {
    margin: 0; padding: 0;
    font-family: var(--font-sans);
    color: var(--text-main);
    overflow-x: hidden; line-height: 1.8;
}

/* =========================================
   背景与魔法光尘
   ========================================= */
.background-layer { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -4; 
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: background-image 1s ease-in-out;
}
.background-layer::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(246,248,253,0.4) 100%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.bg-orb { position: fixed; border-radius: 50%; filter: blur(80px); z-index: -3; mix-blend-mode: overlay; animation: floatOrb 20s infinite alternate ease-in-out; }
.bg-orb-1 { width: 60vw; height: 60vw; background: rgba(161, 196, 253, 0.5); top: -10vh; left: -10vw; }
.bg-orb-2 { width: 50vw; height: 50vw; background: rgba(255, 177, 153, 0.5); bottom: -10vh; right: -10vw; animation-delay: -5s; }
@keyframes floatOrb { 0% { transform: translate(0, 0) scale(1) rotate(0deg); } 50% { transform: translate(15vw, 10vh) scale(1.1) rotate(180deg); } 100% { transform: translate(-10vw, 20vh) scale(0.9) rotate(360deg); } }

.dust-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; overflow: hidden;}
.dust { position: absolute; bottom: -50px; background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 80%); border-radius: 50%; animation: dustRise var(--duration) linear infinite, dustSway var(--sway-duration) ease-in-out infinite alternate; }
@keyframes dustRise { 0% { transform: translateY(0) scale(0.5); opacity: 0; } 20% { opacity: var(--max-opacity); scale: 1.2; } 50% { opacity: calc(var(--max-opacity) / 2); scale: 0.8; } 80% { opacity: var(--max-opacity); scale: 1.1; } 100% { transform: translateY(-110vh) scale(0.5); opacity: 0; } }
@keyframes dustSway { 0% { margin-left: 0px; } 100% { margin-left: var(--sway-range); } }

#cursor-glow { position: fixed; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%); pointer-events: none; transform: translate(-50%, -50%); z-index: 9999; transition: width 0.2s, height 0.2s, background 0.2s; mix-blend-mode: soft-light; }

/* 通用布局与玻璃面板 */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px 100px 20px; }
.glass-panel { background: rgba(255, 255, 255, 0.45); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: var(--glass-shadow); padding: 50px; }
.nav-btn { display: inline-flex; align-items: center; padding: 10px 25px; margin: 10px 5px; color: var(--text-main); text-decoration: none; font-weight: bold; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.8); border-radius: 30px; background: rgba(255,255,255,0.3); backdrop-filter: blur(10px); transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.nav-btn:hover { background: rgba(255,255,255,0.8); box-shadow: 0 8px 25px rgba(161, 196, 253, 0.5); transform: translateY(-3px); }

/* =========================================
   首页
   ========================================= */
.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; }

.hero h1 { 
    font-family: var(--font-serif); 
    font-size: 5.5rem; 
    margin: 0; 
    letter-spacing: 2px; 
    font-weight: 800; 
    /* 静态渐变：浅粉 -> 深红 */
    background: linear-gradient(135deg, #ff9a9e 0%, #b91c1c 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    text-shadow: 0px 10px 30px rgba(185, 28, 28, 0.2); 
    animation: fadeInDown 1s ease-out; 
}
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }

.typewriter-container {
    font-size: 1.25rem; color: #555; margin-top: 25px; 
    font-weight: 500; letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5em;
}
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--accent-1);
    margin-left: 5px;
    animation: blink-caret 0.75s step-end infinite;
}
@keyframes blink-caret { from, to { opacity: 1; } 50% { opacity: 0; } }

.scroll-indicator { position: absolute; bottom: 5vh; text-decoration: none; display: flex; flex-direction: column; align-items: center; color: var(--text-main); transition: opacity 0.3s, transform 0.3s; cursor: pointer;}
.scroll-indicator:hover { opacity: 0.7; transform: translateY(5px); }
.mouse { width: 26px; height: 42px; border: 2px solid var(--text-main); border-radius: 20px; position: relative; margin-bottom: 10px; }
.mouse::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 8px; background: var(--text-main); border-radius: 4px; animation: scrollMouse 1.5s infinite; }
@keyframes scrollMouse { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 15px); opacity: 0; } }

.content-wrapper { min-height: 100vh; padding-top: 50px; }

/* 文章列表卡片 */
.post-list { display: flex; flex-direction: column; gap: 40px; }
.post-item { display: flex; flex-direction: row; gap: 30px; align-items: center; text-decoration: none; color: inherit; overflow: hidden; position: relative; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); padding: 25px; }
.post-item::before { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent); transform: skewX(-20deg); transition: all 0.7s ease; z-index: 1; }
.post-item:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 20px 45px rgba(161, 196, 253, 0.3); border-color: #fff; background: rgba(255,255,255,0.7); }
.post-item:hover::before { left: 150%; }

.post-cover { width: 280px; height: 180px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 20px rgba(0,0,0,0.1); transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 2; }
.post-item:hover .post-cover { transform: scale(1.04) rotate(1.5deg); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }

.post-info { flex: 1; z-index: 2; }
.post-info h2 { font-family: var(--font-serif); margin: 0 0 10px 0; font-size: 1.8rem; color: #1a252f; transition: color 0.3s; letter-spacing: 1px;}
.post-item:hover .post-info h2 { color: var(--accent-1); }
.post-info .date { font-size: 0.85rem; color: #fff; background: var(--accent-3); font-weight: bold; margin-bottom: 12px; display: inline-block; padding: 4px 12px; border-radius: 20px; box-shadow: 0 4px 10px rgba(255, 177, 153, 0.4); }
.post-info p { margin: 0; color: #555; line-height: 1.6; font-size: 1.05rem;}

.reveal { opacity: 0; transform: translateY(60px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* =========================================
   Markdown 排版
   ========================================= */
.article-hero { height: 40vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; }
.article-header { text-align: center; margin-bottom: 20px; }
.article-header h1 { font-family: var(--font-serif); font-size: 3rem; margin: 0 0 15px 0; color: #1a252f; font-weight: 700; text-shadow: 0 2px 20px rgba(255,255,255,0.9); letter-spacing: 2px;}

.article-content { 
    font-size: 1.15rem; color: #34495e; margin-top: -30px; position: relative; z-index: 5;
    /* 关键修复：确保有 opacity:0 起始状态 */
    opacity: 0; 
    /* 关键修复：补回了 slowFadeIn 动画 */
    animation: slowFadeIn 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; 
    animation-delay: 0.2s; 
}
/* 🌟 关键修复：补回了缺失的动画定义，让正文可以从下方渐入显示 */
@keyframes slowFadeIn { 
    from { opacity: 0; transform: translateY(40px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4 { font-family: var(--font-serif); color: #2c3e50; margin-top: 60px; margin-bottom: 20px; font-weight: 700; line-height: 1.4; }
.article-content h2 { font-size: 2.2rem; position: relative; padding-left: 20px; }
.article-content h2::before { content: ''; position: absolute; left: 0; top: 10%; height: 80%; width: 5px; background: linear-gradient(to bottom, var(--accent-1), var(--accent-3)); border-radius: 5px; }
.article-content h3 { font-size: 1.6rem; color: #34495e; }
.article-content p { margin-bottom: 25px; line-height: 1.9; font-weight: 400; color: #4a5568;}
.article-content strong { color: #1a202c; font-weight: 600; background: linear-gradient(180deg, transparent 60%, rgba(161, 196, 253, 0.4) 0); }
.article-content > p:first-of-type::first-letter { font-family: var(--font-serif); font-size: 4.5rem; float: left; margin: 10px 15px 0 0; color: var(--accent-3); line-height: 0.8; font-weight: 900; text-shadow: 2px 2px 10px rgba(255, 177, 153, 0.4); }
.article-content img { max-width: 100%; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: block; margin: 40px auto; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 2px solid rgba(255,255,255,0.8); }
.article-content img:hover { transform: scale(1.02) translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.article-content blockquote { margin: 40px 0; padding: 25px 40px; border-radius: 12px; font-style: italic; color: #4a5568; font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.8; background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 100%); border: 1px solid rgba(255,255,255,0.9); box-shadow: 0 10px 30px rgba(161, 196, 253, 0.15); position: relative; }
.article-content blockquote::before { content: '“'; position: absolute; top: -10px; left: 15px; font-size: 5rem; color: rgba(161, 196, 253, 0.3); font-family: var(--font-serif); line-height: 1; }
.article-content a { color: var(--accent-4); text-decoration: none; position: relative; font-weight: 600; transition: color 0.3s;}
.article-content a::after { content: ''; position: absolute; width: 100%; height: 2px; bottom: -2px; left: 0; background-color: var(--accent-4); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.3s ease-out; }
.article-content a:hover::after { transform: scaleX(1); transform-origin: bottom left; }
.article-content code { background: rgba(255,255,255,0.7); padding: 4px 10px; border-radius: 8px; font-family: Consolas, Monaco, monospace; font-size: 0.85em; color: #e53e3e; border: 1px solid rgba(255,255,255,0.9); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.article-content pre { background: #1e1e1e; padding: 45px 20px 20px 20px; border-radius: 16px; overflow-x: auto; box-shadow: 0 15px 35px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); margin: 40px 0; position: relative; }
.article-content pre::before { content: ''; position: absolute; top: 15px; left: 20px; width: 12px; height: 12px; border-radius: 50%; background: #ff5f56; box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f; }
.article-content pre code { background: transparent; padding: 0; color: #a1c4fd; border: none; font-size: 0.9em; box-shadow: none; line-height: 1.6; }
.article-content ul, .article-content ol { padding-left: 20px; margin-bottom: 25px; }
.article-content li { margin-bottom: 12px; padding-left: 10px; position: relative; list-style-type: none;}
.article-content ul li::before { content: '✦'; position: absolute; left: -15px; top: 0; color: var(--accent-1); text-shadow: 0 0 8px var(--accent-1); font-size: 1.1rem; }
.article-content ol { counter-reset: custom-counter; }
.article-content ol li { counter-increment: custom-counter; }
.article-content ol li::before { content: counter(custom-counter) ". "; position: absolute; left: -15px; font-weight: bold; color: var(--accent-3); }
.article-content hr { border: 0; height: 1px; margin: 60px 0; background: linear-gradient(to right, transparent, rgba(161, 196, 253, 0.6), transparent); position: relative; }
.article-content hr::after { content: '✧'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--glass-bg); padding: 0 15px; color: var(--accent-1); font-size: 1.5rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 40px 0; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.3); box-shadow: 0 5px 15px rgba(0,0,0,0.05); display: block; overflow-x: auto; }
.article-content th, .article-content td { padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.6); text-align: left; }
.article-content th { background: rgba(255,255,255,0.6); font-weight: bold; color: #2c3e50; font-family: var(--font-serif); letter-spacing: 1px;}
.article-content tr:hover { background: rgba(255,255,255,0.8); transition: background 0.3s ease; }