/*
Theme Name: Jons Mode Lab
Version: 1.1.7
*/

/* ==========================================================================
   1. 结构逻辑修复
   ========================================================================== */
   .mobile-single-top-nav { display: none !important; }
   .mobile-top-logo-img { width: 44px !important; height: 44px !important; border-radius: 50%; }
   
   /* ==========================================================================
      2. 基础全局定义
      ========================================================================== */
   :root {
     --bg-color: #f5f6f8; 
     --card-bg: #ffffff;
     --text-main: #2a2a2a;
     --border-color: #eaeaea;
     --font-sans: 'MiSans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
     --sidebar-width: 320px;
   }
   
   * { box-sizing: border-box; margin: 0; padding: 0; }
   body { font-family: var(--font-sans); background-color: var(--bg-color); color: var(--text-main); -webkit-font-smoothing: antialiased; }
   a { color: inherit; text-decoration: none; }
   img { max-width: 100%; height: auto; display: block; }
   
   /* ==========================================================================
      3. 布局与侧边栏
      ========================================================================== */
   .site-wrapper { display: flex; min-height: 100vh; flex-direction: column; }
   .site-sidebar { padding: 3rem 2rem; background: var(--card-bg); display: flex; flex-direction: column; align-items: center; }
   .site-main { flex: 1; padding: 2rem; width: 100%; position: relative; display: flex; flex-direction: column; }
   
   .site-branding { margin-bottom: 2rem; text-align: center; }
   .author-avatar { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 1rem; border: 1px solid var(--border-color); }
   .site-title { font-size: 1.5rem; font-weight: 700; }
   .site-description { font-size: 12px; color: #999; line-height: 1.6; margin-top: 8px; }
   
   .main-navigation { width: 100%; }
   .nav-menu { list-style: none !important; display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
   .nav-menu > li { width: 100%; display: flex; flex-direction: column; align-items: center; }
   .nav-menu a { display: inline-flex; align-items: center; justify-content: center; padding: 8px 20px; border-radius: 50px; font-weight: 500; font-size: 18px; }
   .nav-menu li.current-menu-item > a { background: #111; color: #fff; }
   
   /* Submenu styling */
   .nav-menu .sub-menu { list-style: none !important; padding-left: 20px; display: none; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
   .nav-menu .sub-menu.isOpen { display: flex; }
   .nav-menu .sub-menu a { font-weight: 400; font-size: 14px; padding: 6px 20px; border-radius: 6px; }
   .nav-menu .menu-item-has-children { display: flex; flex-direction: column; width: 100%; }
   .nav-menu .menu-item-has-children > a { gap: 6px; }
   .nav-menu .menu-item-has-children .toggle-icon { display: flex; align-items: center; justify-content: center; }
   .nav-menu .menu-item-has-children .toggle-icon svg { transition: transform 0.3s; width: 14px; height: 14px; }
   .nav-menu .menu-item-has-children.isOpen > a .toggle-icon svg { transform: rotate(180deg); }
   
   /* ==========================================================================
      4. 瀑布流、卡片与置顶标
      ========================================================================== */
   .masonry-grid { column-count: 1; column-gap: 1.5rem; }
   .masonry-item { break-inside: avoid; margin-bottom: 1.5rem; position: relative; }
   .post-card { position: relative; display: block; border-radius: 8px; overflow: hidden; background: var(--card-bg); box-shadow: 0 2px 10px rgba(0,0,0,0.04); transition: transform 0.3s ease; }
   .post-card:hover { transform: translateY(-4px); }
   .post-thumbnail img { width: 100%; height: auto; object-fit: cover; display: block; }
   .post-content { padding: 1.5rem 1.2rem; }
   .post-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 0.5rem; line-height: 1.4; }
   .post-excerpt { font-size: 14px; color: #666; margin-bottom: 1rem; line-height: 1.5; }
   .post-meta-small { font-size: 11px; color: #aaa; }
   
   article.sticky .post-card::after {
     content: "★" !important; position: absolute !important; top: 0 !important; right: 0 !important;
     background: #000 !important; color: #fff !important; width: 28px !important; height: 28px !important;
     display: flex !important; align-items: center !important; justify-content: center !important;
     font-size: 14px !important; z-index: 99 !important; border-radius: 0 0 0 8px !important;
   }
   
   /* ==========================================================================
      5. 内容页与页脚
      ========================================================================== */
   .entry-header { margin-bottom: 2rem; }
   .entry-title { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.8rem; }
   .entry-meta { display: flex; gap: 10px; font-size: 13px; color: #999; align-items: center; }
   
   /* 封面图圆角 */
   body.single .post-thumbnail img { border-radius: 8px; margin-bottom: 1.5rem; }
   
   .entry-content { font-size: 1.1rem; line-height: 1.8; background: #fff; padding: 2.5rem; border-radius: 8px; }
   .post-navigation, .nav-links, .posts-navigation { display: none !important; }
   
   .site-footer { margin-top: auto; padding: 30px 0; text-align: center; font-size: 12px; color: #aaa; border-top: 1px solid var(--border-color); width: 100%; font-weight: normal; }
   
   /* ==========================================================================
      6. 桌面端专项适配
      ========================================================================== */
   @media (min-width: 640px) { .masonry-grid { column-count: 2; } }
   @media (min-width: 1024px) { 
     .masonry-grid { column-count: 3; }
     .site-wrapper { flex-direction: row; }
     .site-sidebar { width: var(--sidebar-width); height: 100vh; position: sticky; top: 0; border-right: 1px solid var(--border-color); border-bottom: none; align-items: flex-start; }
     .site-branding { text-align: left; }
     .author-avatar { margin: 0 0 1rem 0; }
     .nav-menu { align-items: flex-start; }
     .nav-menu > li { align-items: flex-start; }
     .nav-menu .sub-menu { align-items: flex-start; padding-left: 2em; /* 2 characters indent */ }
   }
   
   /* ==========================================================================
      7. 移动端专项适配 (终极细节清理)
      ========================================================================== */
   @media (max-width: 1023px) {
     .site-sidebar { padding: 1.5rem 1rem 0.5rem 1rem; border-bottom: none; }
     .site-branding { margin-bottom: 1rem; }
     .nav-menu { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: flex-start; }
     .nav-menu > li { width: auto; align-items: center; }
     .nav-menu .menu-item-has-children { width: auto; }
     .nav-menu .sub-menu { padding-left: 0; align-items: center; justify-content: center; text-align: center; flex-direction: row; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
     .nav-menu .sub-menu a { padding: 4px 12px; }
     .site-main { padding: 1rem; }
     
     body.single .site-sidebar, body.page .site-sidebar { display: none !important; }
     
     body.single .mobile-single-top-nav, body.page .mobile-single-top-nav {
         display: flex !important; align-items: center; justify-content: space-between;
         padding: 12px 20px; background-color: var(--bg-color); width: 100%; position: relative; margin-bottom: 1rem; z-index: 100;
     }
     
     .mobile-logo-link { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; }
     .icon-circle-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; padding: 0; outline: none; z-index: 101; background-color: #000 !important; color: #fff !important; border: none !important; }
     
     /* 移动端文章内容区：密度更高 */
     body.single .entry-content, body.page .entry-content {
         padding: 1rem 1.2rem !important; 
         line-height: 1.6 !important;
         font-size: 16px;
     }
     
     /* 💡 核心修复：移动端下拉菜单彻底去点 & 居中对齐 */
     .mobile-dropdown-menu { 
         display: none; 
         position: absolute; top: 55px; right: 20px; 
         background: #fff; border: 1px solid #000; border-radius: 6px;
         padding: 8px 12px;
         box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 999;
         width: auto !important; 
         min-width: 80px;
     }
     
     .mobile-dropdown-menu.active { display: block; }
     
     /* 绝杀圆点：针对所有列表层级进行清理 */
     .mobile-dropdown-menu ul,
     .mobile-dropdown-menu li,
     .mobile-dropdown-menu .nav-menu {
         list-style: none !important;
         list-style-type: none !important;
         padding: 0 !important;
         margin: 0 !important;
         text-indent: 0 !important;
         display: flex !important;
         flex-direction: column !important;
         align-items: center !important;
     }
     
     /* 绝杀伪元素圆点 */
     .mobile-dropdown-menu li::before,
     .mobile-dropdown-menu li::after,
     .mobile-dropdown-menu li::marker {
         content: none !important;
         display: none !important;
     }
   
     .mobile-dropdown-menu a {
         display: block; padding: 6px 0; font-size: 13px; font-weight: 600;
         background: transparent !important; color: #000 !important;
         white-space: nowrap;
     }
   }

/* ==========================================================================
   8. 产品入口区域 (Home/Index only)
   ========================================================================== */
.product-entry-container {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.product-entry-area {
    background-color: #171717;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 16px;
}

.product-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.product-icon-img-wrap {
    width: 84px; /* 56px * 1.5 = 84px */
    height: 84px;
    border-radius: 20px; /* 适当增加圆角 */
    overflow: hidden;
    background: #333;
    margin-bottom: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-icon-link:hover {
    transform: translateY(-4px);
}

.product-icon-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-icon-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.product-entry-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    width: 100%;
}

.product-entry-close:hover {
    color: #fff;
}

.product-entry-toggle {
    display: none;
    background: #171717;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.2s;
}

.product-entry-toggle:hover {
    background: #2a2a2a;
}

.product-entry-container.is-collapsed .product-entry-area {
    display: none;
}

.product-entry-container.is-collapsed .product-entry-toggle {
    display: flex;
}

/* PC Specific */
@media (min-width: 1024px) {
    .product-entry-container {
        width: auto;
        margin-left: -2rem;
        margin-right: -2rem;
        margin-top: -3rem;
    }
    .product-entry-area {
        border-radius: 0 0 16px 16px;
        padding: 30px 20px 10px;
    }
    .product-entry-container.is-collapsed {
        margin-bottom: 0;
    }
    .product-entry-toggle {
        margin-top: 1rem;
        margin-left: 2rem;
        margin-bottom: 1rem;
    }
}

/* Mobile Specific */
@media (max-width: 1023px) {
    .product-entry-container {
        width: auto;
        margin-left: -1rem;
        margin-right: -1rem;
        margin-top: -1.5rem;
    }
    .product-entry-area {
        border-radius: 0 0 16px 16px;
        padding: 20px 15px 10px;
    }
    .product-entry-container.is-collapsed {
        margin-bottom: 0;
    }
    .product-entry-toggle {
        margin-top: 0.8rem;
        margin-left: 1rem;
        margin-bottom: 0.8rem;
    }
}