/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局默认背景色 - 所有界面共用 */
:root {
    --global-bg-color: #F0F0F0;
}

/* 深色模式样式 */
body.dark-mode {
    --global-bg-color: #2d2d2d;
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* PWA模式特殊样式 */
@media all and (display-mode: standalone) {
    /* 适配iOS设备，特别是灵动岛区域 */
    .app-container {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        background-color: #F0F0F0;
    }
    
    body.dark-mode .app-container {
        background-color: #1e1e1e;
    }
    
    /* 确保顶栏颜色与主题色一致 */
    .app-header {
        background-color: #F0F0F0;
    }
    
    body.dark-mode .app-header {
        background-color: #1e1e1e;
    }
    
    /* 适配iOS状态栏 */
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        background-color: #F0F0F0;
    }
    
    body.dark-mode {
        background-color: #1e1e1e;
    }
}

/* iOS Safari特殊样式 */
@supports (-webkit-touch-callout: none) {
    /* 确保在Safari中添加到主屏幕时显示正确 */
    html {
        touch-action: manipulation;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--global-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 导出格式选择对话框 */
.export-format-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.export-format-dialog .dialog-content {
    background-color: #fff;
    border-radius: 12px;
    width: 80%;
    max-width: 320px;
    overflow: hidden;
}

.export-format-dialog .dialog-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.export-format-dialog .dialog-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.export-format-dialog .dialog-body {
    padding: 8px 0;
}

.export-format-dialog .export-option {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-format-dialog .export-option:hover {
    background-color: #f5f5f5;
}

.export-format-dialog .option-icon {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    font-size: 20px;
    color: #666;
}

.export-format-dialog .export-json-option .option-icon {
    background-color: #e3f2fd;
    color: #1976d2;
}

.export-format-dialog .export-txt-option .option-icon {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.export-format-dialog .option-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.export-format-dialog .option-desc {
    font-size: 12px;
    color: #666;
}

.export-format-dialog .dialog-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.export-format-dialog .dialog-footer button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #f0f0f0;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-format-dialog .dialog-footer button:hover {
    background-color: #e0e0e0;
}

/* 深色模式下的导出对话框样式 */
body.dark-mode .export-format-dialog .dialog-content {
    background-color: #3a3a3a;
}

body.dark-mode .export-format-dialog .dialog-header,
body.dark-mode .export-format-dialog .dialog-footer {
    border-color: #555;
}

body.dark-mode .export-format-dialog .dialog-header h3 {
    color: #e0e0e0;
}

body.dark-mode .export-format-dialog .export-option:hover {
    background-color: #444;
}

/* 导入数据对话框样式 */
.import-data-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.import-data-dialog .dialog-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.import-data-dialog .dialog-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.import-data-dialog .dialog-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.import-data-dialog .dialog-body {
    padding: 16px;
    flex-grow: 1;
}

.import-data-dialog .import-description {
    margin-bottom: 16px;
}

.import-data-dialog .import-description p {
    margin: 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.import-data-dialog .file-input-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.import-data-dialog .select-file-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 8px;
}

.import-data-dialog .select-file-button:hover {
    background-color: #e0e0e0;
}

.import-data-dialog .selected-file-name {
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-data-dialog .import-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.import-data-dialog .import-option {
    display: flex;
    align-items: center;
}

.import-data-dialog .checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    width: 100%;
}

.import-data-dialog .checkbox-container input[type="checkbox"] {
    display: none;
}

.import-data-dialog .checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: background-color 0.2s;
}

.import-data-dialog .checkbox-container input[type="checkbox"]:checked + .checkmark {
    background-color: #007aff;
    border-color: #007aff;
}

.import-data-dialog .checkbox-container input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.import-data-dialog .option-text {
    flex-grow: 1;
}

.import-data-dialog .dialog-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

.import-data-dialog .cancel-button,
.import-data-dialog .confirm-button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.import-data-dialog .cancel-button {
    background-color: #f0f0f0;
    color: #333;
}

.import-data-dialog .cancel-button:hover {
    background-color: #e0e0e0;
}

.import-data-dialog .confirm-button {
    background-color: #007aff;
    color: white;
}

.import-data-dialog .confirm-button:hover {
    background-color: #0056b3;
}

.import-data-dialog .confirm-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 深色模式下的导入对话框样式 */
body.dark-mode .import-data-dialog .dialog-content {
    background-color: #3a3a3a;
}

body.dark-mode .import-data-dialog .dialog-header,
body.dark-mode .import-data-dialog .dialog-footer {
    border-color: #555;
}

body.dark-mode .import-data-dialog .dialog-header h3 {
    color: #e0e0e0;
}

body.dark-mode .import-data-dialog .import-description p {
    color: #aaa;
}

body.dark-mode .import-data-dialog .select-file-button {
    background-color: #444;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .import-data-dialog .select-file-button:hover {
    background-color: #555;
}

body.dark-mode .import-data-dialog .selected-file-name {
    color: #aaa;
}

body.dark-mode .import-data-dialog .checkbox-container {
    color: #e0e0e0;
}

body.dark-mode .import-data-dialog .checkmark {
    border-color: #555;
}

body.dark-mode .import-data-dialog .cancel-button {
    background-color: #444;
    color: #e0e0e0;
}

body.dark-mode .import-data-dialog .cancel-button:hover {
    background-color: #555;
}

body.dark-mode .export-format-dialog .option-text {
    color: #e0e0e0;
}

body.dark-mode .export-format-dialog .option-desc {
    color: #aaa;
}

body.dark-mode .export-format-dialog .dialog-footer button {
    background-color: #555;
    color: #e0e0e0;
}

body.dark-mode .export-format-dialog .dialog-footer button:hover {
    background-color: #666;
}

/* 应用容器 */
.app-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    background-color: var(--global-bg-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

/* 设置内容区域样式 */
.settings-content {
    padding: 16px;
}

/* 设置项样式 */
.setting-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: white;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.setting-item:hover {
    background-color: #f5f5f5;
}

/* 深色模式下的设置项样式 */
body.dark-mode .setting-item {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .setting-item:hover {
    background-color: #4a4a4a;
}

/* 设置项图标样式 */
.setting-icon {
    width: 40px;
    height: 40px;
    background-color: #e0f2fe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: #0ea5e9;
    font-size: 20px;
}

/* 深色模式下的设置项图标样式 */
body.dark-mode .setting-icon {
    background-color: #1e3a8a;
    color: #93c5fd;
}

/* 设置项文本样式 */
.setting-text {
    flex: 1;
    font-size: 16px;
    color: #333;
}

/* 深色模式下的设置项文本样式 */
body.dark-mode .setting-text {
    color: #e0e0e0;
}

/* 设置项箭头样式 */
.setting-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 深色模式下的设置项箭头样式 */
body.dark-mode .setting-arrow {
    color: #777;
}

/* 记忆总结下拉菜单样式 */
.memory-summary-dropdown {
    position: relative;
    width: 90px;
    margin-left: auto;
    z-index: 110;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-selected:hover {
    background-color: #e8e8e8;
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.dropdown-selected.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background-color: white;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
    width: 100px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

.dropdown-options.show {
    max-height: 200px;
    opacity: 1;
    overflow: visible;
}

.dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 16px;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option:first-child {
    border-radius: 20px 20px 0 0;
}

.dropdown-option:last-child {
    border-radius: 0 0 20px 20px;
}

/* 深色模式下的下拉菜单样式 */
body.dark-mode .dropdown-selected {
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .dropdown-selected:hover {
    background-color: #555;
}

body.dark-mode .dropdown-arrow {
    color: #b0b0b0;
}

body.dark-mode .dropdown-options {
    background-color: #444;
    border: 1px solid #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .dropdown-option {
    color: #e0e0e0;
}

body.dark-mode .dropdown-option:hover {
    background-color: #555;
}

/* 短期对话下拉菜单样式 */
.short-term-chat-dropdown {
    position: relative;
    width: 90px;
    margin-left: auto;
    z-index: 100;
}

/* 调用数量输入框样式 */
.message-count-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

#message-count-input, #previous-day-messages-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
    text-align: center;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

#message-count-input:focus, #previous-day-messages-input:focus {
    border-color: #66afe9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 175, 233, 0.2);
}

.count-unit {
    font-size: 14px;
    color: #666;
}

/* 深色模式下的调用数量输入框样式 */
body.dark-mode #message-count-input, body.dark-mode #previous-day-messages-input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .count-unit {
    color: #b0b0b0;
}

/* 隐藏设置项样式 */
.hidden-setting {
    opacity: 0.8;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.hidden-setting.show {
    opacity: 1;
    transform: translateY(0);
}

/* 查看记忆按钮样式 */
.view-memory-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #e0f2fe;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 16px;
    color: #0ea5e9;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
}

/* Tokens显示样式 */
.tokens-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tokens-line:last-child {
    margin-bottom: 0;
}

.tokens-label {
    color: #666;
    font-size: 14px;
}

.tokens-value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.view-memory-button:hover {
    background-color: #bae6fd;
    border-color: #0ea5e9;
}

.view-memory-button i {
    font-size: 16px;
}

.view-memory-button span {
    font-size: 16px;
}

body.dark-mode .view-memory-button {
    background-color: #1e3a8a;
    border-color: #555;
    color: #93c5fd;
}

body.dark-mode .view-memory-button:hover {
    background-color: #1e40af;
    border-color: #93c5fd;
}

/* 顶栏 - 所有页面共用相同大小 */
.app-header {
    background-color: #f0f0f0;
    height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-left {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 聊天页面顶栏头像样式 */
.chat-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f0f0f0;
}

/* 好友信息弹出菜单样式 */
.friend-info-menu {
    position: absolute;
    top: 60px;
    left: 16px;
    width: 280px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

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

/* 菜单头部 */
.friend-info-menu-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

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

.friend-info-menu-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 菜单内容 */
.friend-info-menu-content {
    padding: 8px 0;
}

.friend-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.friend-info-label {
    font-size: 15px;
    color: #666;
}

.friend-info-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.friend-info-divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 0 16px;
}

/* 深色模式适配 */
body.dark-mode .friend-info-menu {
    background-color: #333;
}

body.dark-mode .friend-info-menu-header {
    border-bottom-color: #444;
}

body.dark-mode .friend-info-menu-name {
    color: #e0e0e0;
}

body.dark-mode .friend-info-label {
    color: #999;
}

body.dark-mode .friend-info-value {
    color: #e0e0e0;
}

body.dark-mode .friend-info-divider {
    background-color: #444;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.header-right {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
}

.header-icon {
    font-size: 20px;
    color: #333;
    margin-left: 16px;
}

/* 深色模式按钮 */
.theme-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode .app-container {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .app-header {
    background-color: #1e1e1e;
    border-bottom-color: #444;
}

body.dark-mode .header-title {
    color: #e0e0e0;
}

body.dark-mode .app-content {
    background-color: #2d2d2d;
}

body.dark-mode .home-page {
    background-color: #2d2d2d;
}

body.dark-mode .chat-list {
    background-color: #2d2d2d;
}

body.dark-mode .chat-item {
    background-color: #3d3d3d;
    border-bottom-color: #444;
}

body.dark-mode .chat-item:active {
    background-color: #3d3d3d;
}

body.dark-mode .chat-item-name {
    color: #e0e0e0;
}

body.dark-mode .chat-item-message {
    color: #b0b0b0;
}

body.dark-mode .chat-item-time {
    color: #808080;
}

body.dark-mode .chat-page {
    background-color: #2d2d2d;
}

body.dark-mode .chat-messages {
    background-color: #2d2d2d;
}

body.dark-mode .system-message span {
    background-color: rgba(255, 255, 255, 0.1);
    color: #808080;
}

body.dark-mode .message-received .message-bubble {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

body.dark-mode .message-received .message-bubble::after {
    background: #3d3d3d; /* 与气泡背景色一致 */
}

body.dark-mode .message-sent .message-bubble {
    background-color: #5dc95c;
    color: #333;
}

body.dark-mode .message-sent .message-bubble::after {
    background: #5dc95c; /* 与气泡背景色一致 */
    z-index: 0;
}

body.dark-mode .chat-input-area {
    background-color: #1e1e1e;
    border-top-color: #444;
    padding: 8px 16px 28px 16px;
}

body.dark-mode #message-input {
    background-color: #3d3d3d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode #send-button {
    background-color: #07c160;
}

body.dark-mode .app-footer {
    background-color: #1e1e1e;
    border-top-color: #444;
    height: 76px;
    align-items: flex-start;
    padding-top: 4px;
}

body.dark-mode .footer-item {
    color: #808080;
}

body.dark-mode .footer-item-active {
    color: #07c160;
}

body.dark-mode .coming-soon {
    color: #808080;
}

/* 版本号样式 */
.version-info {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    margin-top: auto;
    margin-bottom: 10px;
    font-weight: 500;
}

/* 深色模式下的版本号样式 */
body.dark-mode .version-info {
    color: #666;
}

/* 检测更新按钮样式 */
.check-update-button {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    margin: 0 auto;
}

.check-update-button:hover {
    background-color: #45a049;
}

.check-update-button:active {
    background-color: #3d8b40;
}

/* 深色模式下的检测更新按钮样式 */
body.dark-mode .check-update-button {
    background-color: #5c6bc0;
}

body.dark-mode .check-update-button:hover {
    background-color: #515daa;
}

body.dark-mode .check-update-button:active {
    background-color: #465298;
}

/* 主内容区域 */
.app-content {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* 添加好友页面样式 */
.add-friend-page {
    padding: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

.required {
    color: #e74c3c;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.input-group input {
    height: 44px;
}

.textarea-container {
    position: relative;
}

.input-group textarea {
    width: 100%;
    height: 160px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #999;
}

.save-button {
    padding: 8px 16px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.save-button:hover {
    background-color: #06b556;
}

/* 深色模式适配 */
body.dark-mode .add-friend-page .input-group label {
    color: #e0e0e0;
}

body.dark-mode .add-friend-page .input-group input,
body.dark-mode .add-friend-page .input-group textarea {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .add-friend-page .char-count {
    color: #808080;
}

/* 无头像样式 */
.no-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* 所有页面内容区域允许滚动 */
.home-page, .contacts-page, .moments-page, .profile-page, .add-friend-page {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* 查看记忆页面样式 */
.memory-content {
    width: 100%;
    height: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.memory-content .input-group {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.memory-content .input-group label {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.memory-content #memory-textarea {
    flex: 1;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    resize: none;
    background-color: #fff;
    color: #333;
    min-height: 300px;
}

/* 深色模式适配 */
body.dark-mode .memory-content .input-group label {
    color: #e0e0e0;
}

body.dark-mode .memory-content #memory-textarea {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}

/* 微信主页（对话列表） */
.home-page {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.chat-list {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    border-radius: 15px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 对话列表项 */
.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    cursor: pointer;
    position: relative;
}

/* 第一个对话项添加顶部圆角 */
.chat-item:first-child {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* 最后一个对话项添加底部圆角 */
.chat-item:last-child {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* 通讯录页面的好友列表 - 只显示头像和名字 */
.contacts-page .friends-list .chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

/* 深色模式下修改通讯录页面好友列表项背景色 */
body.dark-mode .contacts-page .friends-list .chat-item {
    background-color: #3d3d3d;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 通讯录功能按钮 */
.contacts-actions {
    padding: 8px;
    background-color: #F5F5F5;
    border-bottom: none;
}

/* 深色模式下的通讯录功能按钮背景 */
body.dark-mode .contacts-actions {
    background-color: #2D2D2D;
}

/* 通讯录功能按钮文本样式 - 与好友昵称大小一致 */
.contact-action-button .action-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 深色模式下的通讯录功能按钮文本 */
body.dark-mode .contact-action-button .action-text {
    color: #e0e0e0;
}

/* 通讯录首字母分组容器 - 自适应框效果 */
.friends-group-container {
    margin-bottom: 16px;
    border-radius: 15px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 通讯录首字母分组中的聊天项样式 - 完全融入容器 */
.friends-group-container .chat-item {
    border-radius: 0; /* 移除单个项的圆角 */
    margin-bottom: 0; /* 移除单个项的外边距 */
    box-shadow: none; /* 移除单个项的阴影 */
    background-color: #fff; /* 与容器背景色一致 */
    padding: 12px;
    width: 100%;
    border: none;
}

/* 分组中第一个聊天项 */
.friends-group-container .chat-item:first-child {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* 分组中最后一个聊天项 */
.friends-group-container .chat-item:last-child {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* 深色模式下的分组容器样式 */
body.dark-mode .friends-group-container {
    background-color: #3d3d3d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 深色模式下分组中的聊天项样式 */
body.dark-mode .friends-group-container .chat-item {
    background-color: #3d3d3d; /* 与容器背景色一致 */
}

/* 通讯录首字母分组标题样式 */
.group-header {
    background-color: transparent;
    padding: 4px 8px;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    border: none;
    margin: 4px 0;
}

/* 深色模式下的分组标题样式 */
body.dark-mode .group-header {
    color: #808080;
    background-color: transparent;
}

/* 通讯录好友列表容器样式调整 */
.friends-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* 深色模式下的通讯录好友列表容器 */
body.dark-mode .friends-list {
    background-color: #2d2d2d;
}

/* 主按钮容器 - 圆角矩形，与消息页面对话框样式一致 */
.contacts-main-button {
    width: 100%;
    background-color: #fff;
    border: none;
    border-radius: 15px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 内部按钮项 */
.contact-action-button {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.contacts-page .friends-list .chat-item-info {
    display: flex;
    align-items: center;
}

.chat-item:active {
    background-color: #f0f0f0;
}

/* 深色模式下修改主页聊天列表容器样式 */
body.dark-mode .chat-list {
    background-color: #2d2d2d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 深色模式下修改主页聊天列表项样式 */
body.dark-mode .chat-item {
    background-color: #3d3d3d;
}

body.dark-mode .chat-item:active {
    background-color: #444;
}

/* 通讯录好友列表项 - 微信风格 */
.contacts-page .friends-list {
    padding: 8px;
}

.contacts-page .friends-list .chat-item {
    padding: 8px 10px;
    border: none;
    border-radius: 15px;
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.contacts-page .friends-list .chat-item:active {
    background-color: #f5f5f5;
}

/* 统一头像大小 */
.chat-avatar, .chat-item-avatar, .message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.message-avatar {
    margin-right: 0;
    margin: 0 8px;
}

.chat-item-info {
    flex: 1;
    overflow: hidden;
    padding-right: 50px; /* 为时间戳留出空间 */
}

.chat-item-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.chat-item-message {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 12px;
    color: #999;
    position: absolute;
    top: 12px;
    right: 16px;
}

/* 通讯录页面不显示消息内容和时间 */
.contacts-page .friends-list .chat-item-message,
.contacts-page .friends-list .chat-item-time {
    display: none;
}

/* 添加好友页面样式 */
.add-friend-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    width: 100%;
}

.avatar-upload-section {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-preview-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ddd;
    cursor: pointer;
}

.avatar-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 10px;
}

.avatar-preview-container:hover .avatar-upload-overlay {
    opacity: 1;
}

.friend-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.input-section {
    width: 100%;
}

/* 输入框组样式 */
.input-group {
    width: 100%;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.char-warning {
    font-size: 12px;
    color: #e74c3c;
    margin-left: 8px;
}

/* 统一输入框样式 */
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #07c160;
}

/* 文本区域容器 */
.textarea-container {
    position: relative;
    width: 100%;
}

/* 字符计数样式 */
.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

/* 人设文本区域样式 */
.textarea-container textarea {
    width: 100%;
    min-height: 200px; /* 大约显示10行文字 */
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #fff;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.textarea-container textarea:focus {
    outline: none;
    border-color: #07c160;
}

.save-button {
    padding: 8px 16px;
    background-color: #07C160;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-button:hover {
    background-color: #06B158;
}

/* 删除按钮样式 */
.delete-button {
    padding: 8px;
    background-color: #ff3b30;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #d70015;
}

/* 深色模式下的删除按钮 */
body.dark-mode .delete-button {
    background-color: #ff453a;
}

body.dark-mode .delete-button:hover {
    background-color: #ff372a;
}

/* 深色模式适配 */
body.dark-mode .input-group label {
    color: #e0e0e0;
}

body.dark-mode .input-group input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .textarea-container textarea {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .avatar-preview-container {
    border-color: #555;
}

body.dark-mode .char-count {
    color: #808080;
}

/* 聊天页面 */
.chat-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 10px 8px; /* 减小内边距，上 右 下 左 */
    background-color: var(--global-bg-color);
}

/* 系统消息 */
.system-message {
    text-align: center;
    margin: 10px 0;
}

.system-message span {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 10px;
}

/* 简单编辑面板的全局样式 */
#simple-edit-panel {
    background-color: white !important; /* 确保浅色模式下使用白色实色背景 */
    border: 1px solid #ddd;
    opacity: 1 !important; /* 强制完全不透明 */
}

#simple-edit-panel textarea {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

/* 简单编辑面板的深色模式适配 */
body.dark-mode #simple-edit-panel {
    background-color: #333 !important; /* 深色模式下使用深灰色实色背景 */
    border-color: #555;
}

body.dark-mode #simple-edit-panel textarea {
    background-color: #444;
    border-color: #555;
}

/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 6px;
    align-items: flex-end;
    position: relative;
    transition: all 0.3s ease;
}

.message-received {
    justify-content: flex-start;
}

.message-sent {
    justify-content: flex-end;
}

/* 头像 */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 8px 0 8px;
    position: relative;
    bottom: -10px;
}

/* 头像占位符 - 用于连续消息中不显示头像的情况，保持布局一致性 */
.message-avatar-placeholder {
    width: 40px;
    height: 40px;
    margin: 0 8px 0 8px;
    position: relative;
    bottom: -10px;
}

/* 消息气泡样式 - 发送方 */
.message-sent .message-bubble {
    background-color: #5dc95c;
    border-radius: 16px;
    padding: 8px 14px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 70%;
    position: relative;
    color: #FFFFFF;
}

/* 发送方小尾巴（气泡箭头） */
.message-sent .message-bubble::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 0px;
    width: 20px;
    height: 20px;
    background: #5dc95c; /* 与气泡背景色一致 */
    clip-path: path('M-2,13 C4,6 -3,2 22,8 C6,13 6,12 1,19 Z');
    transform: rotate(-72deg) scaleX(0.7);
    z-index: 0;
}

/* 错误气泡样式 */
.error-bubble {
    color: #c62828 !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

.error-bubble:hover {
    background-color: rgba(255, 205, 210, 0.2) !important;
}

/* 错误消息重试链接样式 */
.error-retry-link {
    color: #ff4444;
    cursor: pointer;
    font-weight: 500;
}

.error-retry-link:hover {
    text-decoration: underline;
}

/* 错误消息取消链接样式 */
.error-cancel-link {
    color: #999;
    cursor: pointer;
}

.error-cancel-link:hover {
    color: #666;
    text-decoration: underline;
}

/* 深色模式下的错误气泡样式 */
body.dark-mode .error-bubble {
    color: #ff8a80 !important;
}

body.dark-mode .error-bubble:hover {
    background-color: rgba(109, 60, 60, 0.3) !important;
}

/* 深色模式下的错误消息链接样式 */
body.dark-mode .error-retry-link {
    color: #ff6b6b;
}

body.dark-mode .error-cancel-link {
    color: #aaa;
}

body.dark-mode .error-cancel-link:hover {
    color: #888;
}

/* 消息气泡样式 - 接收方 */
.message-received .message-bubble {
        word-break: break-word;
        white-space: normal;
    background-color: #E9E9EB;
    border-radius: 16px;
    padding: 8px 14px;
    word-wrap: break-word;
    max-width: 70%;
    position: relative;
    color: #000000;
}

/* 接收方小尾巴（气泡箭头） */
.message-received .message-bubble::after {
    content: "";
    position: absolute;
    left: -10.6px;
    bottom: -3px;
    width: 20px;
    height: 16px;
    background: #E9E9EB; /* 与气泡背景色一致 */
    clip-path: path('M13,4 C17,-1 1,2 0,29 C20,2 21,39 12,10 Z');
    transform: rotate(-153deg) scaleX(0.8);
}

/* 取消小尾巴样式 */
.message-bubble.no-tail::after {
    display: none !important;
}

.message-bubble.no-tail {
    border-bottom-right-radius: 16px !important;
    border-bottom-left-radius: 16px !important;
}

.message-content {
    font-size: 16px;
    line-height: 1.4;
}

/* 消息引用样式 */
.message-quote {
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #007AFF;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 0 8px 8px 0;
    position: relative;
}

/* 输入框上方的引用预览样式 */
.quote-preview-container {
    width: 100%;
    margin-bottom: 8px;
    padding: 0 10px;
    box-sizing: border-box;
}

.input-quote-preview {
    margin-bottom: 0;
}

.remove-quote-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    background-color: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.remove-quote-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 深色模式下的移除引用按钮 */
body.dark-mode .remove-quote-button {
    color: #666;
}

body.dark-mode .remove-quote-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.quote-sender {
    font-size: 12px;
    font-weight: 600;
    color: #007AFF;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.quote-sender-name {
    font-weight: 600;
    margin-right: 8px;
}

.quote-text {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
}

.quote-timestamp {
    font-size: 11px;
    color: #999;
    font-weight: normal;
}

/* 深色模式下的消息引用样式 */
body.dark-mode .message-quote {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #409EFF;
}

body.dark-mode .quote-sender {
    color: #409EFF;
}

body.dark-mode .quote-text {
    color: #666;
}

body.dark-mode .quote-timestamp {
    color: #555;
}

/* 正在思考*/
.typing-indicator {
    display: flex;
    align-items: flex-end;
}

.typing-indicator .message-bubble {
    background-color: #E9E9EB;
    border-radius: 16px;
    padding: 8px 14px;
    position: relative;
    color: #000000;
}

.typing-indicator .message-bubble::after {
    content: "";
    position: absolute;
    left: -10.6px;
    bottom: -3px;
    width: 20px;
    height: 16px;
    background: #E9E9EB; /* 与气泡背景色一致 */
    clip-path: path('M13,4 C17,-1 1,2 0,29 C20,2 21,39 12,10 Z');
    transform: rotate(-153deg) scaleX(0.8);
}

.typing-dots {
    display: flex;
    align-items: center;
    height: 17px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* 输入区域 */
.chat-input-area {
    background-color: #f0f0f0;
    padding: 8px 16px 28px 16px; /* 增加底部内边距20px，使元素上移 */
    border-top: 1px solid #e0e0e0;
}

.input-container {
    display: flex;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    background-color: #fff;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.4;
    font-family: inherit;
    overflow: hidden;
    transition: border-radius 0.2s ease;
    /* 隐藏滚动条但保留滚动功能 */
    scrollbar-width: none; /* Firefox */
}

/* Chrome, Safari, Edge 隐藏滚动条 */
#message-input::-webkit-scrollbar {
    display: none;
}

/* 单行文字时的纯圆样式将通过JavaScript动态添加 */

#send-button, .feature-button {
    margin-left: 8px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#send-button:hover, .feature-button:hover {
    background-color: #e0e0e0;
}

#send-button:active, .feature-button:active {
    background-color: #d0d0d0;
}

/* 深色模式下的功能按钮样式 */
body.dark-mode #send-button,
body.dark-mode .feature-button {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode #send-button:hover,
body.dark-mode .feature-button:hover {
    background-color: #4d4d4d;
    border-color: #555;
}

body.dark-mode #send-button:active,
body.dark-mode .feature-button:active {
    background-color: #5d5d5d;
    border-color: #666;
}

/* 隐藏滚动条但保留滚动功能 */
.chat-messages,
.chat-list,
.home-page,
.contacts-page,
.moments-page,
.profile-page,
.add-friend-page {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.chat-messages::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.home-page::-webkit-scrollbar,
.contacts-page::-webkit-scrollbar,
.moments-page::-webkit-scrollbar,
.profile-page::-webkit-scrollbar,
.add-friend-page::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 底栏导航 */
.app-footer {
    height: 76px; /* 增加高度，为元素上移提供空间 */
    background-color: #f0f0f0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    align-items: flex-start; /* 改为顶部对齐，让元素上移 */
    padding-top: 4px; /* 保持顶部有一点内边距 */
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    cursor: pointer;
    color: #666;
    margin-top: 0; /* 确保元素紧贴顶部 */
}

.footer-item-active {
    color: #07c160;
}

.footer-icon {
    margin-bottom: 4px;
}

.footer-text {
    font-size: 12px;
}

/* 返回按钮 */
.back-button {
    font-size: 16px;
    color: #333;
    margin-right: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode .back-button {
    color: #e0e0e0;
}

/* 消息菜单样式 */
.message-menu {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    z-index: 1000;
    height: 20px;
    animation: menuFadeIn 0.2s ease;
}

.message-menu-item {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: all 0.2s ease;
}

.message-menu-item:hover {
    color: #07c160;
    transform: scale(1.1);
}

.message-menu-item:active {
    background-color: rgba(0, 0, 0, 0.05);
}

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

/* 多选模式样式 */
.message-with-select {
    position: relative;
    padding-left: 30px;
    transition: padding-left 0.3s ease;
}

.message-select-circle {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-select-circle:hover {
    border-color: #007AFF;
}

.message-select-circle.selected {
    background-color: #007AFF;
    border-color: #007AFF;
}

.message-select-circle.selected::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.message-selected {
    background-color: rgba(0, 122, 255, 0.05);
}

/* 顶栏按钮样式 */
.header-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: #007AFF;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

.header-button:hover:not(:disabled) {
    background-color: rgba(0, 122, 255, 0.1);
}

.header-button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* 深色模式下的消息菜单样式 */
body.dark-mode .message-menu-item {
    color: #e0e0e0;
}

body.dark-mode .message-menu-item:hover {
    color: #07c160;
}

/* 深色模式下的多选样式 */
body.dark-mode .message-with-select {
    padding-left: 30px;
}

body.dark-mode .message-select-circle {
    background-color: #333;
    border-color: #666;
}

body.dark-mode .message-select-circle:hover {
    border-color: #0A84FF;
}

body.dark-mode .message-select-circle.selected {
    background-color: #0A84FF;
    border-color: #0A84FF;
}

body.dark-mode .message-selected {
    background-color: rgba(10, 132, 255, 0.1);
}

body.dark-mode .header-button {
    color: #0A84FF;
}

body.dark-mode .header-button:hover:not(:disabled) {
    background-color: rgba(10, 132, 255, 0.1);
}

body.dark-mode .back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 对话设置按钮 */
.chat-settings-button {
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-settings-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 查找聊天记录按钮 */
.search-chat-button {
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    margin-right: 8px;
}

.search-chat-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode .chat-settings-button {
    color: #e0e0e0;
}

body.dark-mode .chat-settings-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .search-chat-button {
    color: #e0e0e0;
}

body.dark-mode .search-chat-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 查找聊天记录覆盖层 */
.search-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background-color: #F0F0F0;
}

body.dark-mode .search-chat-overlay {
    background-color: #1E1E1E;
}

/* 搜索输入框容器 */
.search-chat-input-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #F0F0F0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    padding: 8px 0;
}

.search-chat-input-wrapper {
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.search-chat-back-button {
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-chat-back-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#search-chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    background-color: #f5f5f5;
    margin-right: 8px;
}

#search-chat-input:focus {
    border-color: #07c160;
    background-color: #fff;
}

.search-chat-clear-button {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-chat-clear-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 搜索结果菜单 */
.search-results-menu {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.search-results-container {
    padding: 16px;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.search-no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.search-no-results p {
    font-size: 16px;
    margin: 0;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-message {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.search-result-time {
    font-size: 12px;
    color: #999;
}

.search-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* 深色模式下的查找聊天记录样式 */
body.dark-mode .search-chat-input-container {
    background-color: #1E1E1E;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-chat-back-button {
    color: #e0e0e0;
}

body.dark-mode .search-chat-back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #search-chat-input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode #search-chat-input:focus {
    border-color: #07c160;
    background-color: #444;
}

body.dark-mode .search-chat-clear-button {
    color: #999;
}

body.dark-mode .search-chat-clear-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .search-results-menu {
    background-color: rgba(45, 45, 45, 0.9);
}

body.dark-mode .search-result-item {
    background-color: #3d3d3d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-result-item:hover {
    background-color: #4d4d4d;
}

body.dark-mode .search-result-message {
    color: #e0e0e0;
}

body.dark-mode .search-result-time {
    color: #999;
}

body.dark-mode .search-highlight {
    background-color: rgba(255, 235, 59, 0.2);
}

/* 搜索结果高亮效果 */
.search-highlighted-message {
    background-color: rgba(7, 193, 96, 0.2);
}

/* 时间输入框样式 */
.time-inputs {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

/* 延迟提示样式 */
.delay-notice {
    text-align: center;
    padding: 8px 16px;
    margin: 8px auto;
    background-color: #f0f2f5;
    border-radius: 16px;
    color: #666;
    font-size: 12px;
    max-width: 60%;
}

/* 深色模式下的延迟提示样式 */
body.dark-mode .delay-notice {
    background-color: #333;
    color: #ccc;
}

/* 等我说完再回复功能样式 */
.wait-reply-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

#wait-reply-time {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 16px;
    text-align: center;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

#wait-reply-time:focus {
    border-color: #66afe9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 175, 233, 0.2);
}

.time-unit {
    font-size: 14px;
    color: #666;
}

/* 开关按钮样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 深色模式适配 */
body.dark-mode #wait-reply-time {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .time-unit {
    color: #b0b0b0;
}

body.dark-mode .slider {
    background-color: #555;
}

body.dark-mode input:checked + .slider {
    background-color: #1976D2;
}

.time-inputs input[type="time"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
}

body.dark-mode .time-inputs input[type="time"] {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .app-container {
        width: 100%;
        max-width: none;
    }
    
    .message-bubble {
        max-width: 75%;
        word-break: break-word;
        white-space: normal;
    }
    
    .time-inputs {
        flex-direction: column;
        gap: 8px;
        margin-top: 8px;
        margin-left: 0;
    }
}

/* 功能即将开放样式 */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.coming-soon-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.7;
}

.coming-soon-text {
    font-size: 18px;
    font-weight: 500;
}

/* 空状态样式 */
.empty-chat-list, .empty-contacts-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
    color: #bbb;
}

/* 通讯录页面样式 */
.contacts-page {
    padding: 8px;
    background-color: #f5f5f5;
}

/* 深色模式下的通讯录页面 */
body.dark-mode .contacts-page {
    background-color: #2d2d2d;
}

/* 通讯录功能按钮 */
.contacts-actions {
    padding: 0 8px;
    background-color: #F5F5F5;
    border-bottom: none;
}

/* 主按钮容器 - 圆角矩形 */
.contacts-main-button {
    width: 100%;
    background-color: #fff;
    border: none;
    border-radius: 15px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 内部按钮项 */
.contact-action-button {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 15px;
}

.contact-action-button:hover {
    background-color: #f5f5f5;
}

/* 圆形图标样式 - 与头像大小一致 */
.action-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 20px;
}

/* 每个按钮的特定颜色 */
#add-friend-button .action-icon-container {
    background-color: #FF7A45;
}

#group-chat-button .action-icon-container {
    background-color: #52C41A;
}

/* 好友资料页面样式 */
.friend-profile-page {
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* 好友资料头部 */
.friend-profile-header {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 好友头像容器 */
.friend-avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 20px;
    border: 2px solid #ddd;
    background-color: #f5f5f5;
}

/* 好友头像 */
#friend-profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 好友基本信息 */
.friend-basic-info {
    flex: 1;
}

/* 好友姓名 */
.friend-profile-name {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* 好友ID */
.friend-profile-id {
    font-size: 14px;
    color: #999;
}

/* 详细资料区域 */
.friend-detail-info {
    margin: 20px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 资料项 */
.info-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 最后一个资料项无边框 */
.info-item:last-child {
    border-bottom: none;
}

/* 资料标签 */
.info-label {
    width: 100px;
    font-size: 16px;
    color: #666;
}

/* 资料值 */
.info-value {
    flex: 1;
    font-size: 16px;
    color: #333;
}

/* 多行资料值 */
.info-value-multiline {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 操作按钮区域 */
.friend-profile-actions {
    margin-top: 30px;
}

/* 操作按钮 */
.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 主要按钮 */
.primary-button {
    background-color: #07c160;
    color: white;
}

.primary-button:hover {
    background-color: #06b158;
}

/* 次要按钮 */
.secondary-button {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.secondary-button:hover {
    background-color: #f5f5f5;
}

/* 按钮图标 */
.action-button i {
    margin-right: 8px;
}

/* 深色模式适配 */
body.dark-mode .friend-profile-header {
    border-bottom-color: #444;
}

body.dark-mode .friend-avatar-container {
    border-color: #555;
    background-color: #3d3d3d;
}

body.dark-mode .friend-profile-name {
    color: #e0e0e0;
}

body.dark-mode .friend-profile-id {
    color: #808080;
}

body.dark-mode .friend-detail-info {
    background-color: #3d3d3d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .info-item {
    border-bottom-color: #444;
}

body.dark-mode .info-label {
    color: #808080;
}

body.dark-mode .info-value {
    color: #e0e0e0;
}

body.dark-mode .secondary-button {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .secondary-button:hover {
    background-color: #444;
}

#create-group-button .action-icon-container {
    background-color: #1890FF;
}

/* 深色模式适配 */
.dark-mode .contacts-main-button {
    background-color: #3d3d3d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .contact-action-button {
    background-color: #3d3d3d;
}

.dark-mode .contact-action-button:hover {
    background-color: #444;
}

/* 确保所有相关按钮样式统一 */
.dark-mode #add-friend-button,
.dark-mode #group-chat-button,
.dark-mode #create-group-button {
    background-color: #3d3d3d;
}

/* 深色模式下通讯录列表背景 */
.dark-mode .friends-list {
    background-color: #2d2d2d;
}

/* 深色模式下个人资料背景 */
.dark-mode .profile-info {
    background-color: #333;
    border-bottom-color: #555;
}

.dark-mode .profile-menu {
    background-color: #333;
}

.dark-mode .profile-menu-item {
    border-bottom-color: #444;
}



.action-text {
    font-size: 12px;
    color: #333;
}

/* 深色模式适配 */
.dark-mode .action-text {
    color: #e0e0e0;
}

.dark-mode .action-icon {
    color: #8a9abc;
}

.dark-mode .action-text {
    color: #e0e0e0;
}

.dark-mode .action-icon {
    color: #8a9abc;
}

/* 个人资料页面样式 */
.profile-page {
    width: 100%;
    height: 100%;
    background-color: var(--global-bg-color);
}

/* 个人信息部分 */
.profile-info {
    display: flex;
    align-items: center;
    padding: 24px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.profile-avatar-container {
    position: relative;
    margin-right: 16px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.profile-avatar:hover {
    opacity: 0.9;
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.profile-id {
    font-size: 14px;
    color: #999;
}

/* 功能菜单 */
.profile-menu {
    margin-top: 16px;
    background-color: #fff;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-menu-item:active {
    background-color: #f5f5f5;
}

.menu-item-left {
    display: flex;
    align-items: center;
}

.menu-icon {
    font-size: 18px;
    color: #333;
    margin-right: 16px;
    width: 18px;
    text-align: center;
}

.menu-item-text {
    font-size: 16px;
    color: #333;
    text-align: left;
}

.menu-arrow {
    font-size: 14px;
    color: #ccc;
}

/* 设置页面样式 */
.settings-page {
    width: 100%;
    height: 100%;
    background-color: var(--global-bg-color);
}

/* API设置页面样式 */
.api-settings-page {
    padding: 15px;
}

.api-parameters-container {
    margin-top: 20px;
}

.parameter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.parameter-input {
    flex: 1;
    margin-bottom: 0;
}

.parameter-input label {
    font-size: 14px;
    margin-bottom: 8px;
}

.parameter-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 深色模式适配 */
body.dark-mode .parameter-input input {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

.settings-section {
    margin-top: 16px;
    background-color: #fff;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.settings-item:active {
    background-color: #f5f5f5;
}

/* 深色模式下的个人资料和设置页面样式 */
body.dark-mode .profile-page {
    background-color: #2d2d2d;
}

body.dark-mode .profile-info {
    background-color: #1e1e1e;
    border-bottom-color: #444;
}

body.dark-mode .profile-name {
    color: #e0e0e0;
}

body.dark-mode .profile-id {
    color: #808080;
}

body.dark-mode .profile-menu {
    background-color: #1e1e1e;
}

body.dark-mode .profile-menu-item {
    border-bottom-color: #333;
}

body.dark-mode .profile-menu-item:active {
    background-color: #333;
}

body.dark-mode .menu-icon {
    color: #e0e0e0;
    width: 18px;
    text-align: center;
}

body.dark-mode .menu-item-text {
    color: #e0e0e0;
    text-align: left;
}

body.dark-mode .menu-arrow {
    color: #666;
}

body.dark-mode .settings-page {
    background-color: #2d2d2d;
}

body.dark-mode .settings-section {
    background-color: #1e1e1e;
}

body.dark-mode .settings-item {
    border-bottom-color: #333;
}

body.dark-mode .settings-item:active {
    background-color: #333;
}

/* 连续消息样式 - 控制同一个人连续消息之间的间距 */
.message.consecutive {
    margin-bottom: 2px;
}

/* 深色模式下的连续消息样式 */
body.dark-mode .message.consecutive {
    margin-bottom: 2px;
}

/* 确保连续消息气泡之间保持稳定边缘间距 */
.message.consecutive + .message.consecutive {
    margin-top: 2px;
}

/* 调整连续消息气泡的样式，确保间距是基于气泡边缘的 */
.message.consecutive .message-bubble {
    margin-bottom: 1px;
}

/* 连续消息中隐藏头像但保留占位符空间 */
.message.consecutive .message-avatar {
    display: none;
}
.message.consecutive .message-avatar-placeholder {
    visibility: hidden;
    /* 保持占位符的空间占用，确保气泡起点一致 */
}

/* 长按菜单相关样式已移除 */

/* 确保消息内容在选择模式下可选中 */
.message-content {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}