body {
    padding-top: var(--status-bar-height);
}
/* ========== 1. 全局变量与重置 ========== */
:root {
    /* 核心修改：这就是你要的“看起来像黑但不是死黑”的颜色 */
    --bg-dark: #191919;       /* 主界面背景：极深的灰黑色 */
    
    /* 侧边栏通常比背景稍微亮一丁点，或者稍微偏冷色调 */
    --bg-sidebar: #202123;    /* 侧边栏：稍微亮一点的深炭色 */
    
    --bg-card: #2d2d2d;       /* 卡片颜色：保持原有层级，稍微提亮 */
    /* ...保持其他变量不变... */
    --primary: #6c5ce7;       
    --primary-hover: #5649c0;
    --text-white: #e0e0e0;
    --text-gray: #a0a0a0;
    --border-color: #2f2f3d;  
    --danger: #ff4757;
}

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

/* ========== 幕布 (Body)修改为下面这样) ========== */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
    
    /* 核心修改：使用上面定义的 Off-Black 颜色 */
    background-color: var(--bg-dark); 
    
    /* 移除 background-attachment，纯色不需要固定 */
    
    color: var(--text-white);
    height: 100vh;
    overflow: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* 🆕 滚动条美化 (保留你的样式) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f4b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ========== 2. 布局容器 ========== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ========== 3. 左侧侧边栏 (Sidebar) ========== */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

/* PC端侧边栏完全收起 (保留你的逻辑) */
body.sidebar-closed .sidebar {
    width: 0; 
    border-right: none;
}

/* 收起时隐藏 Logo 文字 */
body.sidebar-closed .brand-name { display: none; }
body.sidebar-closed .brand { justify-content: center; padding: 0; }
body.sidebar-closed .brand-icon { margin-right: 0; font-size: 24px; }

/* 收起时隐藏菜单文字 */
body.sidebar-closed .nav-item span { display: none; }
body.sidebar-closed .nav-item { justify-content: center; padding: 14px 0; }
body.sidebar-closed .nav-item i { width: auto; margin: 0; font-size: 20px; }

/* 收起时隐藏用户信息细节 */
body.sidebar-closed .user-info, 
body.sidebar-closed .btn-logout,
body.sidebar-closed .guest-info span, 
body.sidebar-closed .btn-login-trigger {
    display: none !important;
}
body.sidebar-closed .user-profile-link { justify-content: center; margin: 0; }
body.sidebar-closed .mini-avatar { margin: 0; }

/* Logo */
.brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 1px solid transparent;
}
.brand-icon { margin-right: 10px; color: #fab1a0; }

/* 导航菜单 */
.nav-menu {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-gray);
    border-radius: 12px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    font-size: 15px;
    cursor: pointer;
}

.nav-item i { width: 30px; font-size: 18px; }

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.2) 0%, transparent 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* 底部用户信息区 */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
}

/* 已登录样式 */
.user-card { display: flex; align-items: center; gap: 10px; }

.user-profile-link {
    display: flex; align-items: center; gap: 10px;
    flex: 1; overflow: hidden;
    cursor: pointer; color: inherit;
    transition: opacity 0.2s;
}
.user-profile-link:hover { opacity: 0.8; }

.user-avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-weight: bold; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
.user-points { font-size: 12px; color: #fab1a0; margin-top: 2px; }

.btn-logout {
    color: var(--text-gray); opacity: 0.7; transition: 0.3s;
    cursor: pointer; padding: 6px;
}
.btn-logout:hover { opacity: 1; color: var(--danger); }

/* 未登录样式 */
.guest-card { display: flex; flex-direction: column; gap: 15px; }
.guest-info { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-gray); }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; background: #333; }

.btn-login-trigger {
    width: 100%; padding: 10px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-white);
    border-radius: 6px; cursor: pointer; transition: 0.3s; font-size: 14px;
}
.btn-login-trigger:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ========== 4. 右侧主内容区 ========== */
.content-area {  
    flex: 1;    
    width: 0;   
    height: 100vh;
    overflow-y: auto; 
    position: relative;
    
    /* 核心修改：改为透明，让底部的 Body 渐变透出来 */
    background-color: transparent; 
}

/* ========== 5. 弹窗 (Modal) 样式 ========== */
.hidden { display: none !important; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100001;
    display: flex; justify-content: center; align-items: center;
}

.modal-container {
    background: var(--bg-card);
    width: 420px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute; top: 15px; right: 20px;
    font-size: 24px; cursor: pointer; color: var(--text-gray);
    transition: 0.2s;
}
.modal-close:hover { color: white; }

.modal-tabs {
    display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 25px;
}

.modal-tab {
    flex: 1; text-align: center; padding: 12px; cursor: pointer; color: var(--text-gray); position: relative; transition: 0.3s;
}

.modal-tab.active { color: var(--text-white); font-weight: bold; }
.modal-tab.active::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background-color: var(--primary);
}

.form-group { margin-bottom: 20px; }
.form-group input {
    width: 100%; padding: 12px; 
    background: #121216;
    border: 1px solid var(--border-color); 
    border-radius: 8px; color: white; outline: none; transition: 0.3s;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2); }

.code-group { display: flex; gap: 10px; }
.btn-code { flex: 1; background: #3e3e5e; border: none; color: white; border-radius: 8px; cursor: pointer; }

.btn-primary-block {
    width: 100%; padding: 12px; background-color: var(--primary); color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; transition: 0.3s; margin-top: 10px; font-weight: bold;
}
.btn-primary-block:hover { background-color: var(--primary-hover); }

/* ================================
   📱 移动端全局适配 (侧滑抽屉模式)
   ============================== */
@media screen and (max-width: 768px) {
    /* 1. 布局调整 */
    .app-container { position: relative; }

    /* 2. 侧边栏：左侧抽屉 */
    .sidebar {
        position: fixed; top: 0; left: 0;
        width: 260px !important;
        height: 100vh;
        height: 100dvh !important;
        transform: translateX(-100%);
        z-index: 9999;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        display: flex !important;
        flex-direction: column !important;
    }
    .sidebar .sidebar-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }
    /* 激活状态 */
    body.mobile-nav-open .sidebar { transform: translateX(0); }
    /* 3. 恢复显示 */
    .sidebar .nav-menu { display: block; }
    .nav-item {
        flex-direction: row !important;
        justify-content: flex-start !important;
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }
    .sidebar .brand { display: flex !important; }
    .sidebar .sidebar-footer { display: block !important; }
    /* 4. 内容区域 */
    .content-area { width: 100% !important; padding-bottom: 0 !important; }
}

/* ========== 6. 顶部导航条与汉堡按钮 (配合JS使用) ========== */
.top-bar {
    /* ★★★ 1. 定位核心：粘性定位 ★★★ */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 98;

    /* ★★★ 2. 幽灵模式（关键修改） ★★★ */
    height: 0;               /* 高度设为0，不再把内容往下挤，直接浮在内容上方 */
    background: transparent; /* 完全透明，没有任何背景色 */
    pointer-events: none;    /* 【魔法】让点击穿透！手指点这里会直接点到下面的图片，不会被挡住 */
    
    /* 布局微调：给按钮留出一点顶部距离 */
    display: flex;
    align-items: flex-start; 
    padding: 15px 20px;      
}

.btn-toggle-nav {
    /* ★★★ 3. 按钮复活 ★★★ */
    pointer-events: auto;    /* 只有这个小按钮可以被点击，其他区域都是穿透的 */
    
    /* 按钮外观：保持你原有的深色方块，确保在浅色图片上也能看见 */
    background: #1e1e24;     
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
    
    /* 给一个小阴影，防止浮在类似颜色的图片上看不清 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); 
}

.btn-toggle-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== 6.作品详情弹窗 ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: 999;
    display: flex; justify-content: center; align-items: center;
}
.modal-overlay.hidden { display: none; }

.bot-modal-container {
    background: #1e1e24;
    width: 800px;
    max-width: 90%;
    height: 80vh;
    border-radius: 16px;
    border: 1px solid #3f3f5f;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --- 上半区 Header --- */
.bot-modal-header {
    height: 240px;
    flex-shrink: 0;
    background-size: cover; 
    background-position: center;
    position: relative;
}
.header-overlay {
    background: linear-gradient(to top, #1e1e24 5%, rgba(30,30,36,0.3) 100%);
    width: 100%; height: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.bot-big-title { 
    font-size: 28px; color: white; margin: 0 0 10px 0; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}
.bot-tags-row {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.modal-tag {
    background: rgba(108, 92, 231, 0.8);
    color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px;
    backdrop-filter: blur(4px);
}

/* 作品详情作者头像 */
.bot-author-badge {
    /* 1. 取消绝对定位，让它回到文档流 */
    position: relative; 
    bottom: auto; 
    right: auto;
    
    /* 2. 布局调整 */
    display: inline-flex;       /* 让背景框只包裹内容，不占满一行 */
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;        /* 在它和下方的大标题之间加点空隙 */
    
    /* 3. 视觉样式 */
    background: rgba(0,0,0,0.5);
    padding: 4px 10px 4px 4px;  /* 左边少一点padding因为图片本身有圆角 */
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.2);
}

.bot-author-badge img { 
    width: 24px; height: 24px;  
    border-radius: 50%; 
}

.bot-author-badge span { 
    color: rgba(255,255,255,0.9); 
    font-size: 12px; 
    font-weight: normal; 
}


/* =========================================
   统一的圆圈关闭按钮样式 (作品详情 & 个人名片)
   ========================================= */
.bot-modal-container .modal-close,
.pc-close-btn {
    position: absolute; 
    top: 15px; 
    right: 15px;
    z-index: 20;
    
    /* 形状与背景 */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* 内容居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 文字样式 */
    color: rgba(255, 255, 255, 0.8); 
    font-size: 20px; 
    line-height: 1; 
    padding-bottom: 2px;
    text-shadow: none;
    
    cursor: pointer; 
    transition: all 0.2s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
}

/* 悬停效果 */
.bot-modal-container .modal-close:hover,
.pc-close-btn:hover { 
    background-color: rgba(0, 0, 0, 0.8);
    color: white; 
    transform: rotate(90deg);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- 下半区 Body (滚动核心) --- */
.bot-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #1e1e24;
}

/* 滚动条美化 */
.bot-modal-body::-webkit-scrollbar { width: 6px; }
.bot-modal-body::-webkit-scrollbar-thumb { background: #3f3f5f; border-radius: 3px; }
.bot-modal-body::-webkit-scrollbar-track { background: #1e1e24; }

.info-block { margin-bottom: 25px; }
.block-title {
    color: #6c5ce7; font-weight: bold; font-size: 15px; margin-bottom: 10px;
    border-left: 3px solid #6c5ce7; padding-left: 8px;
}
.block-content {
    color: #b0bec5; font-size: 14px; line-height: 1.6;
}
/* 新代码 */
.detail-html-box {
    background: transparent;
    padding: 0;
    border: none;
    
    /* --- 下面这些保持不变 --- */
    border-radius: 8px;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.7; 
    min-height: 60px;
}
.detail-html-box img {
    max-width: 100%;
    border-radius: 4px;
}

/* --- 底部 Footer (悬浮按钮) --- */
.bot-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #2f2f3d;
    background: #1e1e24;
}
.btn-start-chat {
    width: 100%; padding: 14px; 
    background: #6c5ce7; color: white; border: none; border-radius: 8px; 
    font-size: 16px; font-weight: bold; cursor: pointer;
    transition: 0.2s;
}
.btn-start-chat:hover { background: #5649c0; transform: translateY(-2px); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* == 6.1. 作品详情弹窗手机适配 == */
@media (max-width: 768px) {
    /* 1. 弹窗容器修复 */
    .bot-modal-container,
    .card-modal-container {
        width: 96% !important;
        height: 94% !important;
        max-width: 96% !important;
        max-height: 94% !important;
        border-radius: 16px !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        transform: none !important; 
    }
    .bot-modal-container .modal-close,
    .pc-close-btn {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(0, 0, 0, 0.6) !important;
        transform: translateZ(0) !important;
        z-index: 999 !important;
    }

    /* 2. 头部区域 */
    .header-overlay {
        padding: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        padding-top: 40px !important; 
    }
    
    .bot-modal-header {
        height: 220px !important;
        border-bottom: none !important;
        border: none !important;
        box-shadow: none !important; 
    }

    /* 3. 滚动区域优化 */
    .bot-modal-body {
        padding: 12px !important;
        border-top: none !important;
        border: none !important;
        margin-top: 0 !important;
        background-color: #18181b !important; 
        z-index: 2 !important;
        -webkit-overflow-scrolling: touch; 
        will-change: scroll-position;
    }
    
    .bot-big-title {
        font-size: 20px !important;
        margin-bottom: 6px !important;
    }
    
    .bot-tags-row {
        gap: 8px !important;
    }
    .bot-meta-row {
        gap: 2px !important;
        width: 100% !important;
    }

    /* 4. 数据文字与按钮微调 */
    .bot-meta-row > span, 
    .interact-btn {
        font-size: 11px !important;
        gap: 2px !important;
    }
    .interact-btn {
        font-weight: normal !important;
    }
    .interact-btn i {
        font-size: 15px !important;
        transform: translateY(1px);
        margin-right: 1px !important;
    }

    /* 5. 关注按钮适配 */
    .btn-follow-author {
        padding: 4px 8px !important;
        font-size: 11px !important;
        height: 24px !important;
        white-space: nowrap !important;
        margin-left: auto !important;
    }
    #modalLikeBtn {
        margin-left: 0 !important;
    }
}

/* ====================
   弹窗内的新增交互样式
   ================== */
.bot-meta-row {
    display: flex; 
    gap: 15px; 
    color: #ddd; 
    font-size: 13px; 
    margin-bottom: 10px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden; 
}

.bot-meta-row > * {
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* 交互按钮通用样式 (爱心、星星) */
.interact-btn {
    cursor: pointer;
    transition: color 0.2s; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.interact-btn:hover {
    opacity: 0.8;
}

/* 弹窗里的爱心蓝色 */
#modalLikeBtn {
    color: #45aaf2; 
    margin-left: auto; 
}

/* 弹窗里的爱心红色 */
#modalLikeBtn.active {
    color: #ff4757 !important;
}
#modalLikeBtn.active i {
    font-weight: 900; 
}

/* 关注作者按钮样式 */
.btn-follow-author {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    border-radius: 50px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    outline: none;
    margin-left: 15px;
    flex-shrink: 0;

    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.btn-follow-author:hover {
    background: #6c5ce7;
    border-color: #6c5ce7;
    color: white;
    /* 移除位移和阴影动画 */
    box-shadow: none; 
    transform: translateZ(0);
}

.btn-follow-author:active {
    opacity: 0.8;
}

/* 已关注状态 */
.btn-follow-author.followed {
    background: rgba(255, 71, 87, 0.15); 
    border-color: #ff4757;
    color: #ff4757;
}

.btn-follow-author.followed:hover {
    background: #ff4757;
    color: white;
}

/* ========================== 
   个人名片弹窗样式 (修复闪烁版)
   ======================== */
/* 1. 外层容器 */
.card-modal-container {
    background: #18181c;
    width: 800px;
    max-width: 90%;
    height: 80vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    /* 优化：减少阴影扩散范围，减轻渲染压力 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    overflow: hidden;
    animation: fadeIn 0.25s ease-out;
    /* 修复：强制独立图层 */
    transform: translateZ(0);
}

/* ---顶部头部区域 (背景+头像+简介) --- */
.pc-profile-header {
    width: 100%;
    height: 220px; 
    flex-shrink: 0;
    background-image: url('/static/uploads/user_banners/cover.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #2a2a35;
    will-change: transform;
}

/* 渐变遮罩 */
.pc-header-overlay {
    position: absolute; inset: 0;
    /* 保持原样，但加入硬件加速 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 60%, #18181c 100%);
    padding: 0 40px;
    display: flex;
    align-items: center;
    transform: translateZ(0); 
}

/* 头部内容布局 */
.pc-header-content {
    display: flex; gap: 20px; width: 100%; align-items: center;
    margin-bottom: 0;
    /* 确保内容在遮罩之上 */
    position: relative; 
    z-index: 2;
}

/* 头像 */
.pc-avatar-wrap {
    width: 76px; height: 76px; 
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    /* 移除过大的阴影 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    overflow: hidden; background: #000;
}
.pc-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* 右侧信息 */
.pc-info-wrap { flex: 1; display: flex; flex-direction: column; }

.pc-username {
    font-size: 22px; 
    font-weight: 700; color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

/* 输入框 (移除毛玻璃，防止输入时闪烁) */
#card-bio-input {
    width: 100%; height: 85px;
    max-height: 95px; 
    /* 修改：改用纯色半透明，移除 backdrop-filter */
    background: rgba(0, 0, 0, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eee; border-radius: 8px; padding: 10px;
    resize: none; font-size: 13px; line-height: 1.4;
    transition: 0.3s;
}
#card-bio-input:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: #2196f3; outline: none;
}
.pc-bio-counter { text-align: right; color: rgba(255,255,255,0.7); font-size: 11px; margin-top: 4px; }

/* 个人简介 */
.bio-text-display {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px; line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    height: auto;
    max-height: 90px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
}
.bio-text-display::-webkit-scrollbar { width: 4px; }
.bio-text-display::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.bio-text-display::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

/* ---统计数据栏 --- */
.pc-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f1f25;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.pc-stat-item {
    flex: 1;
    text-align: center;
    display: flex; flex-direction: column;
}
.pc-stat-val {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
}
.pc-stat-label {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}
.pc-stat-divider {
    width: 1px; height: 20px;
    background: rgba(255,255,255,0.1);
}

/* ---筛选工具栏--- */
.pc-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px 5px 30px;
    background: #18181c;
    flex-shrink: 0;
    flex-wrap: nowrap;
}
.pc-filter-title {
    font-size: 14px; font-weight: 600; color: #999;
    border-left: 3px solid #2196f3; padding-left: 8px;
    flex-shrink: 0; 
    white-space: nowrap;
    margin-right: 10px;
}
.pc-filter-opts {
    display: flex; gap: 15px;
    flex-wrap: nowrap;
    align-items: center;
}
.pc-filter-btn {
    font-size: 13px; color: #666; cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}
.pc-filter-btn:hover { color: #fff; }
.pc-filter-btn.active {
    color: #ff4081;
    font-weight: bold;
    position: relative;
}
.pc-filter-btn.active::after {
    content: ""; position: absolute;
    bottom: -4px; left: 0; right: 0; height: 2px;
    background: #ff4081; border-radius: 2px;
}

/* --- 3. 底部作品区域--- */
.pc-works-section {
    padding: 5px;
    background: #18181c;
    flex: 1; 
    overflow-y: auto; 
    scrollbar-gutter: stable;
    /* 开启 iOS 惯性滚动 */
    -webkit-overflow-scrolling: touch; 
}

.pc-section-title { display: none; }

/* 网格布局 */
.pc-works-grid {
    display: grid; 
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 20px;
    /* 修复：网格容器强制硬件加速，避免重绘闪烁 */
    transform: translateZ(0);
}

/* 单个作品卡片 */
.pc-work-item {
    aspect-ratio: 1/1; /* 修正为1:1正方形，避免高度计算抖动 */
    background: #25252b;
    border-radius: 8px; 
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
    cursor: pointer;
    /* 移除全局 transition，避免手机端误触闪烁 */
}

/* 限制：只有 PC 端才有悬停上浮效果 */
@media (min-width: 769px) {
    .pc-work-item { transition: transform 0.2s, border-color 0.2s; }
    .pc-work-item:hover { 
        transform: translateY(-3px); 
        border-color: #6c5ce7;
    }
    .pc-work-item img { transition: transform 0.3s; }
    .pc-work-item:hover img { transform: scale(1.05); }
}

.pc-work-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.9; 
    /* 手机端保持静态 */
    transform: translateZ(0); 
}

/* 作品名遮罩*/
.pc-work-info {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
    padding: 30px 10px 8px 10px;
    z-index: 1;
    pointer-events: none;
    /* 修复：静态层级 */
    transform: translateZ(0);
}

.pc-work-name { 
    color: #fff; 
    font-size: 13px; 
    font-weight: 500; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- 卡片角标样式 (核心修复区) --- */

/* 右上角：收藏数 */
.pc-badge-top-right {
    position: absolute; top: 0; right: 0;
    /* 修复：移除 backdrop-filter，改用纯色半透明 */
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-bottom-left-radius: 6px;
    display: flex; align-items: center; gap: 3px;
    z-index: 2;
    /* 修复：强制 GPU 渲染 */
    transform: translateZ(0);
}
.pc-badge-top-right i { color: #ff4081; font-size: 10px; }

/* 手机适配 */
@media (max-width: 600px) {
    .pc-works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 右下角：热度值 */
.pc-badge-bottom-right {
    position: absolute; bottom: 8px; right: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    z-index: 3;
    display: flex; align-items: center; gap: 4px;
    /* 修复：强制 GPU 渲染 */
    transform: translateZ(0);
}
.pc-badge-bottom-right i { color: #ff9800; }

/* --- 滚动条美化 --- */
.pc-works-section::-webkit-scrollbar { width: 6px; }
.pc-works-section::-webkit-scrollbar-track { background: transparent; }
.pc-works-section::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
.pc-works-section::-webkit-scrollbar-thumb:hover { background: #52525b; }


/* ========================
   个人名片筛选栏手机适配
   ======================== */
@media (max-width: 768px) {
    .pc-filter-bar {
        padding: 12px 10px 5px 10px !important;
    }

    .pc-filter-opts {
        gap: 8px !important; 
    }

    .pc-filter-btn {
        font-size: 12px !important; 
    }
    .pc-filter-opts {
        overflow-x: auto; 
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; 
    }
    .pc-filter-opts::-webkit-scrollbar {
        display: none; 
    }
}


/* ========================
   🆕 个人卡片头像下方的关注按钮样式
   ======================== */
/* 左侧列：垂直排列头像和按钮 */
.pc-header-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 按钮微调：覆盖全局样式 */
.card-follow-btn {
    margin-left: 0 !important;
    width: 76px;
    justify-content: center;
    padding: 3px 0;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.pc-header-content {
    align-items: flex-start !important;
    margin-top: 20px;
}


/* ========================
   评分弹窗样式 (Rating Modal)
   ======================== */
.rating-modal-container {
    background: #18181c;
    width: 650px;
    max-width: 95%;
    height: 90%;
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    animation: fadeIn 0.2s ease-out;
}

/* 上部 Header */
.rating-header {
    padding: 20px;
    background: #1e1e24;
    border-bottom: 1px solid #2f2f3d;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-radius: 12px 12px 0 0;
}

/* 左侧 Bot 信息 */
.rating-bot-info {
    flex: 1;
    display: flex;
    gap: 15px;
    align-items: center;
}
.rating-bot-info img {
    width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid #444;
}
.rating-bot-info h3 { color: white; font-size: 18px; margin-bottom: 5px; }
.rating-bot-info p { 
    color: #888; font-size: 12px; line-height: 1.4; 
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 右侧 统计图表 */
.rating-stats-box {
    width: 240px;
    display: flex;
    gap: 15px;
}
.rating-big-score {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #f1c40f;
}
.rating-big-score span { font-size: 42px; font-weight: bold; line-height: 1; }
.rating-big-score small { color: #666; font-size: 12px; margin-top: 5px; }

.rating-bars { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 5px 0; }
.rating-bar-row { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #888; }
.rating-track { flex: 1; height: 4px; background: #333; border-radius: 2px; overflow: hidden; }
.rating-fill { height: 100%; background: #ff4757; width: 0%; border-radius: 2px; }

/* 中间 列表区 */
.rating-list-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #121216;
}
.review-item {
    display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px;
}
.review-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #333; }
.review-content { flex: 1; }
.review-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.review-user { color: #ccc; font-size: 13px; font-weight: bold; }
.review-date { color: #666; font-size: 12px; }
.review-stars { color: #f1c40f; font-size: 11px; margin-bottom: 5px; }
.review-text { color: #aaa; font-size: 13px; line-height: 1.5; }

/* 底部 输入区 */
.rating-input-area {
    padding: 15px 20px;
    background: #1e1e24;
    border-top: 1px solid #2f2f3d;
    border-radius: 0 0 12px 12px;
}
.star-select-row { display: flex; align-items: center; margin-bottom: 10px; font-size: 14px; color: #ccc; }
.star-rating-input { margin-left: 10px; cursor: pointer; }
.star-rating-input i { color: #444; font-size: 18px; margin-right: 2px; transition: 0.2s; }
.star-rating-input i.active { color: #f1c40f; }
.star-rating-input i:hover { transform: scale(1.2); }

.review-text-row { display: flex; gap: 10px; }
.review-text-row input {
    flex: 1; background: #2a2a35; border: 1px solid #3f3f4b; color: white;
    padding: 8px 12px; border-radius: 6px; font-size: 13px; outline: none;
}
.review-text-row button {
    background: #6c5ce7; color: white; border: none; padding: 0 20px;
    border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 13px;
}
.review-text-row button:hover { background: #5649c0; }

@media (max-width: 768px) {
    .rating-modal-container { height: 90vh; }
    .rating-header { flex-direction: column; padding: 15px; }
    .rating-stats-box { width: 100%; justify-content: space-around; }
}

/* ========================
   评价标签选择面板样式
   ======================== */
.tags-popover {
    position: absolute;
    bottom: 110%; /* 在输入框上方显示 */
    left: 0;
    width: 100%;
    background: #25252b;
    border: 1px solid #3f3f4b;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1002;
    padding: 10px;
    animation: fadeIn 0.2s ease;
}

.tags-popover.hidden { display: none; }

.popover-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px; margin-bottom: 8px;
    font-size: 12px; color: #888;
}
.close-pop { cursor: pointer; font-size: 16px; padding: 0 5px; }
.close-pop:hover { color: white; }

.popover-body {
    max-height: 200px;
    overflow-y: auto;
}
/* 滚动条细一点 */
.popover-body::-webkit-scrollbar { width: 4px; }
.popover-body::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

/* 分类标题 */
.tag-category-title {
    font-size: 11px; color: #666; margin: 8px 0 4px 0; font-weight: bold;
}
.tag-category-title:first-child { margin-top: 0; }

/* 标签组 */
.tag-group {
    display: flex; flex-wrap: wrap; gap: 6px;
}

/* 单个标签 */
.review-tag-chip {
    background: #333;
    color: #ccc;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    user-select: none;
}

.review-tag-chip:hover {
    background: #444; color: white;
}

/* 选中状态 */
.review-tag-chip.selected {
    background: rgba(108, 92, 231, 0.2);
    border-color: #6c5ce7;
    color: #a29bfe;
}

/* --- 修复层级闪烁的核心代码 --- */
#botDetailModal {
    z-index: 1000 !important;
}
#ratingModal {
    z-index: 2000 !important;
}

#authModal {
    z-index: 10000 !important; /* 赋予绝对优先权 */
}

#ratingModal.transparent-mode {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}



/* ========================
   👥 关注/粉丝列表弹窗样式 (粉色渐变 & 完美居中版)
   ======================== */
.relation-modal-container {
    background: #18181c;
    width: 450px;
    max-width: 90%;
    height: 70vh; /* 固定高度，内部滚动 */
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    animation: fadeIn 0.2s ease-out;
}

/* 1. 头部修改：相对定位，为 Tab 绝对居中做铺垫 */
.relation-header {
    padding: 15px 20px;
    border-bottom: 1px solid #2f2f3d;
    background: #1e1e24;
    border-radius: 12px 12px 0 0;
    display: flex; 
    align-items: center; /* 垂直居中 */
    position: relative; /* 关键：让内部的绝对定位元素以它为基准 */
    height: 60px;       /* 固定高度 */
}

/* 标题：限制宽度，防止挤占中间 */
.relation-header h3 { 
    font-size: 16px; 
    color: #fff; 
    margin: 0; 
    max-width: 25%; /* 限制宽度，防止和中间Tab打架 */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* 2. Tabs修改：绝对定位强制居中 */
.relation-tabs { 
    display: flex; 
    gap: 30px; /* 拉大一点间距更好看 */
    font-size: 15px; 
    color: #888; 
    cursor: pointer;
    
    /* 核心居中代码 */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.relation-tab-item {
    transition: 0.3s;
    padding: 0 5px;
    user-select: none;
}

.relation-tab-item:hover {
    color: #ccc;
}

/* 🩷 Tab 选中态：粉色下划线 */
.relation-tab-item.active { 
    color: #fff; 
    font-weight: bold; 
    border-bottom: 2px solid #ff4757; /* 改为粉红 */
    padding-bottom: 4px; 
}


/* ========================
   🆕 补回关闭按钮样式
   放在 .relation-tab-item.active 的后面
   ======================== */
.relation-modal-container .modal-close {
    position: absolute; 
    top: 14px;      /* 垂直位置微调 */
    right: 15px;    /* 靠右 */
    z-index: 20;    /* 确保在最上层 */
    
    /* 圆圈样式核心 */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑底 */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* 内容居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 叉叉样式 */
    color: rgba(255, 255, 255, 0.8); 
    font-size: 20px; 
    line-height: 1; 
    padding-bottom: 2px;
    
    cursor: pointer; 
    transition: all 0.2s ease;
}

/* 悬停效果 */
.relation-modal-container .modal-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: white; 
    transform: rotate(90deg); /* 旋转特效 */
    border-color: rgba(255, 255, 255, 0.3);
}


/* 列表主体 */
.relation-list-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #121216;
}
.relation-list-body::-webkit-scrollbar { width: 4px; }
.relation-list-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* 单个用户条目 */
.relation-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}
.relation-item:hover { background: rgba(255,255,255,0.02); }

.r-user-info { display: flex; align-items: center; gap: 12px; flex: 1; overflow: hidden; cursor: pointer; }
.r-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid #333; flex-shrink: 0; }
.r-text { display: flex; flex-direction: column; overflow: hidden; }
.r-name { color: #e0e0e0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-bio { color: #666; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 关注按钮基础 */
.btn-list-follow {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 72px; text-align: center;
    flex-shrink: 0; margin-left: 10px;
}

/* 🩷 未关注状态：粉色渐变 */
.btn-list-follow.not-following {
    /* 粉色渐变背景 */
    background: linear-gradient(135deg, #ff9a9e 0%, #ff6b88 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(255, 107, 136, 0.3); /* 增加一点粉色微光 */
}
.btn-list-follow.not-following:hover { 
    background: linear-gradient(135deg, #ffb1b5 0%, #ff85a1 100%);
    box-shadow: 0 4px 10px rgba(255, 107, 136, 0.5);
    transform: translateY(-1px);
}

/* 已关注状态：保持简约 */
.btn-list-follow.following {
    background: transparent; 
    border: 1px solid #444; 
    color: #888;
}
.btn-list-follow.following:hover {
    border-color: #ff4757; 
    color: #ff4757;
    background: rgba(255, 71, 87, 0.05);
}

/* 手机端适配 */
@media (max-width: 768px) {
    .relation-modal-container { height: 80vh; width: 95%; }
}


/* ========== 7. 高额消费提醒弹窗样式 (新增) ========== */
#highCostModal .modal-container {
    width: 380px;
    background: #1e1e24; /* 保持深色背景 */
    border: 1px solid #ff4757; /* 红色边框示警 */
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.2);
    text-align: center;
    padding: 30px 25px;
}

.high-cost-icon {
    font-size: 48px;
    color: #ff4757;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.high-cost-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.high-cost-msg {
    color: #bbb;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.high-cost-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 叉出去按钮 */
.btn-cost-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.btn-cost-cancel:hover {
    border-color: #fff;
    color: #fff;
}

/* 朕缺积分按钮 */
.btn-cost-confirm {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    transition: 0.2s;
}
.btn-cost-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}


/* === 访问密码弹窗专用样式 === */
#passwordModal .modal-container {
    animation: fadeIn 0.2s ease-out;
    border: 1px solid rgba(108, 92, 231, 0.3); /*以此区分普通弹窗*/
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.15);
}
#visit-password-input:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
}