/* =====================正式开始================================
   ██████╗  PART 1. 核心基础设置 (Base & Wrapper)
   说明：HTML重置、Weverse大框架容器
   =================================================================== */

/* 1.1 全局重置 */
html, body { 
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }
#main, .site-main, .content-area, .entry-content, .ct-container, article { 
    margin-top: 0 !important; 
    padding-top: 0 !important; 
    border: none !important; 
}

/* 1.2 Weverse 包装器 */
.wv-wrapper { 
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    position: relative !important;
    left: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 160px) !important;
    background-color: #fff;
    overflow-x: hidden;
    padding-top: 0 !important;
}


/* ===================================================================
   ██████╗  PART 2. 主体布局结构 (Body Layout)
   说明：控制 左-中-右 三栏的排布逻辑
   =================================================================== */

/* 2.1 主体容器 */
.wv-main-body { 
    display: flex;
    flex-grow: 1;
    width: 100%;
    justify-content: flex-start;
    padding-left: 0 !important;
    padding-right: 30px !important;
    gap: 20px;
    padding-top: 100px !important;
    box-sizing: border-box;
    align-items: flex-start !important;
}

/* 2.2 中间内容区域 (Content) */
.wv-content { 
    flex-grow: 1;
    min-width: 0;
    margin-left: 260px; /* 给左侧栏留位置 */
    max-width: 900px;
    width: 100%;
}
.wv-content-inner { 
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 2.3 顶部间距修复 (first-child) */
.wv-content-inner > *:first-child, 
.wv-content-inner > div > *:first-child, 
.entry-content > *:first-child, 
h1:first-child, h2:first-child, p:first-child { 
    margin-top: 0 !important; 
    padding-top: 0 !important; 
    line-height: 1.2 !important; 
}
p:empty { display: none !important; }

/* 2.4 右侧栏容器占位 (具体内容样式在后面) */
.wv-right-column { 
    width: 280px;
    flex-shrink: 0;
    display: none;
    margin-right: 20px;
}
.wv-right-scrollable { 
    position: sticky;
    top: 70px;
}
.has-right-column .wv-content { 
    max-width: 1600px !important;
    margin-left: 260px;
}
/* ==============================================
   ★ 特殊补丁：当右侧栏关闭时，强制中间变宽比如
  登录页面 ============================================== */

/* 1. 只有当大盒子【没有】has-right-column 标签时 */
.wv-main-body:not(.has-right-column) .wv-content {
    max-width: 900px !important; /* 把 900px 撑大到 1200px */
}

/* 2. 同时把里面的小盒子也撑大 */
.wv-main-body:not(.has-right-column) .wv-content-inner {
    max-width: 100% !important; /* 不再锁死 800px，跟随父亲变宽 */
}
@media (min-width: 1100px) { 
    .has-right-column .wv-right-column { display: block; }
}

/* ===================================================================
   ██████╗  PART 2.5 布局模式逻辑 (推特动画 V6 - 浅色磨砂玻璃版)
   =================================================================== */

/* A. 电脑端逻辑 (保持原样) */
@media (min-width: 1001px) { 
    .layout-mode-fixed .wv-header-brand { cursor: default; }
    .layout-mode-drawer .wv-sidebar-scrollable { opacity: 0; pointer-events: none; }
    .layout-mode-drawer.sidebar-is-expanded .wv-sidebar-scrollable { opacity: 1; pointer-events: auto; }
    .layout-mode-drawer .wv-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .layout-mode-drawer.sidebar-is-expanded .wv-sidebar { transform: translateX(0); }
    .wv-overlay { display: none !important; }
}

/* B. 手机端逻辑 (★ 磨砂玻璃 + 去除分割线) */
@media (max-width: 1000px) {

    /* --- 1. 侧边栏 (加了 html body 前缀，权力更大) --- */
    html body .wv-sidebar {
        position: fixed !important;
        
        /* ★ 强制顶天立地 (覆盖电脑端的 60px) */
        top: 0 !important; 
        left: 0 !important;
        width: 260px !important;
        height: 100vh !important;
        
        /* ★ 强制吐出棉花 (覆盖电脑端的 40px) */
        padding-top: 0 !important; 
        
        /* 确保纯白 */
        background-color: #fff !important;
        
        z-index: 3000 !important; 
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar-is-expanded .wv-sidebar { transform: translateX(0); }

    /* --- 5. 侧边栏内部文字 (防止撞头) --- */
    /* 必须加在这里，让文字往下挪，避开手机状态栏 */
    html body .wv-sidebar-scrollable {
        padding-top: 60px !important; 
    }

    /* --- 2. 大遮罩 (身体部分) --- */
    .wv-overlay {
        position: fixed !important;
        top: 0; left: 0;
        width: 100vw !important; height: 100vh !important;
        
        /* 浅灰半透明 + 磨砂 */
        background-color: rgba(220, 220, 220, 0.3) !important; 
        backdrop-filter: blur(10px); 
        -webkit-backdrop-filter: blur(10px);
        
        z-index: 2000 !important; 
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        display: block !important;
    }
    .sidebar-is-expanded .wv-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    /* --- 3. 顶栏样式 & 专属小遮罩 --- */
    .wv-mobile-top-bar {
        position: fixed !important;
        top: 0; left: 0; width: 100%; height: 55px;
        background: #fff;
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        will-change: transform;
        box-shadow: 0 1px 5px rgba(0,0,0,0.05); /* 平时的阴影 */
        z-index: 999; 
    }
    
    /* ★ 关键修复：当侧边栏打开时，去掉顶栏的阴影，消除那条线！ */
    .sidebar-is-expanded .wv-mobile-top-bar {
        box-shadow: none !important; 
    }

    /* 顶栏专属小遮罩 (样式要和大遮罩一模一样) */
    .wv-mobile-top-bar::after {
        content: '';
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        
        /* ★ 必须和大遮罩完全一致 */
        background-color: rgba(230, 230, 230, 0.6); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar-is-expanded .wv-mobile-top-bar::after {
        opacity: 1;
    }
    
    .wv-mobile-top-bar.wv-hide-bar { transform: translateY(-100%); }

    /* --- 4. 全员大迁徙 --- */
    .sidebar-is-expanded .wv-mobile-top-bar, 
    .sidebar-is-expanded .wv-content,         
    .sidebar-is-expanded .wv-right-column,    
    .sidebar-is-expanded footer,              
    .sidebar-is-expanded .ct-footer {         
        transform: translateX(260px);        
    }

    /* 垫子逻辑 */
    .wv-main-body { padding-top: 55px !important; }
    .wv-wrapper.no-content-padding .wv-main-body { padding-top: 55px !important; }
    body.hide-mobile-header .wv-mobile-top-bar { display: none !important; }
    body.hide-mobile-header .wv-main-body { padding-top: 15px !important; }
    body.hide-mobile-header .wv-wrapper.no-content-padding .wv-main-body { padding-top: 15px !important; }

}

/* ==============================================
   ★ 视觉统一：把页脚和背景全变成白色
   说明：消除底部的色差，让页面看起来是一整张白纸
   ============================================== */
body, 
.ct-footer, 
footer {
    background-color: #ffffff !important; /* 强制变白 */
}

/* 如果页脚原本有上边框线，也把它去掉，彻底隐形 */
.ct-footer {
    border-top: none !important;
    box-shadow: none !important;
}


/* ===================================================================
   ██████╗  PART 3. 电脑端顶部导航栏 (Desktop Header)
   说明：电脑端显示的白色顶部条、汉堡图标、Logo
   =================================================================== */

.wv-desktop-top-header { 
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    z-index: 2000;
    padding-left: 10px;
    box-sizing: border-box;
}
.wv-header-brand { 
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 100%;
}
.wv-hamburger-icon { 
    width: 20px;
    height: 20px;
    margin-left: 0;
    margin-right: 26px;
    display: flex;
    align-items: center;
}
/* 确保图片填满图标容器 */
.wv-hamburger-icon img { width: 100%; height: 100%; }

.wv-logo-text { 
    font-family: 'Roboto Mono', monospace !important;
    font-size: 22px;
    font-weight: 500;
    color: #000;
    text-decoration: none !important;
    display: flex;
    align-items: center;
}
.emoji { 
    font-size: 24px;
    margin-top: -2px;
    margin-right: 7px;
    margin-left: -16px;
}


/* ===================================================================
   ██████╗  PART 4. 左侧栏详细内容 (Left Sidebar)
   说明：包含欢迎语、用户盒子、导航菜单
   =================================================================== */

/* 4.1 侧边栏容器 (修改版：修复顶部断层缝隙) */
.wv-sidebar { 
    width: 260px;
    flex-shrink: 0;
    position: fixed !important;
    
    /* ★★★ 修改核心在这里 ★★★ */
    
    /* 1. 提裤子：把侧边栏往上提 40px，让它紧贴顶栏(60px) */
    top: 60px !important;             
    
    /* 2. 塞棉花：在盒子内部顶端塞 40px 的白垫子 */
    /* 作用：把刚才因为“提裤子”而跟着跑上去的文字，强行挤回原来的位置 */
    padding-top: 40px !important;     
    
    /* 3. 控身高：屏幕高度 - 顶栏高度(60px) */
    /* 这样侧边栏正好铺满剩下所有的屏幕 */
    height: calc(100vh - 60px) !important;
    
    /* 4. 防撑爆：把 padding 算在高度里，防止盒子变长 */
    box-sizing: border-box !important;
    
    /* ★★★ 修改结束 ★★★ */

    left: -20px;
    background-color: #fff;           /* 保持白色背景 */
    z-index: 1999;
    overflow-y: auto;
    border-right: none;               
}

/* 4.2 可滚动区域 & 内边距 */
.wv-sidebar-scrollable { 
    display: flex;
    flex-direction: column;
    position: static !important;
    top: auto !important;
    transition: opacity 0.3s ease;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    scrollbar-width: none;
    padding: 20px 20px 20px 50px;     
    box-sizing: border-box;
}
.wv-sidebar-scrollable::-webkit-scrollbar { display: none; }

/* 4.3 欢迎区块 (含中文名) */
.brand-cn-name {
    font-size: 23px !important;       
    color: #999999 !important;        
    font-weight: 500 !important;      
    letter-spacing: 0.1px !important;   
    margin-top: -5px !important;
    margin-bottom: 30px !important;   
}
.wv-welcome-block { margin-bottom: 25px; }
.wv-welcome-block h2 { 
    font-size: 22px; font-weight: 700; color: #35BAF3; margin: 0 0 6px 0; line-height: 1.2;                 
}
.wv-welcome-block .sub { 
    font-size: 12px; font-weight: 400; color: #888;                      
}

/* 4.4 用户盒子 (User Box) */
.wv-user-block { margin-bottom: 20px; }

.user-box { 
    display: flex;
    align-items: center;
    padding: 10px 10px;               
    background: #f7f9fa;              
    border-radius: 12px;              
    text-decoration: none !important;
    width: fit-content;
    min-width: 150px;                 
}
.user-box:hover { background: #eff3f4; }

.u-avatar { 
    width: 42px; height: 42px; border-radius: 50%; margin-right: 12px; object-fit: cover;
}

/* ★★★ 核心修复：只加了这一段，让名字和余额变回上下排列 ★★★ */
.user-box > div {
    display: flex !important;
    flex-direction: column !important; /* 强制上下分布 */
    justify-content: center !important;
    align-items: flex-start !important;
}

/* 下面全部是你原本的样式，一个字都没改 */
.u-name { 
    font-weight: 500; 
    color: #0f1419; 
    font-size: 12px; 
    
    /* ★ 改这里 1：顶部间距改小 (解决卡片变高的问题) */
    margin-top: 6px !important;  /* 原来是6px，改成0，卡片就会缩回去 */
    
    /* ★ 改这里 2：底部间距 (控制它和“曲奇数”之间的距离) */
    margin-bottom: 0px !important; /* 这个数字越大，名字和曲奇离得越远；原来是6px，这里改小了 */
}

/* 未登录状态下的“同步进度”样式 */
html body .user-box .sub {
    font-size: 12px !important; color: #35BAF3 !important; font-weight: 400 !important; margin-top: 3px !important; display: block !important;        
}
    /* 控制“曲奇图标 + 数字”的样式 */
.u-balance {
    font-size: 11px !important;       /* 大小 */
    color: #35BAF3 !important;        /* 颜色 */
    font-weight: 500 !important;      /* 粗细 */
    margin-top: 2px !important;       /* 顶部间距 */
    display: block !important;        /* 独占一行 */
}

/* 4.5 导航菜单 (Nav Items) */
.wv-nav-block { 
    display: flex; flex-direction: column; gap: 10px; 
}
.nav-item { 
    display: flex; align-items: center; padding: 10px 0; text-decoration: none !important; cursor: pointer; transition: color 0.2s;
}
.nav-item:hover { color: #35BAF3; }
.nav-item .icon { 
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin-right: 12px; 
}
.nav-item .icon img, .nav-item .icon svg { 
    width: 20px !important; height: 20px !important; object-fit: contain !important; display: block !important;
}
.nav-item .text { 
    font-size: 16px !important; font-weight: 400 !important; color: #333; 
}
.wv-divider { 
    height: 0.5px; background: #f5f5f5; margin: 15px 0; 
}

/* ★ 特殊调整：生词本爱心图标大小 */
html body .wv-nav-block a[href*="word-folders"] .icon {
    width: 24px !important; height: 2px !important; margin-right: 11px !important; 
}
html body .wv-nav-block a[href*="word-folders"] .icon img {
    width: 19px !important; height: 19px !important; max-width: none !important;   
}
/* ===================================================================
   ██████╗  PART 7. 移动端/平板端 响应式控制 (Mobile & Tablet)
   说明：包含移动端顶部栏、侧边栏抽屉逻辑、布局重排
   =================================================================== */

/* 7.1 移动端顶部栏容器 (默认隐藏) */
.wv-mobile-top-bar { display: none; }

/* 7.2 移动端核心样式 (宽度≤1000px) */
@media (max-width: 1000px) {
    /* 隐藏桌面版顶部栏 */
    .wv-desktop-top-header { display: none !important; }
    
    /* 显示移动端顶部栏 */
    .wv-mobile-top-bar { 
        display: flex !important;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        height: 54px;
        background: #ffffff !important;
        border-bottom: 1px solid #eee;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        z-index: 200002 !important;
    }

    /* 左上角头像 */
    .mobile-avatar-trigger { 
        width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center;
        /* 背景图：未登录时显示 */
        background-image: url('/wp-content/uploads/2025/11/微信图片_2025-11-02_053215_510.jpg');
        background-size: cover; background-position: center; border-radius: 50%;
    }
    .mobile-avatar-trigger img { 
        width: 32px; height: 32px; border-radius: 50%; border: 1px solid #f0f0f0; object-fit: cover;
    }
    body:not(.logged-in) .mobile-avatar-trigger img { opacity: 0 !important; }

    /* 网站标题 */
    .mobile-site-title { 
        font-family: 'Roboto Mono', monospace !important;
        font-size: 18px; font-weight: 700; color: #000;
        position: absolute; left: 50%; transform: translateX(-50%);
        cursor: pointer; pointer-events: auto;
    }
    .mobile-spacer { width: 32px; }

    /* 移动端侧边栏 (抽屉) */
    .wv-sidebar { 
        position: fixed; top: 54px; left: 0;
        height: calc(100vh - 54px); width: 280px;
        transform: translateX(-100%);
        background: #fff; box-shadow: 2px 0 15px rgba(0,0,0,0.1);
        padding: 0px; z-index: 200001 !important;
        padding-top: 5px !important; border-right: none;
        transition: transform 0.3s ease;
    }
    .sidebar-is-expanded .wv-sidebar { transform: translateX(0); }
    
    /* 遮罩层 */
    .wv-overlay { 
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4); z-index: 200000; display: none;
    }
    .sidebar-is-expanded .wv-overlay { display: block !important; }

    /* ★★★ 核心修复：防止重叠的布局代码 ★★★ */
    html body .wv-main-body { 
        display: flex !important;           
        flex-direction: column !important;  /* 垂直方向！ */
        padding: 0 !important;
        padding-top: 54px !important;
        gap: 0 !important;
    }

    /* 中间内容区域 */
    html body .wv-content { 
        width: 100% !important; max-width: 100% !important; margin-left: 0 !important; flex: none !important;
    }
    
    /* 内容内部间距 */
    html body .wv-content-inner { 
        padding-top: 40px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100vw !important; max-width: 100vw !important; margin-left: 0 !important; box-sizing: border-box !important;
    }
    html body .wv-content-inner > *:first-child, 
    html body .wv-content-inner > div:first-child { 
        margin-top: 0 !important;
    }

    /* ★★★ 右侧栏修复：变成底部栏 ★★★ */
    html body .wv-right-column { 
        display: block !important;          
        width: 100% !important;             
        margin-left: 0 !important; margin-right: 0 !important;
        margin-top: 40px !important;        
        padding: 0 15px !important;
        box-sizing: border-box !important;
        flex: none !important;
        order: 999 !important;              
    }
	/* ★★★ 如果右侧栏是空的，在手机上彻底消失 */
    html body .wv-right-column.is-empty-sidebar {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    html body .wv-right-scrollable { position: static !important; top: auto !important; }

    /* 手机端侧边栏内容间距修正 */
    html body .wv-sidebar-scrollable {
        padding-left: 25px !important; 
        padding-top: 45px !important; padding-right: 10px !important; padding-bottom: 20px !important;
    }

    /* 手机端字体修正 */
    html body .brand-cn-name {
        font-size: 20px !important; color: #999999 !important; font-weight: 500 !important; letter-spacing: 0.3px !important;   
        margin-top: 5px !important; margin-bottom: 25px !important;    
    }
    .wv-welcome-block h2 { 
        font-size: 20px; font-weight: 500; color: #35BAF3; margin: 0 0 6px 0; line-height: 1.2;                 
    }
    
    /* 手机端未登录字号 */
    html body .user-box .sub {
        font-size: 10px !important; color: #35BAF3 !important; font-weight: 400 !important; margin-top: 3px !important; display: block !important;        
   }
}
/* ===================================================================
   ██████╗ 以上 网站框架和首页  结束 =================================================================== */