/* =========================================
 * Hexo-Blog Purple Theme v2
 * 精确复刻 lishenghua.com 3D Bento 设计
 * ========================================= */

/* ----- Google Fonts 加载 ----- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&family=Space+Grotesk:wght@500;700;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@300,1&display=swap');

/* ----- CSS 变量 ----- */
:root {
    --bg-light: #312052;
    --purple-primary: #7e5adc;
    --purple-neon: #6d28d9;
    --purple-dark: #2b1b54;
    --purple-light: #a894df;
    --purple-50: #fcfaff;
    --purple-100: #f8f5fc;
    --purple-200: #e5e0f5;
    --purple-900: #2b1b54;
}

/* =========================================
 * 全局基础
 * ========================================= */
html, html[data-user-color-scheme="light"], html[data-user-color-scheme="dark"] {
    background-color: var(--bg-light) !important;
}

body {
    background-color: var(--bg-light) !important;
    color: #e5e0f5 !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Fluid 主题背景覆盖 */
.blog-wrapper, #web_bg {
    background-color: var(--bg-light) !important;
}

::selection {
    background: rgba(126, 90, 220, 0.4) !important;
    color: #fff !important;
}

/* =========================================
 * 背景装饰层 (lishenghua.com 风格)
 * ========================================= */
.blog-wrapper::before,
.blog-wrapper::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* ambient-mesh */
.blog-wrapper::before {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(126, 90, 220, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(109, 40, 217, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 60% 30%, rgba(126, 90, 220, 0.04) 0%, transparent 50%);
}

/* dot-matrix */
.blog-wrapper::after {
    background-image: radial-gradient(rgba(126, 90, 220, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 0;
}

/* =========================================
 * 全局字体覆盖
 * ========================================= */
h1, h2, h3, h4, h5, h6,
.navbar-brand, .navbar-brand .brand-text,
.index-header a,
.post-title a,
.card-title,
.page-header-title,
.archive-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
}

code, pre, .code,
.highlight,
.post-meta,
.category-list-count,
.tag-list-count,
.post-meta time {
    font-family: 'Space Mono', monospace !important;
}

/* =========================================
 * 导航栏：浮动毛玻璃药丸
 * ========================================= */
.navbar {
    position: fixed !important;
    top: 1.5rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 900px !important;
    width: calc(100% - 3rem) !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(126, 90, 220, 0.12) !important;
    box-shadow: 0 10px 40px rgba(126, 90, 220, 0.08) !important;
    z-index: 1000 !important;
    transition: box-shadow 0.3s ease, background 0.3s ease !important;
}

.navbar.scrolled {
    box-shadow: 0 10px 40px rgba(126, 90, 220, 0.2) !important;
    background: rgba(255, 255, 255, 0.85) !important;
}

.navbar-brand {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 900 !important;
    color: var(--purple-900) !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0 !important;
    line-height: 1 !important;
}

.navbar-brand:hover {
    color: var(--purple-900) !important;
}

/* 导航链接 */
.navbar-collapse .nav-item .nav-link,
.nav-link {
    font-family: 'Space Mono', monospace !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: rgba(43, 27, 84, 0.5) !important;
    transition: all 0.3s ease !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 9999px !important;
}

.nav-link:hover,
.nav-link:focus,
.navbar-collapse .nav-item .nav-link:hover {
    color: var(--purple-900) !important;
    background: rgba(126, 90, 220, 0.1) !important;
}

.nav-link.active {
    color: #fff !important;
    background: var(--purple-primary) !important;
}

/* 搜索按钮 & 暗色模式按钮 */
.navbar-nav .nav-link .search-btn,
.navbar-nav .nav-link .dark-mode-btn {
    color: rgba(43, 27, 84, 0.5) !important;
}

/* =========================================
 * Banner 区域：隐藏灯塔图片，纯渐变
 * ========================================= */
div.banner,
#board,
.page-header {
    background-image: none !important;
    background: linear-gradient(135deg, rgba(43, 27, 84, 0.95) 0%, rgba(109, 40, 217, 0.5) 50%, rgba(126, 90, 220, 0.3) 100%) !important;
    min-height: auto !important;
}

/* header-inner 高度压缩 */
.header-inner {
    height: auto !important;
    min-height: 0 !important;
    padding-top: 5rem !important;
    padding-bottom: 0 !important;
}

/* Banner 背景图层隐藏 */
div.banner .banner-img,
div.banner .full-bg-img,
#board .banner-img,
#board .index-banner,
.page-header .banner-img {
    display: none !important;
}

/* 首页 Banner 压缩为紧凑高度 */
#board {
    margin-top: 5rem !important;
    padding-top: 3rem !important;
    padding-bottom: 1rem !important;
}

.index-header {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 900 !important;
}

.index-header a {
    color: #fff !important;
    transition: color 0.3s ease !important;
}

.index-header a:hover {
    color: var(--purple-light) !important;
}

/* 打字机光标 */
.typed-cursor {
    color: var(--purple-primary) !important;
}

/* =========================================
 * 首页文章卡片：3D 解构系统
 * 复刻 lishenghua.com v-card 系统
 * ========================================= */
#board .row {
    perspective: 2000px;
}

.index-card {
    position: relative;
    transform-style: preserve-3d;
    border-radius: 1.5rem !important;
    overflow: hidden !important;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1) !important;
    will-change: transform;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(126, 90, 220, 0.12) !important;
    box-shadow: 0 4px 15px rgba(126, 90, 220, 0.1),
                0 0 0 1px rgba(126, 90, 220, 0.05) !important;
}

/* 底板层效果（伪元素模拟 v-base） */
.index-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--purple-primary);
    transform: translateZ(0);
    z-index: -1;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(126, 90, 220, 0.3);
}

/* 玻璃层效果（伪元素模拟 v-glass） */
.index-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateZ(20px);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

/* 内容层 */
.index-card .index-img,
.index-card .index-info {
    position: relative;
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* === 悬停 3D 解构 === */
.index-card:hover {
    transform: translateY(-12px) scale(1.02) !important;
    box-shadow: 0 30px 60px rgba(126, 90, 220, 0.3),
                0 0 0 1px rgba(126, 90, 220, 0.4) !important;
    border-color: rgba(126, 90, 220, 0.35) !important;
}

.index-card:hover::before {
    opacity: 0.15;
    transform: translateZ(-30px) scale(0.98);
    background: var(--purple-neon);
    box-shadow: 0 30px 60px rgba(126, 90, 220, 0.4), 0 0 0 1px rgba(126, 90, 220, 0.6);
}

.index-card:hover::after {
    opacity: 1;
    transform: translateZ(0);
}

.index-card:hover .index-img,
.index-card:hover .index-info {
    transform: translateZ(30px);
}

/* 封面图 */
.index-card .index-img {
    overflow: hidden !important;
    border-radius: 0 !important;
}

.index-card .index-img img {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.index-card:hover .index-img img {
    transform: scale(1.08) !important;
}

/* 摘要文字 */
.index-excerpt div {
    color: rgba(229, 224, 245, 0.7) !important;
}

/* 元信息 */
.post-meta {
    color: rgba(168, 148, 223, 0.7) !important;
    font-size: 0.8rem !important;
}

.post-meta .iconfont {
    color: rgba(168, 148, 223, 0.5) !important;
}

/* 分类标签 */
.category-name,
.tag-name {
    color: rgba(168, 148, 223, 0.8) !important;
}

/* =========================================
 * 文章详情页
 * ========================================= */
.post-content,
.post-block,
.page-content {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(126, 90, 220, 0.1) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    padding: 2.5rem !important;
    position: relative !important;
    z-index: 10 !important;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: 'Space Grotesk', sans-serif !important;
    color: #fff !important;
}

.post-content p,
.post-content li {
    color: rgba(229, 224, 245, 0.85) !important;
    line-height: 1.8 !important;
}

.post-content a {
    color: var(--purple-light) !important;
    text-decoration-color: rgba(126, 90, 220, 0.3) !important;
    transition: all 0.3s ease !important;
}

.post-content a:hover {
    color: #fff !important;
    text-decoration-color: var(--purple-primary) !important;
}

/* 引用块 */
.post-content blockquote {
    background: rgba(126, 90, 220, 0.08) !important;
    border-left: 4px solid var(--purple-primary) !important;
    color: rgba(229, 224, 245, 0.8) !important;
    border-radius: 0 0.75rem 0.75rem 0 !important;
    padding: 1rem 1.5rem !important;
}

/* 代码块 */
.highlight {
    background: rgba(17, 24, 39, 0.8) !important;
    border: 1px solid rgba(126, 90, 220, 0.2) !important;
    border-radius: 0.75rem !important;
    backdrop-filter: blur(8px) !important;
}

.highlight pre {
    background: transparent !important;
}

/* 代码复制按钮 */
.highlight .copy-btn,
.code-block-wrapper .copy-btn {
    background: var(--purple-primary) !important;
    color: #fff !important;
    border-radius: 0.5rem !important;
}

/* 内联代码 */
.post-content code:not(.highlight code):not(pre code) {
    background: rgba(126, 90, 220, 0.15) !important;
    color: var(--purple-light) !important;
    padding: 0.15em 0.4em !important;
    border-radius: 0.375rem !important;
}

/* 表格 */
.post-content table {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(126, 90, 220, 0.15) !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
}

.post-content table th {
    background: rgba(126, 90, 220, 0.15) !important;
    color: #fff !important;
    font-family: 'Space Grotesk', sans-serif !important;
}

.post-content table td {
    border-color: rgba(126, 90, 220, 0.1) !important;
    color: rgba(229, 224, 245, 0.8) !important;
}

/* 文章标题栏 */
.post-title {
    font-family: 'Space Grotesk', sans-serif !important;
    color: #fff !important;
}

/* =========================================
 * 侧边栏
 * ========================================= */
.card,
.sidebar-block,
.widget {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(126, 90, 220, 0.12) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

.card-header,
.widget-title {
    font-family: 'Space Grotesk', sans-serif !important;
    color: #fff !important;
    border-bottom-color: rgba(126, 90, 220, 0.15) !important;
}

/* 分类/标签列表 */
.category-list-link,
.tag-list-link {
    color: rgba(229, 224, 245, 0.75) !important;
    transition: all 0.3s ease !important;
}

.category-list-link:hover,
.tag-list-link:hover {
    color: var(--purple-light) !important;
    padding-left: 0.5rem !important;
}

.category-list-count,
.tag-list-count {
    background: rgba(126, 90, 220, 0.15) !important;
    color: var(--purple-light) !important;
    border-radius: 9999px !important;
    padding: 0.15rem 0.6rem !important;
    font-size: 0.75rem !important;
}

/* 标签云 */
.tag-cloud a {
    background: rgba(126, 90, 220, 0.1) !important;
    color: var(--purple-light) !important;
    border: 1px solid rgba(126, 90, 220, 0.2) !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.75rem !important;
    font-family: 'Space Mono', monospace !important;
    font-size: 0.75rem !important;
    transition: all 0.3s ease !important;
}

.tag-cloud a:hover {
    background: var(--purple-primary) !important;
    color: #fff !important;
    border-color: var(--purple-primary) !important;
    transform: translateY(-2px) !important;
}

/* =========================================
 * 归档/分类/标签页面
 * ========================================= */
.page-header-title,
.archive-title,
.category-title,
.tag-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 900 !important;
    color: #fff !important;
}

/* 归档时间线 */
.archive-timeline .archive-year {
    font-family: 'Space Grotesk', sans-serif !important;
    color: var(--purple-light) !important;
}

.archive-timeline .archive-post-title a {
    color: rgba(229, 224, 245, 0.85) !important;
    transition: color 0.3s ease !important;
}

.archive-timeline .archive-post-title a:hover {
    color: var(--purple-primary) !important;
}

/* =========================================
 * 关于页面
 * ========================================= */
.about-avatar {
    border: 3px solid var(--purple-primary) !important;
    box-shadow: 0 0 30px rgba(126, 90, 220, 0.3) !important;
}

.about-social-link,
.social-item a {
    background: rgba(126, 90, 220, 0.15) !important;
    color: var(--purple-light) !important;
    border: 1px solid rgba(126, 90, 220, 0.2) !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

.about-social-link:hover,
.social-item a:hover {
    background: var(--purple-primary) !important;
    color: #fff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(126, 90, 220, 0.3) !important;
}

/* =========================================
 * 页脚
 * ========================================= */
#footer {
    background: rgba(17, 10, 33, 0.6) !important;
    border-top: 1px solid rgba(126, 90, 220, 0.1) !important;
    color: rgba(229, 224, 245, 0.4) !important;
    padding: 2rem 0 !important;
}

#footer a {
    color: rgba(168, 148, 223, 0.6) !important;
    transition: color 0.3s ease !important;
}

#footer a:hover {
    color: var(--purple-light) !important;
}

#footer .iconfont {
    color: var(--purple-primary) !important;
}

/* =========================================
 * 回到顶部按钮
 * ========================================= */
#go-up,
.scroll-top-btn,
.go-up-btn {
    background: var(--purple-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(126, 90, 220, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

#go-up:hover,
.scroll-top-btn:hover,
.go-up-btn:hover {
    background: var(--purple-neon) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(109, 40, 217, 0.5) !important;
}

/* =========================================
 * 加载进度条
 * ========================================= */
#nprogress .bar {
    background: linear-gradient(90deg, var(--purple-primary), var(--purple-neon)) !important;
    height: 3px !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px var(--purple-primary), 0 0 5px var(--purple-primary) !important;
}

#nprogress .spinner-icon {
    border-top-color: var(--purple-primary) !important;
    border-left-color: var(--purple-primary) !important;
}

/* =========================================
 * 搜索弹窗
 * ========================================= */
.search-dialog,
.local-search-dialog {
    background: rgba(43, 27, 84, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(126, 90, 220, 0.2) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.search-dialog input,
.local-search-dialog input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(126, 90, 220, 0.2) !important;
    color: #fff !important;
    border-radius: 9999px !important;
}

.search-dialog input::placeholder,
.local-search-dialog input::placeholder {
    color: rgba(168, 148, 223, 0.5) !important;
}

.search-result-item,
.local-search-result-item {
    color: rgba(229, 224, 245, 0.8) !important;
    border-bottom-color: rgba(126, 90, 220, 0.1) !important;
}

.search-result-item:hover,
.local-search-result-item:hover {
    background: rgba(126, 90, 220, 0.1) !important;
}

.search-keyword {
    color: var(--purple-primary) !important;
    font-weight: 700 !important;
}

/* =========================================
 * GSAP 滚动入场动画
 * ========================================= */
.gsap-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.gsap-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 卡片交错入场 */
.index-card:nth-child(1) .gsap-reveal,
.index-card:nth-child(1) { transition-delay: 0.05s; }
.index-card:nth-child(2) .gsap-reveal,
.index-card:nth-child(2) { transition-delay: 0.12s; }
.index-card:nth-child(3) .gsap-reveal,
.index-card:nth-child(3) { transition-delay: 0.19s; }
.index-card:nth-child(4) .gsap-reveal,
.index-card:nth-child(4) { transition-delay: 0.26s; }
.index-card:nth-child(5) .gsap-reveal,
.index-card:nth-child(5) { transition-delay: 0.33s; }
.index-card:nth-child(6) .gsap-reveal,
.index-card:nth-child(6) { transition-delay: 0.40s; }

/* =========================================
 * 滚动条美化
 * ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: rgba(126, 90, 220, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 90, 220, 0.5);
}

/* =========================================
 * 暗色模式适配
 * ========================================= */
[data-user-color-scheme="dark"] body,
body[data-theme="dark"],
html[data-user-color-scheme="dark"] body {
    background-color: var(--bg-light) !important;
}

/* =========================================
 * 响应式
 * ========================================= */
@media (max-width: 768px) {
    .navbar {
        top: 0.75rem !important;
        padding: 0.4rem 1rem !important;
        border-radius: 1rem !important;
    }

    .index-card {
        border-radius: 1rem !important;
    }

    .post-content,
    .post-block,
    .page-content {
        border-radius: 1rem !important;
        padding: 1.25rem !important;
    }
}

/* =========================================
 * Material Symbols
 * ========================================= */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* =========================================
 * 确保内容在背景装饰之上
 * ========================================= */
.markdown-body {
    position: relative !important;
    z-index: 10 !important;
}

