/*
Theme Name: Tech & Fireworks (飞哥风格)
Author: Gemini Custom
Description: 一个基于深色极简风的 WordPress 主题
Version: 1.0
*/

:root {
    --bg-dark: #0d0d0d;
    --card-bg: #1a1a1a;
    --accent: #ff6b00; /* 核心橙色 */
    --text-main: #e0e0e0;
    --text-muted: #888;
    --border: #333;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
}

/* 布局容器 */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* 导航栏 */
header { padding: 30px 0; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.2rem; font-weight: bold; color: var(--text-main); display: flex; align-items: center; }
.logo::before { content: ''; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 10px; }
nav a { margin-right: 10px; }
nav a:hover, nav a.active { color: var(--accent); }

/* 英雄区 (Hero Section) */
.hero { text-align: center; padding: 50px 0; }
.hero h1 { font-size: 3rem; margin-bottom: 10px; }
.hero p { color: var(--text-muted); letter-spacing: 4px; }
.hero-line { width: 40px; height: 4px; background: var(--accent); margin: 30px auto; border-radius: 2px; }

/* 文章网格 */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; padding-bottom: 50px; }
.post-card { background: #1a1a1a66; border-radius: 12px; overflow: hidden; transition: 0.3s; }
.post-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(152, 57, 57, 0.5); }
.post-img { width: 100%; height: 180px; object-fit: cover; background: #222; }
.post-info { padding-left: 20px; }
.post-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; display: flex; gap: 15px; }
.post-title { font-size: 1.1rem; margin-bottom: 15px; color: var(--text-main); text-decoration: none; display: block; }

/* 标签样式 */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn { padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; color: #fff; text-decoration: none; opacity: 0.9; }
.tag-btn:hover { opacity: 1; }

/* 分页 */
.pagination { text-align: center; padding: 50px 0; color: var(--text-muted); }
.next-btn { border: 1px solid var(--border); padding: 8px 25px; border-radius: 8px; color: var(--text-main); text-decoration: none; margin-left: 15px; transition: 0.3s; }
.next-btn:hover { background: var(--accent); border-color: var(--accent); }

.post-content-area {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    line-height: 1.8;
    color: #ccc;
}

.entry-title {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

/* 确保图片不会撑破容器 */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}



/* 1. 顶部大图 */
.post-hero {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    margin-bottom: 50px;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. 两栏布局容器 */
.post-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.post-main-content {
    flex: 1;
    min-width: 0; /* 修复 flex 子元素溢出 */
}

/* 3. 文章标题与元数据 */
.post-header { margin-bottom: 40px;display: block; }
.post-title { font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px; color: #fff; }
.post-meta { display: flex; gap: 20px; color: #888; font-size: 0.85rem; }
.meta-item { display: flex; align-items: center; gap: 6px; }

/* 4. 正文美化 */
.entry-content { font-size: 1.1rem; color: #ccc; line-height: 1.8; }
.entry-content h2 { color: #fff; margin: 40px 0 20px; padding-left: 15px; border-left: 4px solid var(--accent); }

/* 5. 目录栏样式 */
.post-sidebar {
    width: 200px;
    position: sticky;
    top: 100px; /* 滚动时固定 */
}

.toc-wrapper {
    background: rgba(255,255,255,0.03);
    padding: 25px;
    border-radius: 12px;
}

.sidebar-title { font-size: 0.9rem; color: #888; margin-bottom: 20px; letter-spacing: 2px; text-transform: uppercase; }

#toc-container ul { list-style: none; padding: 0; }
.toc-item { margin-bottom: 12px; }
.toc-item a { color: #888; text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.toc-item a:hover { color: var(--accent); }
.toc-h2 { padding-left: 20px; font-size: 0.9rem; } /* 二级标题缩进 */
.toc-h3 { padding-left: 40px; font-size: 0.85rem; } /* 三级标题缩进 */



/* --- 导航栏布局修正 --- */
header {
    padding: 30px 0;
    display: flex;
    justify-content: space-between; /* 左右分布 */
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px; /* Logo 和 菜单的间距 */
}

.header-right {
    display: flex;
    align-items: center;
}

/* --- 全屏搜索层修正 --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* 强制视口宽度 */
    height: 100vh; /* 强制视口高度 */
    background: rgba(10, 10, 10, 0.8); /* 稍微深一点的遮罩 */
    backdrop-filter: blur(20px) saturate(180%); /* 增强毛玻璃感 */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 10000;
    display: none; /* 逻辑由 JS 控制 */
    align-items: center;
    justify-content: center;
}

/* 搜索框容器 */
.search-container {
    width: 90%;
    max-width: 650px;
    background: #161616; /* 深灰色背景 */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 当显示时增加一个简单的位移动画（可选） */
.search-overlay[style*="display: flex"] .search-container {
    transform: translateY(0);
}

.search-input-group {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--accent); /* 使用你主题的橙色作为底边 */
    padding-bottom: 12px;
    gap: 15px;
}

.search-icon {
    color: var(--accent);
    opacity: 0.8;
}

.search-field {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.esc-hint {
    background: rgba(255, 255, 255, 0.05);
    color: #f00;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: monospace;
}

.search-tips {
    margin-top: 20px;
    color: #555;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

/* 关闭层（点击背景关闭） */
.search-overlay-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.header-controls{
    margin-left: 10px;
}


.top-glow-bar {
     pointer-events: none;
      position: fixed;
      top: 0;
      left: 0;
      transition-property: width;
      transition-timing-function: cubic-bezier(.4,0,.2,1);
      transition-duration: 150ms;
      transition-timing-function: cubic-bezier(0,0,.2,1);
      height: 3px;
      width: 0%;
      background: linear-gradient(90deg,#f97316,#f59e0b,#ef4444,#ec4899,#f97316);
        background-size: auto;
      background-size: 300% 100%;
      box-shadow: 0 0 8px rgba(249,115,22,.45),0 0 3px rgba(249,115,22,.7);
      border-radius: 0 0 2px 0;
}







/* 1. 默认隐藏二级菜单 */
.nav-menu .sub-menu {
    display: none;
    list-style: none;
    position: absolute;
}

.nav-menu .sub-menu .menu-item{
    margin-top: 5px;
}

/*一级菜单*/
.nav-menu .menu-item{
  text-align: center;
}

/* 2. 当父级被添加 .is-active 类时显示 */
.nav-menu .menu-item-has-children.is-active > .sub-menu {
    display: block;
}

/* 3. 给有子菜单的项加一个手型图标或指示（可选） */
.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 12px;
}

/*背景特效*/

/* 1. 基础容器：锁定背景不随页面滚动 */
body {
    background: #050505;
    margin: 0;
    overflow-x: hidden;
}

/* 2. 第一层：静态梦幻星云（去掉动画和复杂的滤镜） */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 静态渐变：通过位置错开营造层次感 */
    background: 
        radial-gradient(circle at 15% 15%, rgba(70, 0, 150, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255, 106, 0, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #0a0a0a 0%, #050505 100%);
    z-index: -3;
}

/* 3. 第二层：静态 3D 透视网格（去掉动画、去掉 drop-shadow 滤镜） */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 直接用线条颜色表现发光感，不使用计算昂贵的 filter: drop-shadow */
    background-image: 
        linear-gradient(rgba(255, 106, 0, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.12) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center bottom;
    /* 保持 3D 空间感，但不运动 */
    transform: perspective(500px) rotateX(65deg) scale(2.8);
    transform-origin: center bottom;
    z-index: -2;
    /* 渐隐遮罩：让远方消失在黑暗中 */
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 50%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 50%, transparent);
}

/* 4. 第三层：静态高密度星尘（去掉动画，增加多层静态叠加） */
.cyber-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 静态绘制两组不同大小的微粒，营造景深 */
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1.2px),
        radial-gradient(circle, rgba(255, 106, 0, 0.1) 0.8px, transparent 1px);
    /* 一组密，一组稀 */
    background-size: 40px 40px, 120px 120px;
    background-position: 0 0, 20px 60px;
    opacity: 0.6; /* 调高一点透明度补偿静止后的视觉感 */
    z-index: -1;
}


.nav-menu li a .emoji{
    font-size: 25px;
}



/*//移动端适配*/
/* --- 移动端 App 风格底部导航 --- */
@media screen and (orientation: portrait) {
    /* 1. 隐藏顶部多余元素 */
    .logo, 
    .header-controls,
    .hero-line {
        display: none !important;
    }
    .nav-menu .menu-item{
    border: none;
      border-radius: 10px;
      text-align: center;
    }

    /* 2. 调整 Header 容器，防止留白 */
    header.site-header {
        padding: 10px 0;
        border: none;
    }

    /* 3. 将导航固定在底部 */
    .main-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        /*background: #161616; */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom); /* 适配全面屏底部黑条 */
    }

    /* 4. 菜单项横向平铺 */
    .nav-menu {
        display: flex;
        justify-content: space-around; /* 等分排列 */
        align-items: center;
        gap: 0 !important; /* 移除桌面端的间距 */
        height: 60px;
    }

    .post-sidebar{
        display: none;
    }


    .nav-menu li {
        flex: 1;
        text-align: center;
    }

    .nav-menu li a {
        /*flex-direction: column; */
        font-size: 1.1rem !important;
        color: #888;
        justify-content: center;
        border: 2px solid #f6f6f61a;
        border-radius: 10px;
        width: 80%;
        height: 50px;
        background: #161616e3;
    }

    /* 5. 激活状态样式修正 */
    .nav-menu .current-menu-item > a {
        /*color: var(--accent) !important;*/
        /*border: 2px solid #f6f6f61a;*/
    border-radius: 10px;
    text-align: center;
    }


    .nav-menu .current-menu-item > a::after {
        top: 0; /* 将橙色线条移到顶部 */
        bottom: auto;
        height: 3px;
    }

    /* 6. 给内容区增加底部内边距，防止被导航遮挡 */
    body {
        padding-bottom: 80px;
    }
    
    /* 1. 父级容器处理 */
    .nav-menu .menu-item-has-children {
        position: relative; /* 必须设置，作为二级菜单定位的基准 */
    }
    .nav-menu .menu-item-has-children > a {
        display: inline-flex;    /* 强制文字和三角形在一行 */
        align-items: center;     /* 垂直居中 */
        gap: 4px;               /* 文字和三角形的间距 */
        text-decoration: none;
    }
    /* 2. 二级菜单：向上展开定位 */
    .nav-menu .sub-menu {
        display: none;          /* 默认隐藏 */
        list-style: none;
        padding: 10px;
        margin: 0;
        
        /* 核心：向上定位 */
        position: absolute;
        bottom: 100%;           /* 底部对齐父级的顶部，实现向上弹出 */
        right: 0;
        min-width: 120px;       /* 根据内容调整宽度 */
        z-index: 999;
    }
    /* 3. 点击后的状态（配合之前的 JS） */
    .nav-menu .menu-item-has-children.is-active > .sub-menu {
        display: block;
    }
    /* 4. 三角形图标处理 */
    .menu-item-has-children > a::after {
        content: none;
    }
    
    /* 5. 展开时三角形翻转 */
    .nav-menu .menu-item-has-children.is-active > a::after {
        transform: rotate(180deg);
    }
        
    
    
}


.post-excerpt {
    padding: 20px;
    height: 180px; /* 建议设置一个与图片相近的高度，保持卡片对齐 */
    overflow: hidden;
    font-size: 14px;
    color: #aaa; /* 文字颜色调淡一点，衬托标题 */
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 6; /* 限制显示行数 */
    -webkit-box-orient: vertical;
     display: flex;
      align-items: center;
}

.post-excerpt a {
    color: inherit;
    text-decoration: none;
}













