/* =========================================
   罗小黑战记风格主题 (Luo Xiaohei Theme)
   Modern Clean CSS by AI Assistant
   ========================================= */

:root {
    /* --- 核心配色 (Color Palette) --- */
    
    /* 背景色：柔和的米白/淡青，像灵质空间的背景 */
    --bg-color: #f7fcf9;
    --card-bg: #ffffff;
    
    /* 主色调：自然清新的森林绿 */
    --primary-color: #6ab04c;
    --primary-hover: #58a03c;
    
    /* 强调色：灵质蓝/青色 */
    --accent-color: #7ed6df;
    
    /* 辅助色：小黑的黑色 */
    --dark-text: #2d3436;
    --light-text: #636e72;
    
    /* 边框和分割线 */
    --border-color: #dfe6e9;
    
    /* --- 布局变量 --- */
    --container-width: 1100px;
    --header-height: 70px;
    --radius-lg: 20px;
    --radius-md: 12px;
    
    /* --- 阴影 (柔和漂浮感) --- */
    --shadow-sm: 0 4px 6px rgba(106, 176, 76, 0.05);
    --shadow-md: 0 8px 15px rgba(106, 176, 76, 0.1);
    --shadow-hover: 0 12px 24px rgba(106, 176, 76, 0.15);
}

/* 黑暗模式支持 (预留) */
@media (prefers-color-scheme: dark) {
    /* :root {
        --bg-color: #1e272e;
        --card-bg: #2d3436;
        --dark-text: #dfe6e9;
        --light-text: #b2bec3;
    } */
    /* 暂时保持清新亮色风格，黑暗模式可后续开启 */
}

/* =========================================
   全局重置 & 基础样式
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--dark-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   组件 (Components)
   ========================================= */

/* 容器 */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮 - 灵动圆润风格 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 卡片 - 悬浮效果 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

/* =========================================
   Header & Nav
   ========================================= */
header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    color: var(--light-text);
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-text);
}

/* =========================================
   Hero Section (首页简介)
   ========================================= */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 装饰背景圆 */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: -5%;
    width: 250px;
    height: 250px;
    background: var(--primary-color);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.hero-content h1 span {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* =========================================
   Grid Layouts (博客 & 工具)
   ========================================= */
.section-title {
    text-align: center;
    margin: 3rem 0;
    font-size: 2rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 4px;
    background: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 4rem;
}

/* Blog Card Specifics */
.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.blog-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.blog-tag {
    background-color: #f0fdf4;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Tool Card Specifics */
.tool-card {
    text-align: center;
    align-items: center;
}

.tool-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    background: #f0fdf4;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.card:hover .tool-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(10deg);
}

/* =========================================
   Markdown Content
   ========================================= */
.markdown-body {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 4rem;
}

.markdown-body h1, .markdown-body h2 { border-bottom: 1px solid #eee; padding-bottom: 10px; margin-top: 1.5em; }
.markdown-body p { margin-bottom: 1.2em; }
.markdown-body code { background: #f5f5f5; padding: 2px 5px; border-radius: 4px; font-family: monospace; color: #c7254e; }
.markdown-body pre { background: #f8f8f8; padding: 15px; border-radius: 8px; overflow-x: auto; margin-bottom: 1.5em; }
.markdown-body blockquote { border-left: 4px solid var(--primary-color); padding-left: 15px; color: #777; background: #f9f9f9; margin: 1em 0; }

/* =========================================
   Footer
   ========================================= */
footer {
    background-color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.social-icons {
    margin-bottom: 1rem;
}

.social-icons a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f2f6;
    color: var(--dark-text);
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
        text-align: center;
    }
    
    .hero-content h1 { font-size: 2rem; }
}
