      /* --- 滚动条强制隐藏 (终极版) --- */
      /* 针对所有 Webkit 内核的浏览器 (Chrome, Safari, Edge, etc.) */
      ::-webkit-scrollbar {
          display: none;
          width: 0 !important; /* 强制宽度为0 */
          height: 0 !important; /* 强制高度为0 */
      }
      
      /* 针对 Firefox */
      * {
          scrollbar-width: none;
      }
      
      /* 针对 IE 和老版 Edge */
      * {
          -ms-overflow-style: none;
      }
     /* --- 音乐播放器样式 --- */
     
     .music-info {
         flex-grow: 1;
         overflow: hidden;
         white-space: nowrap;
     }
     
     .music-info .title {
         font-size: 14px;
         font-weight: 500;
         color: var(--primary-text);
     }
     
     .lyrics-container {
         font-size: 12px;
         color: var(--secondary-text);
         margin-top: 2px;
         position: relative;
         height: 16px; /* 固定高度 */
     }
	 
	 .music-controls {
	     flex-shrink: 0; 
	 }
     
     .music-controls button {
         background: none;
         border: none;
         cursor: pointer;
         padding: 4px;
         color: rgba(0, 0, 0, 0.8); /* 默认深色 */
     }
     
     /* 循环播放按钮使用主题色 */
     .music-controls button#top-play-mode-btn {
         color: var(--accent-color);
     }
     .music-controls .svg-icon {
         width: 20px;
         height: 20px;
         color: var(--primary-text);
     }
	 .player-btn svg {
	     vertical-align: middle; /* 让图标垂直居中 */
	     width: 1em; /* 大小与文字基本一致 */
	     height: 1em;
	     fill: currentColor; /* 颜色继承按钮的文字颜色 */
	 }

     /* 音乐管理弹窗的样式 */
     .music-playlist-item {
         display: flex; justify-content: space-between; align-items: center;
         padding: 8px; border-bottom: 1px solid #eee;
     }
     .music-playlist-item .song-info { flex-grow: 1; cursor: pointer; }
     .music-playlist-item .song-title { font-weight: 500; }
     .music-playlist-item .song-artist { font-size: 12px; color: #888; }
     .music-playlist-item .delete-song-btn { color: #E53935; }


/* 【新增】聊天列表头像样式 */
.chat-list-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px; /* 方形圆角头像 */
    margin-right: 16px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #ccc; /* 图片加载前的占位颜色 */
}
/* --- 新增：消息时间戳样式 --- */
.message-timestamp {
    font-size: 12px;
    color: var(--secondary-text);
    margin: 0 4px;
    flex-shrink: 0; /* 防止被压缩 */
    align-self: flex-end; /* 关键：让自身在交叉轴（垂直方向）上对齐到底部 */
    padding-bottom: 5px; /* 微调：增加一点内边距，让文字的底部和气泡的圆角看起来更协调 */
}
/* --- 聊天列表置顶样式 --- */
.chat-list-item.is-pinned {
    background-color: #f0f2f5; 
}

/* ---【新增】聊天列表项美化样式 --- */
.chat-list-item .info {
    /* 核心：防止文字内容撑开父容器 */
    overflow: hidden; 
}
.chat-list-item .info .name {
    /* 缩小标题字体，并处理过长的情况 */
    font-size: 16px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-list-item .info .subtext {
    /* 缩小副标题字体，变浅，并处理过长的情况 */
    font-size: 14px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px; /* 和标题拉开一点距离 */
}

/* --- 新增：状态栏样式 --- */
.status-bar {
	display: none; 
    padding: 18px 30px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 20; /* 【修改】确保它在最顶层 */
    pointer-events: none;
    /* 【新增】在朋友圈页面，让状态栏文字变白，更清晰 */
    mix-blend-mode: difference;
    color: white;
}
/* --- 新增：聊天搜索结果样式 --- */
.search-result-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    gap: 12px;
    align-items: flex-start;
}
.search-result-item:hover {
    background-color: #f0f2f5;
}
.search-result-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.search-result-item .info {
    flex-grow: 1;
    overflow: hidden;
}
.search-result-item .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.search-result-item .name {
    font-weight: 500;
    color: var(--primary-text);
}
.search-result-item .timestamp {
    font-size: 12px;
    color: var(--secondary-text);
}
.search-result-item .content {
    font-size: 14px;
    color: var(--secondary-text);
    /* 防止文本换行，保持单行显示 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 搜索关键词高亮样式 */
.search-result-item .content mark {
    background-color: #ffd700;
    color: black;
    font-weight: 600;
    border-radius: 3px;
    padding: 1px 2px;
}
/* --- 同人论坛样式 --- */
#fanfic-forum-page .page-content {
    background-color: #ffffff;
    padding: 0;
}

.fanfic-empty-state {
    text-align: center;
    padding-top: 100px;
    color: var(--secondary-text);
}

.fanfic-card {
    background-color: #fff;
    margin: 0 12px 20px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}
.fanfic-card:active {
    transform: scale(0.98);
}

.fanfic-card-content {
    padding: 16px;
}

.fanfic-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-text);
    margin: 0 0 10px 0;
}

.fanfic-card-snippet {
    font-size: 15px;
    color: var(--secondary-text);
    line-height: 1.6;
    max-height: 72px; /* 大约3行 */
    overflow: hidden;
    text-overflow: ellipsis;
    /* 多行省略需要额外处理，这里先简单隐藏 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.fanfic-card-actions {
    display: flex;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    gap: 20px;
}

.fanfic-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--secondary-text);
}
.fanfic-action-btn .svg-icon {
    width: 20px;
    height: 20px;
}
.fanfic-action-btn.liked .svg-icon {
    fill: #E53935;
    stroke: #E53935;
}
/* 在 “--- 同人论坛样式 ---” 区域添加 */
.fanfic-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--secondary-text);
    display: flex;
    gap: 16px;
    align-items: center; 	
}
/* 【全新添加】为图标和数字的组合体设置样式 */
.fanfic-footer-item {
    display: flex;
    align-items: center;
    gap: 5px; /* 图标和数字之间的间距 */
}

/* 【全新添加】定义图标本身的大小和颜色 */
.fanfic-footer-item .svg-icon {
    width: 16px;
    height: 16px;
    color: var(--secondary-text); /* 使用你已有的颜色变量，保持风格统一 */
}

/* --- 文章详情页样式 --- */
#fanfic-detail-container {
    padding: 20px;
}
.fanfic-full-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
}
.fanfic-full-content {
    font-size: 16px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 40px;
}
.fanfic-comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.comments-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}
/* --- 文章详情页样式 --- */
.comment-thread {
    background-color: #f8f9fa; /* 1. 为每条评论添加浅灰色背景，形成卡片 */
    padding: 12px 16px;      /* 2. 增加内边距，让内容更舒展 */
    border-radius: 12px;       /* 3. 添加圆角，让卡片更柔和 */
    margin-bottom: 12px;
}
.comment-author {
    font-weight: 600;                 /* 4. 字体加粗，更突出 */
    color: var(--accent-color);       /* 5. 使用主题强调色 (蓝色)，醒目且可交互感强 */
    margin-bottom: 6px;               /* 6. 稍微增加与下方内容的间距 */
    font-size: 14px;                  /* 7. 字体略微缩小，形成视觉层级 */
}
.comment-content {
    color: #495057;                   /* 8. 使用更柔和的深灰色，降低阅读疲劳 */
    line-height: 1.6;                 /* 9. 增大行高，提升大段文字的可读性 */
    margin-bottom: 4px;
}
.comment-reply {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color); /* 10. 使用主题边框颜色，风格更统一 */
    margin-top: 10px;
}
.comment-reply-btn {
    font-size: 12px;
    color: var(--secondary-text);
    cursor: pointer;
}

/* 在 “--- 文章详情页样式 ---” 区域添加 */
.fanfic-detail-actions {
    display: flex;
    justify-content: center; /* 居中 */
    gap: 30px; /* 按钮间距 */
    padding: 20px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
/* ---爱心按钮 --- */
svg use[href="#icon-heart"] {
    fill: none;
    stroke: currentColor; /* currentColor 是个非常有用的值，它表示“边框颜色跟随其父元素的文字颜色” */
    transition: all 0.2s ease-in-out; /* 平滑过渡效果 */
}

/* 2. 【“喜欢”状态的覆盖样式】 */
.liked svg use[href="#icon-heart"] {
    fill: #E53935;
    stroke: #E53935;
}

/* 3. 【“喜欢”状态的文字样式】 */
.liked span {
    color: #E53935;
}

/* 4. (可选但推荐) 为所有 svg-icon 设置一个统一的大小 */
.svg-icon {
    width: 20px;
    height: 20px;
}

/* 在 “--- 聊天界面样式 ---” 区域添加 */
.fanfic-share-bubble {
    background-color: var(--bg-color-secondary);
    border-radius: 12px;
    padding: 12px;
    max-width: 280px; /* 限制最大宽度 */
    cursor: pointer; /* 增加可点击手势 */
    border: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.fanfic-share-bubble:hover {
    background-color: var(--bg-color-tertiary);
}

.fanfic-share-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    /* 防止标题过长 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fanfic-share-snippet {
    font-size: 13px;
    color: var(--secondary-text);
    margin-bottom: 10px;
    /* 多行省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.fanfic-share-footer {
    font-size: 12px;
    color: var(--tertiary-text);
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}
/* --- 在 “同人论坛样式” 区域内添加 --- */

/* 已选角色标签的样式 */
.fanfic-char-pill {
    background-color: #e6f2ff;
    color: var(--accent-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* 标签上的移除按钮 'x' */
.fanfic-char-pill-remove {
    background: #cddfff;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    cursor: pointer;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
    color: var(--accent-color);
}

.list-view-scrollable {
    max-height: 60vh; /* 核心：最大高度是视窗高度的60% */
    overflow-y: auto;   /* 核心：当内容超出时，自动显示垂直滚动条 */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
}
/* 角色选择弹窗的列表项 */
.char-select-list-item {
    border-bottom: none; /* 移除旧边框 */
    border-top: 1px solid var(--border-color); /* 用顶部边框做分割线 */
}
.char-select-list-item:first-child {
    border-top: none; /* 第一个列表项不需要顶部边框 */
}
.char-select-list-item:hover {
    background-color: #f8f9fa;
}
.char-select-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}
.char-select-list-item label {
    flex-grow: 1;
}
#fanfic-search-container {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    border-bottom: 0px solid transparent !important; /* 收起时隐藏边框 */
}
#fanfic-search-container.open {
    max-height: 300px; /* 一个足够大的高度，确保内容能完全显示 */
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color) !important; /* 展开时显示边框 */
}

/* --- 【全新 V2.1 终极修复版】聊天界面图标自定义 --- */

/* 1. 通用规则：当任何按钮拥有自定义图标时... */
.has-custom-icon {
    /* 用 CSS 变量设置背景图 */
    background-image: var(--custom-icon-url);
    
    /* 核心：确保图标尺寸正确 */
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
}

/* 2. 通用规则：隐藏原始的 SVG 图标 */
.has-custom-icon .svg-icon {
    opacity: 0;
    pointer-events: none;
}

/* 3. 子规则：针对输入框区域的按钮，让其背景透明 */
.input-action-btn.has-custom-icon {
    background-color: transparent !important;
	 border-radius: 0 !important;
}

/* 4. 子规则：【终极修复】针对头部的按钮，强制覆盖 `background: none` */
.app-header .action-btn.has-custom-icon,
.app-header .back-btn.has-custom-icon {
    /* 使用 !important 强制应用背景图，在这场样式战争中取得最终胜利 */
    background-image: var(--custom-icon-url) !important;
}

/* 5. 特殊处理加载状态 (逻辑不变) */
#call-api-btn.has-custom-icon.is-loading {
    background-image: var(--custom-icon-loading-url) !important; 
    animation: spin 1.5s linear infinite;
}
#call-api-btn.has-custom-icon.is-loading .spinner {
    display: none !important;
}


/* 6. 【精细微调】为自定义图标的返回按钮增加左外边距，避免贴边 */
.app-header .back-btn.has-custom-icon {
    margin-left: 8px !important; /* 这个值可以根据你的视觉效果微调，比如 6px 或 10px */
}


/* 5. 【核心修复 ②】为头部按钮创建更具体的规则，以覆盖 `background: none` */
.app-header .action-btn.has-custom-icon,
.app-header .back-btn.has-custom-icon {
    /* 这条规则的优先级更高，会确保背景图被应用 */
    background: var(--custom-icon-url) center / cover no-repeat;
}

/* --- 全局音乐播放条 (V4.0 最终完美版) --- */

/* 1. 统一的基础样式 (所有页面通用) */
#music-player-bar {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 50; 
    padding: 8px 12px; 
    box-sizing: border-box;
    display: flex;        
    align-items: center;  
    gap: 8px;             
    flex-wrap: nowrap;
    transition: all 0.3s ease;

    /* ▼▼▼ 这是你喜欢的【半透明磨砂】视觉样式 ▼▼▼ */
    background-color: rgba(0, 0, 0, 0.1); 
    backdrop-filter: blur(5px);
    border: none;
    box-shadow: none;
    
    /* ▼▼▼【核心修改1】为所有页面都加上下方的圆角 ▼▼▼ */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* 默认文字和图标颜色 (所有页面都用白色) */
#music-player-bar .music-info .title,
#music-player-bar .lyrics-container,
#music-player-bar .svg-icon {
    color: #fff;
}

/* 2. 朋友圈专属的【布局】样式 */
#music-player-bar.moments-layout {
    margin: 10px;
    width: calc(100% - 20px);
    /* ▼▼▼【核心修改2】朋友圈布局需要补上顶部的圆角 ▼▼▼ */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* 3. 进度条样式 */
.progress-bar-top {
    width: 100%;
    height: 2px;
    background-color: rgba(255,255,255,0.3);
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* 只有在朋友圈样式下，进度条顶部才有圆角 */
#music-player-bar.moments-layout .progress-bar-top {
    border-radius: 12px 12px 0 0;
}

/* 进度条填充和拖动点的样式保持不变 */
.progress-bar-top::after {
    content: '';
    display: block;
    height: 100%;
    background-color: var(--accent-color);
    width: var(--progress, 0%);
    transition: width 0.1s linear;
}
.progress-handle-top {
    position: absolute;
    top: 50%;
    left: var(--progress, 0%);
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}


/* --- 音乐 App 主页面 --- */
#music-app-page {
    position: relative; /* 关键：为伪元素定位提供基准 */
    background-color: #282828; /* 默认深色背景 */
    color: #fff;
    overflow: hidden; /* 防止背景溢出 */
}

/* 新增：用于显示壁纸和遮罩的伪元素 */
#music-app-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 将其置于内容下方 */
    
    /* 关键：背景图片由一个CSS变量控制，默认是渐变 */
    background-image: var(--music-wallpaper, linear-gradient(to top, #282828 0%, #484848 100%));
    
    background-size: cover;
    background-position: center;
    
    /* 关键：添加一个半透明黑色遮罩，确保文字清晰可见 */
    box-shadow: inset 0 0 0 100vmax rgba(0,0,0,0.4);
    
    transition: background-image 0.5s ease-in-out; /* 添加淡入淡出效果 */
}


#music-main-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#music-player-main-view {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    flex-grow: 1;
}

/* 黑胶唱片 (已修改) */
.vinyl-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin-top: 40px;
}

/* 【修改】用 CSS 绘制指针 */
.vinyl-arm {
    position: absolute;
    top: -20px;
    left: 270px;
    width: 150px;
    height: 150px;
    z-index: 10;
    transform-origin: 15px 15px; /* 设置旋转中心点 */
    transition: transform 0.5s ease;
    transform: rotate(60deg);
    pointer-events: none; /* 让鼠标可以穿透指针，点击到下面的封面 */
}
/* 【新增】用伪元素绘制指针的“转轴” */
.vinyl-arm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background: #333;
    border-radius: 50%;
    border: 2px solid #555;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
/* 【新增】用伪元素绘制指针的“臂”和“唱头” */
.vinyl-arm::after {
    content: '';
    position: absolute;
    top: 11px; /* 垂直居中 */
    left: 15px; /* 从转轴中心开始 */
    width: 100px; /* 臂的长度 */
    height: 8px; /* 臂的厚度 */
    background: linear-gradient(to right, #d3d3d3, #b0b0b0); /* 金属质感渐变 */
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    /* 绘制唱头部分 */
    border-right: 12px solid #444;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.vinyl-container.playing .vinyl-arm {
    transform: rotate(120deg);
}

/* 【修改】用 CSS 绘制黑胶唱片 */
.vinyl-record {
    width: 280px;
    height: 280px;
    /* 移除背景图片，改用纯 CSS 实现 */
    background-color: #222; /* 唱片底色 */
    background-image: repeating-radial-gradient( /* 用渐变模拟唱片上的纹路 */
        circle at center, 
        rgba(255, 255, 255, 0.04) 0, 
        rgba(255, 255, 255, 0.04) 1px, 
        transparent 1px, 
        transparent 3px
    );
    box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.6); /* 增加内外阴影，更有立体感 */
    border: 2px solid #111;
    
    /* 保留原有的动画和布局属性 */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: rotate-vinyl 20s linear infinite;
    animation-play-state: paused;
}
.vinyl-container.playing .vinyl-record {
    animation-play-state: running;
}
@keyframes rotate-vinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.vinyl-cover {
    width: 180px;
    height: 180px;
    background-color: #555;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 2px solid #111;
}

/* 主歌词区 */
.lyrics-view-main {
    height: 60px;
    text-align: center;
    font-size: 16px;
    color: #ccc;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
}

/* 主进度条 */
.main-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #aaa;
}
.progress-bar-main {
    flex-grow: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.progress-filled-main {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0;
}
.progress-handle-main {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* 主控制按钮 */
.music-app-controls {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
}
.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    fill: #fff;
    padding: 10px;
    color: #fff; /* 默认白色 */
}

/* 主音乐应用页面的播放模式按钮使用主题色 */
.control-btn#main-play-mode-btn {
    color: var(--accent-color);
}
.control-btn svg {
    width: 24px;
    height: 24px;
}
.control-btn.play-btn svg {
    width: 48px;
    height: 48px;
}

/* 侧边栏 */
#music-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: #f8f9fa;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}
#music-sidebar.active {
    transform: translateX(0);
}
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h3 { margin: 0; color: var(--primary-text); }
.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}
/* 侧边栏内的播放列表项 (复用之前的样式) */
#music-playlist-sidebar-container .music-playlist-item {
    padding: 12px 16px;
}
#music-playlist-sidebar-container .music-playlist-item .song-title {
    color: var(--primary-text); /* 将歌曲标题设为主要文字颜色 (近黑色) */
}
#music-playlist-sidebar-container .music-playlist-item .song-artist {
    color: var(--secondary-text); /* 将歌手名设为次要文字颜色 (灰色) */
}
#music-playlist-sidebar-container .music-playlist-item.playing {
    background-color: #e0eaff;
    border-left: 3px solid var(--accent-color);
}
/* --- 全屏歌词样式 --- */
#full-lyrics-view {
    position: fixed;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    background-color: rgba(0, 0, 0, 0.1); /* 朋友圈样式：90%透明 */
    backdrop-filter: blur(5px); /* 朋友圈样式：轻微模糊 */
    border-radius: 12px; /* 朋友圈样式：圆角 */
    border: none; /* 朋友圈样式：无边框 */
    z-index: 200;
    display: none; /* 默认隐藏 */
    color: #fff; /* 朋友圈样式：白色文字 */
    font-size: 18px;
    text-align: center;
    overflow: hidden;
}
.lyrics-list {
    width: 100%;
    height: 100%;
    padding: 50% 20px; /* 上下留出空间，让当前歌词能在中间 */
    box-sizing: border-box;
    overflow-y: auto;
    scroll-behavior: smooth; /* 平滑滚动 */
}
.lyrics-list p {
    margin: 18px 0;
    line-height: 1.5;
    transition: color 0.3s, transform 0.3s;
}
.lyrics-list p.active {
    color: #fff;
    font-weight: 600;
    transform: scale(1.1);
}
/* --- 【全新】一起听歌弹窗样式 (Listen Together Modal) --- */

/* 遮罩层 */
.lt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1); /* 朋友圈样式：90%透明 */
    backdrop-filter: blur(5px); /* 朋友圈样式：轻微模糊 */
    z-index: 1001; /* 比其他元素层级高 */
    display: flex;
    justify-content: center;
    align-items: flex-end; /* 关键：让弹窗从底部对齐 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lt-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 弹窗主体 */
.lt-modal {
    width: calc(100% - 20px);
    max-height: 85%;
    background: rgba(0, 0, 0, 0.1); /* 朋友圈样式：90%透明 */
    backdrop-filter: blur(5px); /* 朋友圈样式：轻微模糊 */
    border-radius: 12px; /* 朋友圈样式：圆角 */
    border: none; /* 朋友圈样式：无边框 */
    box-shadow: none; /* 朋友圈样式：移除阴影 */
    margin: 10px; /* 朋友圈样式：边距 */
    padding: 12px 20px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff; /* 朋友圈样式：白色文字 */
}
.lt-overlay.show .lt-modal {
    transform: translateY(0);
}

/* 顶部拖动条和关闭按钮 */
.lt-header-bar {
    display: flex;                 /* 启用 Flexbox 布局 */
    justify-content: space-between;/* 核心！两端对齐，中间项目会被自动推开 */
    align-items: center;           /* 垂直居中，让三者高低对齐 */
    width: 100%;                   /* 确保容器占满宽度 */
}
.lt-drag-handle {
    width: 40px;
    height: 5px;
    background-color: #dcdcdc;
    border-radius: 2.5px;
}
.lt-close-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f0f2f5;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 30px;
    text-align: center;
    color: #8a8d91;
    cursor: pointer;
}

/* 头像和计时器区域 */
.lt-profile-section {
    text-align: center;
    margin-bottom: 25px;
}
.lt-avatars {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.lt-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}
.lt-avatar:last-child {
    margin-left: -18px; /* 头像重叠效果 */
}
#lt-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-text);
    margin: 0 0 4px 0;
}
#lt-timer {
    font-size: 14px;
    color: var(--secondary-text);
    margin: 0;
}

/* 当前播放卡片 */
.lt-current-song-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 25px;
}
.lt-current-cover {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.lt-current-info {
    flex-grow: 1;
    overflow: hidden;
}
.lt-current-info h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lt-current-info p {
    font-size: 13px;
    color: var(--secondary-text);
    margin: 0;
}
.lt-play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* 播放列表 */
.lt-playlist-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出 */
}
.lt-playlist-section h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: var(--secondary-text);
}
.lt-playlist-container {
    overflow-y: auto;
    flex-grow: 1;
}
/* 复用之前的列表项样式，但做些微调 */
.lt-playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
}
.lt-playlist-item .song-info {
    flex-grow: 1;
}
.lt-playlist-item .song-title {
    font-weight: 500;
    color: var(--primary-text);
}
.lt-playlist-item .song-artist {
    font-size: 12px;
    color: var(--secondary-text);
}
.lt-playlist-item .delete-song-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
}
/* 正在播放的特殊样式 */
.lt-playlist-item.playing .song-title {
    color: var(--accent-color);
}
.lt-playlist-item.playing::before {
    content: '▶';
    color: var(--accent-color);
    font-size: 10px;
    margin-right: 10px;
}
/* --- 新增：CSS 预览区域样式 --- */
.css-preview-area {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden; /* 确保内部样式不会溢出 */
}
/* 覆盖预览区内的消息间距，使其更紧凑 */
.css-preview-area .message-row {
    margin-bottom: 8px;
}
.css-preview-area .message-row:last-child {
    margin-bottom: 0;
}
/* --- 【新增】API 设置页面美化样式 --- */
.api-card-new {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.api-card-new .api-card-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
.api-list-item-new {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 10px;
}
.api-list-item-new.active {
    border-color: var(--accent-color);
    background-color: #e6f2ff;
}
.api-list-item-new .info {
    flex-grow: 1;
}
.api-list-item-new .info .name {
    font-weight: 500;
    color: var(--primary-text);
}
.api-list-item-new .info .url {
    font-size: 12px;
    color: var(--secondary-text);
    word-break: break-all;
}
.api-list-item-new .actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
.api-list-item-new .actions .btn-small {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}
.api-list-item-new .actions .apply-btn {
    background-color: var(--accent-color);
    color: white;
}
.api-list-item-new .actions .delete-btn {
    background-color: #E53935;
    color: white;
}
.api-list-item-new.active .actions .apply-btn {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- 消息与弹窗终极美化 v3 --- */
/* 1. 语音消息优化 (修复宽度自适应) */
.bubble-voice {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 0; min-width: 80px; max-width: 220px; padding: 0;
   transition: none; /* 先重置所有 transition */
}
.bubble-voice.expanded {
    /* 【关键修复】展开时，移除JS设定的固定宽度，让其由内容和max-width决定 */
    width: auto !important; 
    max-width: 80%;
}
.voice-main {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 15px; width: 100%; box-sizing: border-box;
	transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.message-row.user .bubble-voice .voice-main { flex-direction: row-reverse; }
.voice-main .svg-icon { flex-shrink: 0; }
.message-row.user .bubble-voice .svg-icon { transform: scaleX(-1); color: var(--bubble-user-text); }
.message-row.ai .bubble-voice .svg-icon { color: var(--bubble-ai-text); }
.voice-duration { font-size: 14px; color: var(--secondary-text); flex-shrink: 0; }
.message-row.user .voice-duration { color: rgba(255, 255, 255, 0.8); }
.voice-waves { display: flex; align-items: center; gap: 2px; flex-grow: 1; overflow: hidden; height: 20px; }
.message-row.user .voice-waves { justify-content: flex-end; }
.voice-wave { background-color: var(--secondary-text); border-radius: 2px; width: 3px; }
.message-row.user .voice-wave { background-color: rgba(255, 255, 255, 0.8); }
.bubble-voice .voice-text {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease-out, padding 0.35s ease-out;
    padding-top: 0; padding-bottom: 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 0; width: 100%; box-sizing: border-box;
    font-size: 15px; line-height: 1.6;
    padding-left: 15px; padding-right: 15px;
}
.bubble-voice.expanded .voice-text { max-height: 1000px; padding-top: 8px; padding-bottom: 12px; }
.message-row.user .bubble-voice .voice-text { border-top-color: rgba(255,255,255,0.2); }


#modal-content.instagram-viewer-modal {
    width: 95%;
    max-width: 450px; /* 更大的宽度 */
    height: auto;
    max-height: 80%; /* 更高的高度 */
    background-color: #ffffff;
    border: 1px solid #dbdbdb;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    /* 更快、更直接的动画 */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out;
}
#modal-content.instagram-viewer-modal.show-animation {
    transform: scale(1);
    opacity: 1;
}

.ins-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #efefef;
}
.ins-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    background-color: #f0f0f0;
}
.ins-header .ins-user-info {
    font-weight: 600;
    font-size: 15px;
    color: #262626;
}
.ins-close-btn {
    margin-left: auto;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ins-close-btn .svg-icon { width: 20px; height: 20px; color: #8e8e8e; }

.ins-content-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap; /* 保持文本格式 */
}

.ins-footer {
    flex-shrink: 0;
    padding: 8px 16px 12px;
    border-top: 1px solid #efefef;
}
.ins-action-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ins-action-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
}
.ins-action-btn .svg-icon {
    width: 24px;
    height: 24px;
    color: #262626;
    transition: transform 0.2s ease, color 0.2s ease;
}
.ins-action-btn:hover .svg-icon {
    transform: scale(1.1);
    color: #8e8e8e;
}
.ins-action-btn.bookmark {
    margin-left: auto; /* 将书签按钮推到最右边 */
}

.ins-likes {
    font-size: 14px;
    color: #262626;
    margin-top: 8px;
    font-weight: 500;
}
.ins-likes span {
    font-weight: 400;
    color: #8e8e8e;
}

/* 3. 文件预览“Pro”级美化 */
#modal-content.document-viewer-modal {
    width: 95%; max-width: 400px; height: 85%; max-height: 720px;
    padding: 0; display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25); border-radius: 20px;
    transform: scale(0.95); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#modal-content.document-viewer-modal.show-animation { transform: scale(1); opacity: 1; }

.doc-header {
    flex-shrink: 0; padding: 10px 16px; border-bottom: 1px solid #e9ecef;
    display: flex; justify-content: space-between; align-items: center;
    background-color: #fff; border-radius: 20px 20px 0 0;
}
.doc-header .title { font-weight: 500; font-size: 15px; color: #495057; }

/* 新增：模拟编辑器工具栏 */
.doc-toolbar {
    flex-shrink: 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto; /* 在小屏幕上可以横向滚动 */
}
.doc-tool-btn {
    background: none; border: none; padding: 6px; border-radius: 6px;
    cursor: not-allowed; /* 设为禁用状态，因为只是装饰 */
    opacity: 0.7;
    display: flex; align-items: center; justify-content: center;
}
.doc-tool-btn .svg-icon { width: 18px; height: 18px; color: #495057; }
.doc-tool-separator {
    width: 1px;
    height: 18px;
    background-color: #dee2e6;
    margin: 0 6px;
}

.doc-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px; /* 给滚动区域一点边距 */
    background-color: #f1f3f5; /* 类似桌面的背景色 */
}
.doc-paper {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-height: 100%;
}
.doc-paper-body {
    font-family: 'Times New Roman', 'Ma Shan Zheng', serif; /* 使用更像文档的字体 */
    line-height: 1.9;
    font-size: 17px;
    white-space: pre-wrap;
    color: #212529;
}
/* 4. 文件消息美化 (样式不变) */
.chat-bubble.bubble-file {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    width: 250px;
    overflow: hidden;
    color: var(--primary-text);
}
.file-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}
.file-card-header .svg-icon {
    width: 40px;
    height: 40px;
    color: #555;
    flex-shrink: 0;
}
.file-card-info .file-name {
    font-weight: 500;
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.file-card-info .file-size {
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 4px;
}
.file-card-footer {
    border-top: 1px solid var(--border-color);
    padding: 4px 12px;
    font-size: 12px;
    color: var(--secondary-text);
}
/* 5. 撤回消息样式 (正式整合) */
.retracted-message {
    color: var(--secondary-text);
    font-size: 13px;
    padding: 8px 16px;
    background: #e9ecef;
    border-radius: 16px;
    margin: 12px auto;
    cursor: default; /* 整体不可点击，只有span可点 */
    display: inline-block; /* 让margin:auto生效 */
}
.retracted-message span {
    text-decoration: underline;
    cursor: pointer;
    color: var(--accent-color); /* 给可点击部分一个强调色 */
}
/* --- 消息与弹窗终极美化 v6 (全系 Ins 风格) --- */
/* 2. 【全新】Ins 风格交互式气泡 (v2 修复版) */
.chat-bubble.bubble-transfer,
.chat-bubble.bubble-location,
.chat-bubble.bubble-gift {
    /* 统一的卡片基础样式 */
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    width: 250px;
    overflow: hidden;
    color: var(--primary-text);
    /* 【核心修复】强制内部元素垂直排列 */
    display: flex;
    flex-direction: column;
}

/* 卡片头部：包含图标和标题 */
.interactive-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    flex-shrink: 0; /* 防止头部被压缩 */
}
.interactive-card-header .svg-icon {
    width: 38px;  /* 稍微增大图标，更协调 */
    height: 38px;
    flex-shrink: 0;
    padding: 8px;
    border-radius: 8px; /* 圆角矩形更好看 */
    color: white;
}
.interactive-card-header .info {
    flex-grow: 1;
    overflow: hidden; /* 防止文字溢出 */
}
.interactive-card-header .info .title {
    font-weight: 500;
    font-size: 16px;
    /* 【核心修复】防止标题换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	color: var(--primary-text); 
}
.interactive-card-header .info .subtitle {
    font-size: 13px; /* 副标题字体稍大一点 */
    color: var(--primary-text); /* 金额/礼物名用主要颜色，更清晰 */
    margin-top: 4px;
}

/* 为不同类型的卡片设置独特的图标背景色 */
.bubble-transfer .svg-icon { background-color: #fabf44; }
.bubble-location .svg-icon { background-color: #4a90e2; }
.bubble-gift .svg-icon { background-color: #f87c7c; }

/* 卡片主体内容区（仅定位卡片使用） */
.interactive-card-body {
    height: 100px;
    background: #e9e9e9 url('https://pic1.imgdb.cn/item/68b614b858cb8da5c86d8e1b.jpg') center/cover;     
}

/* 卡片底部：显示状态或类型 */
.interactive-card-footer {
    border-top: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 12px;
    color: var(--secondary-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止底部被压缩 */
}
.interactive-card-footer .status {
    font-weight: 500;
}

/* 3. 【全新】Ins 风格弹窗 (统一框架) */
#modal-content.instagram-viewer-modal {
    width: 95%; max-width: 450px; height: auto; max-height: 80%;
    background-color: #ffffff; border: 1px solid #dbdbdb; padding: 0;
    display: flex; flex-direction: column; border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: scale(0.95); opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out;
}
#modal-content.instagram-viewer-modal.show-animation { transform: scale(1); opacity: 1; }

.ins-header {
    flex-shrink: 0; display: flex; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #efefef;
}
.ins-header img { width: 36px; height: 36px; border-radius: 50%; margin-right: 12px; object-fit: cover; background-color: #f0f0f0; }
.ins-header .ins-user-info { font-weight: 600; font-size: 15px; color: #262626; }
.ins-close-btn { margin-left: auto; cursor: pointer; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; }
.ins-close-btn .svg-icon { width: 20px; height: 20px; color: #8e8e8e; }

/* 【关键修复】图片描述文字左对齐 */
.ins-content-body {
    flex-grow: 1; overflow-y: auto; padding: 20px;
    font-size: 15px; line-height: 1.7; color: #333;
    white-space: pre-wrap; text-align: left; /* 强制左对齐 */
}

.ins-footer {
    flex-shrink: 0; padding: 12px 16px;
    border-top: 1px solid #efefef;
}
/* 装饰性图标栏 */
.ins-action-bar { display: flex; align-items: center; gap: 16px; }
.ins-action-btn { cursor: pointer; background: none; border: none; padding: 0; display: flex; }
.ins-action-btn .svg-icon { width: 24px; height: 24px; color: #262626; transition: transform 0.2s ease, color 0.2s ease; }
.ins-action-btn:hover .svg-icon { transform: scale(1.1); color: #8e8e8e; }
.ins-action-btn.bookmark { margin-left: auto; }
.ins-likes { font-size: 14px; color: #262626; margin-top: 8px; font-weight: 500; }
.ins-likes span { font-weight: 400; color: #8e8e8e; }

/* 交互式弹窗的特定内容样式 */
.ins-content-body.interactive-content {
    text-align: center; /* 交互弹窗内容居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}
.interactive-icon-large { margin-bottom: 16px; }
.interactive-icon-large .svg-icon { width: 60px; height: 60px; color: var(--accent-color); }
.interactive-title { font-size: 22px; font-weight: 600; color: #262626; margin: 0 0 8px 0; }
.interactive-subtitle { font-size: 15px; color: #8e8e8e; margin: 0; line-height: 1.5; }
.interactive-message { font-style: italic; color: #555; margin-top: 16px; padding: 10px; background: #f9f9f9; border-radius: 8px; }

/* 交互式弹窗的按钮 */
.ins-footer.interactive-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
}
.ins-footer.interactive-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ins-footer.interactive-actions button:hover { opacity: 0.85; }
.ins-button-primary { background-color: var(--accent-color); color: white; }
.ins-button-secondary { background-color: #efefef; color: #262626; }
/* --- 【全新】转发消息样式 --- */
.chat-bubble.bubble-forward {
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    width: 260px;
    color: var(--primary-text);
    cursor: pointer;
    transition: background-color 0.2s;
}
.chat-bubble.bubble-forward:hover {
    background-color: #f9f9f9 !important;
}
.forward-header {
    font-size: 16px;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}
.forward-snippet {
    font-size: 14px;
    color: var(--secondary-text);
    line-height: 1.5;
}
.forward-snippet p {
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forward-snippet p:last-child {
    margin-bottom: 0;
}

/* --- 【全新】转发记录查看器弹窗 --- */
#modal-content.forward-viewer-modal {
    width: 95%;
    max-width: 450px;
    height: 80%;
    background-color: #f0f2f5; /* 使用灰色背景，更像聊天背景 */
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.forward-viewer-header {
    flex-shrink: 0;
    text-align: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 24px 24px 0 0;
    position: relative;
}
.forward-viewer-header .title {
    font-weight: 600;
    font-size: 17px;
}
.forward-viewer-header .ins-close-btn { /* 复用ins风格的关闭按钮 */
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
}
.forward-viewer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 10px;
}
/* 在查看器内模拟消息行 */
.forward-viewer-body .message-line {
    margin-bottom: 12px;
    font-size: 15px;
}
.forward-viewer-body .sender {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--primary-text);
}
.forward-viewer-body .message {
    padding: 8px 12px;
    background-color: #fff;
    border-radius: 8px;
    display: inline-block;
    max-width: 90%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* --- 【全新】转发目标选择器美化 --- */
.forward-target-selector .list-item {
    /* 复用 chat-list-item 的大部分样式，但移除了边框，让它在弹窗内更简洁 */
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.forward-target-selector .list-item:last-child {
    border-bottom: none;
}
.forward-target-selector .list-item:hover {
    background-color: #f0f2f5;
}
.forward-target-selector .chat-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    margin-right: 14px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #e9ecef;
}
.forward-target-selector .info {
    flex-grow: 1;
    overflow: hidden; /* 防止文字溢出 */
}
.forward-target-selector .name {
    font-weight: 500;
    color: var(--primary-text);
    font-size: 16px;
}
.forward-target-selector .subtext {
    font-size: 13px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}
.forward-target-selector .group-icon {
    font-size: 12px;
    background: #eee;
    color: #555;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}
/* --- 【全新 V2.0】表情包库交互式样式 --- */
/* 表情包网格容器 - 确保它能填满空间并滚动 */
#sticker-grid-container-wrapper {
    flex-grow: 1;
    overflow: hidden; /* 让内部的网格自己滚动 */
}
#sticker-grid-container {
    height: 100%;
    overflow-y: auto; /* 核心：让网格本身可以垂直滚动 */
    padding-top: 5px;
    padding-bottom: 5px;
}

/* 添加面板展开时的样式 */
#add-sticker-panel.open {
    max-height: 300px; /* 展开后的高度，可以根据内容调整 */
    border-bottom-color: var(--border-color) !important; /* 显示分割线 */
    margin-bottom: 15px !important; /* 和下面的网格拉开距离 */
}

/* 表情包单个项目的美化 */
/* 【V2.2 遮挡问题终极修复版】表情包单个项目的美化 */
#sticker-grid-container .sticker-item {
    /* 【核心修复】移除 aspect-ratio，改用明确的高度 */
    height: 80px; 
    
    /* 其他样式保持不变，但可以移除多余的 width: 100% */
    background-color: #f0f2f5;
    border-radius: 8px;
    cursor: pointer;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

#sticker-grid-container .sticker-item:active {
    transform: scale(0.9);
}

/* 【V2.1 交互修正版】悬浮删除图标样式 */
#sticker-grid-container .sticker-item .delete-overlay {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    line-height: 24px; /* 确保图标垂直居中 */
    
    /* 默认状态：完全透明，且缩小，不可见 */
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    transition: all 0.2s ease-in-out;
}

/* 仅当鼠标悬浮在整个表情项上时，才让删除图标“准备好” */
#sticker-grid-container .sticker-item:hover .delete-overlay {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto; /* 【关键】只有此时，删除图标才可被点击 */
}


/* --- 【全新】表情包专属气泡样式 --- */
.chat-bubble.bubble-sticker {
    background: none !important; /* 完全无背景 */
    background-color: transparent !important; /* 无背景色 */
    background-image: none !important; /* 无背景图片 */
    border: none !important; /* 无边框 */
    border-radius: 0 !important; /* 无圆角 */
    padding: 0 !important; /* 无内边距 */
    margin: 0 !important; /* 无外边距 */
    box-shadow: none !important; /* 无阴影 */
    backdrop-filter: none !important; /* 无背景模糊 */
    -webkit-backdrop-filter: none !important; /* Safari兼容 */
    filter: none !important; /* 无滤镜 */
    max-width: 120px; /* 限制最大尺寸 */
    cursor: default; /* 鼠标指针为默认，表示不可点击 */
    position: relative; /* 确保定位正常 */
    z-index: 1; /* 确保在最上层 */
}

/* 用户发送的表情包也要去除所有用户气泡样式 */
.message-row.user .chat-bubble.bubble-sticker {
    background: none !important;
    background-color: transparent !important;
    color: inherit !important; /* 不使用用户气泡的文字颜色 */
    border-bottom-right-radius: 0 !important; /* 覆盖用户气泡的特殊圆角 */
}

/* 【关键修复】表情包气泡移除所有伪元素装饰效果 */
.message-row.user .chat-bubble.bubble-sticker::before,
.message-row.user .chat-bubble.bubble-sticker::after,
.message-row.ai .chat-bubble.bubble-sticker::before,
.message-row.ai .chat-bubble.bubble-sticker::after {
    display: none !important; /* 完全隐藏伪元素 */
    content: none !important; /* 移除伪元素内容 */
    background: none !important; /* 移除背景 */
    background-image: none !important; /* 移除背景图片（贴纸） */
    opacity: 0 !important; /* 透明度为0 */
    visibility: hidden !important; /* 隐藏元素 */
}

.chat-bubble.bubble-sticker img {
    width: 100%;
    height: auto;
    display: block;
    border: none !important; /* 确保图片无边框 */
    border-radius: 0 !important; /* 图片无圆角 */
    box-shadow: none !important; /* 图片无阴影 */
    /* 你可以加一点效果，比如轻微的阴影，让它更有质感 */
    /* filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15)); */
}
/* --- 【V4 终极布局版】通话页面样式 --- */
#call-page {
    background-color: #1c1c1e;
    color: #fff;
}
#call-background {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: opacity 0.5s ease-in-out;
}
#call-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(15px);
}
.call-ui-container {
    position: relative; z-index: 10;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    padding: 0; box-sizing: border-box;
}

/* --- 顶部信息 --- */
.call-header {
    flex-shrink: 0;
    padding: 60px 20px 20px;
    text-align: center;
    transition: opacity 0.3s, transform 0.3s;
}
.call-avatar {
    width: 90px; height: 90px;
    border-radius: 50%; object-fit: cover;
    margin: 0 auto 15px;
    border: 2px solid rgba(255,255,255,0.5);
}
.call-name { font-size: 24px; font-weight: 600; }
.call-status { font-size: 16px; color: #a0a0a0; margin-top: 8px; }

/* --- 中间聊天记录 --- */
.call-history-wrapper {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* 【核心修改】为底部的绝对定位控制区留出空间 */
    padding-bottom: 220px; 
    box-sizing: border-box;
}
.call-history-log {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 0 15px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* ... 气泡样式 p.user, p.ai 保持不变 ... */
.call-history-log p { margin: 0; line-height: 1.5; font-size: 15px; padding: 6px 12px; border-radius: 12px; max-width: 85%; word-wrap: break-word; }
.call-history-log p.user { background-color: var(--accent-color); align-self: flex-end; }
.call-history-log p.ai { background-color: rgba(255,255,255,0.2); align-self: flex-start; }

/* --- 底部控制 --- */
.call-controls {
    /* 【核心修改】将整个控制区绝对定位在底部 */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 40px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.call-input-wrapper {
    display: none;
    gap: 10px;
}
#call-input { flex-grow: 1; border: none; background: rgba(255,255,255,0.2); border-radius: 20px; padding: 10px 15px; color: #fff; font-size: 16px; }
#call-send-btn { border: none; background: var(--accent-color); color: #fff; padding: 0 20px; border-radius: 20px; cursor: pointer; font-weight: 500; }

.call-actions-final {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.call-action-item { text-align: center; }
.call-action-button {
    width: 70px; height: 70px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    margin: 0 auto 8px; cursor: pointer;
}
.call-action-button svg { width: 30px; height: 30px; color: #fff; }


/* --- 视频通话专属覆盖样式 --- */
#call-page.video-mode .call-header {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}
#call-page.video-mode #call-overlay {
    backdrop-filter: blur(0);
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.0) 50%);
}
#call-page.video-mode .call-status {
    position: absolute;
    top: 20px; left: 20px;
    text-align: left;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px; border-radius: 12px;
    font-size: 14px;
    opacity: 1; transform: translateY(0); pointer-events: auto;
	 text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
#call-page.video-mode .call-history-wrapper {
    /* 【核心修改】不再需要 absolute 定位，因为它已经是 flex-grow: 1 了 */
    /* 我们只需要调整它的 padding-bottom 就可以控制它和按钮的距离 */
    padding-bottom: 220px; 
    /* 移除旧的定位代码
    position: absolute;
    bottom: 200px; 
    left: 0; right: 0;
    height: 35%;
    justify-content: flex-end; */
}
#call-page.video-mode .call-controls {
    background: transparent;
}
#call-page.video-mode .call-history-log p {
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    /* 也可以让气泡本身更透明一点，更好地融入背景 */
    background-color: rgba(0,0,0,0.3); 
}
#call-page.video-mode .call-history-log p.user {
    /* 用户的气泡可以保持原样，因为它本身颜色很深 */
    background-color: var(--accent-color);
    text-shadow: none;
}

.call-hangup-row { text-align: center; margin-top: 10px; }
.call-hangup-btn {
    width: 70px; height: 70px;
    border-radius: 50%;
    border: none;
    background: #FF3B30;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px;
    transform: rotate(135deg);
}
/* --- 【新增】通话页面发送按钮加载状态 --- */
#call-send-btn {
    position: relative;
    min-width: 60px; /* 给按钮一个最小宽度，防止加载时变形 */
}
#call-send-btn .spinner {
    display: none;
    margin: 0 auto; /* 让圈圈在按钮内居中 */
    border-color: white; /* 圈圈颜色为白色 */
    border-top-color: transparent; /* 顶部透明，形成旋转效果 */
    width: 20px;
    height: 20px;
}
#call-send-btn.is-loading .btn-text {
    display: none; /* 加载时，隐藏“发送”文字 */
}
#call-send-btn.is-loading .spinner {
    display: block; /* 加载时，显示圈圈 */
}
/* --- 在【通话页面样式】区域添加以下代码 --- */

/* 1. 默认隐藏这个小窗口 */
#my-video-preview {
    display: none; 
    position: absolute;
    top: 60px; /* 距离顶部安全区，可微调 */
    right: 20px;
    width: 100px;  /* 小窗口宽度 */
    height: 150px; /* 小窗口高度 */
    background-color: #333;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 15; /* 确保在其他元素之上 */
    transition: opacity 0.3s;
}

/* 2. 当是视频通话时，才显示它 */
#call-page.video-mode #my-video-preview {
    display: block;
}


