/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #FEFEFE;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 主容器 - 用于页面堆叠和过渡 */
.main-container {
    position: relative;
    height: 100vh;
    padding-bottom: 50px; /* 留出底部导航空间 */
}

/* 页面通用样式 */
.contact-list-page,
.chat-page,
.moments-page,
.profile-page,
.weibo-page,
.data-management-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.2s ease-out;
    background-color: #FEFEFE; /* 统一背景色 */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 允许页面内容滚动 */
    -webkit-overflow-scrolling: touch;
    will-change: transform, opacity;
}

/* 当前激活的页面 */
.contact-list-page.active,
.chat-page.active,
.moments-page.active,
.profile-page.active,
.weibo-page.active,
.data-management-page.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 10; /* 确保活动页面在最上层 */
}

/* 聊天页面特定样式（移除旧的过渡） */
.chat-page {
    bottom: 50px; /* 保持在导航栏之上 */
    height: auto; /* 覆盖上面的 height: 100% */
    z-index: 50; /* 聊天页面层级稍高 */
}

/* 联系人列表页面特定样式 */
.contact-list-page {
    background-color: #FEFEFE;
}

.wechat-header {
    background-color: #768E69;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0 !important;
}

.header-title {
    font-size: 17px;
    font-weight: 500;
    color: #EEEEEE;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    color: white;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 20px;
}

.header-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #EEEEEE;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease-out;
    padding: 2px;
}

.header-icon:hover {
    background-color: rgba(238, 238, 238, 0.15);
    transform: scale(1.05);
}

.header-icon svg {
    width: 20px;
    height: 20px;
}

.search-bar {
    padding: 8px 15px;
    margin-top: -6px !important; /* 整体上移一点 */
    background-color: #768E69;
    border-top: 0 !important;
}

.search-input {
    width: 100%;
    height: 36px;
    background-color: #EEEEEE;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #DCCFC0;
    background-color: #FEFEFE;
    box-shadow: 0 0 0 2px rgba(220, 207, 192, 0.2);
}

/* 联系人项目 */
.contact-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background-color: #FEFEFE;
    border-bottom: 0.5px solid #E5E7EB;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease-out;
    border-radius: 0;
}

.contact-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.contact-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-bottom: none;
}

.contact-item:hover {
    background-color: #F8F9FA;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-item:active {
    background-color: #768E69;
    color: #EEEEEE;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-right: 14px;
    background-color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.2);
    transition: all 0.2s ease;
}

.contact-avatar:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.2);
}

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

.contact-info {
    flex: 1;
    overflow: hidden;
}

.contact-name {
    font-size: 17px;
    color: #000;
    margin-bottom: 4px;
}

.contact-message {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-time {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 12px;
    color: #b2b2b2;
}

/* 聊天页面 */
.chat-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background-color: #FEFEFE;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden; /* 防止记忆面板溢出 */
}

.chat-page.active {
    /* This is now handled by the global .active class */
}

.chat-header {
    background-color: #768E69;
    padding: 10px 15px; /* 调整了padding-top */
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid #DCCFC0;
    flex-shrink: 0;
    position: relative;
    z-index: 3; /* 提高header层级 */
}

/* 调整聊天页面和相关页面的顶部内边距 */
.chat-header, .moments-header, .weibo-header, .profile-page .chat-header {
     padding-top: 10px;
}

.memory-panel-header {
    padding-top: 10px;
}


.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 17px;
    color: #EEEEEE;
    cursor: pointer;
}

.chat-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 17px;
    font-weight: 500;
    color: #EEEEEE;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-more, .memory-btn {
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.chat-more:hover, .memory-btn:hover {
    background-color: rgba(238, 238, 238, 0.15);
    transform: scale(1.05);
}

.chat-more svg, .memory-btn svg {
    width: 20px;
    height: 20px;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    scroll-behavior: smooth;
}

.message-timestamp {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 0 auto 15px;
    padding: 2px 8px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
    display: inline-block;
    left: 50%;
    position: relative;
    transform: translateX(-50%);
}

.message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin: 0 10px;
    background-color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(118, 142, 105, 0.2);
    transition: all 0.2s ease;
}

.message-avatar:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.2);
}

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

.message-bubble {
    max-width: 70%;
    position: relative;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.15s ease;
}

.message-content:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.message.received .message-content {
    background-color: #EEEEEE;
    color: #000;
}

.message.sent .message-content {
    background-color: #DCCFC0;
    color: #000;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border-style: solid;
}

.message.received .message-content::before {
    left: -5px;
    border-width: 6px 6px 6px 0;
    border-color: transparent #EEEEEE transparent transparent;
}

.message.sent .message-content::before {
    right: -5px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #DCCFC0;
}

.message-emoji {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    display: block;
}

.message-content.red-packet {
    background-color: #768E69;
    color: #EEEEEE;
    padding: 0;
    width: 240px;
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
}

.red-packet-body {
    display: flex;
    align-items: center;
    padding: 12px;
}

.red-packet-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.red-packet-text {
    flex: 1;
}

.red-packet-text div:first-child {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
}

.red-packet-text div:last-child {
    font-size: 14px;
}

.red-packet-footer {
    background-color: #DCCFC0;
    color: #768E69;
    font-size: 12px;
    padding: 4px 12px;
    border-top: 0.5px solid rgba(0,0,0,0.05);
}

.message.sent .message-content.red-packet::before,
.message.received .message-content.red-packet::before {
    border-color: transparent transparent transparent #768E69;
}

.message.received .message-content.red-packet::before {
     border-color: transparent #768E69 transparent transparent;
}

/* 输入区域 */
.chat-input-area {
    background-color: #EEEEEE;
    border-top: 0.5px solid #DCCFC0;
    padding: 8px 10px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    background-color: #DCCFC0;
    color: #768E69;
    transition: all 0.15s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-btn:hover {
    background-color: #768E69;
    color: #EEEEEE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.25);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 14px;
    border: 2px solid transparent;
    border-radius: 12px;
    background-color: #EEEEEE;
    font-size: 16px;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input:focus {
    border-color: #768E69;
    background-color: #FEFEFE;
    box-shadow: 0 0 0 3px rgba(118, 142, 105, 0.15);
}

.send-btn {
    padding: 10px 18px;
    background-color: #768E69;
    color: #EEEEEE;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.3);
}

.send-btn:hover {
    background-color: #5a6b52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.3);
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.3);
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 记忆表格面板 */
.memory-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #EEEEEE;
    z-index: 4;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.memory-panel.active {
    transform: translateY(0);
}

.memory-panel-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #768E69;
    border-bottom: 0.5px solid #DCCFC0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.memory-panel-title {
    font-size: 17px;
    font-weight: 500;
    color: #EEEEEE;
}

.memory-panel-actions {
    display: flex;
    gap: 15px;
}

.memory-panel-btn {
    font-size: 16px;
    color: #EEEEEE;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.memory-panel-btn:active {
    color: #DCCFC0;
}

.memory-panel-content {
    padding: 15px;
    background-color: #EEEEEE;
}

.memory-textarea {
    width: 100%;
    height: calc(100vh - 150px);
    border: 1px solid #DCCFC0;
    border-radius: 4px;
    outline: none;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: #EEEEEE;
    color: #333;
    padding: 10px;
}

/* --- 简洁现代风格记忆表格 --- */
.memory-table-view {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #333;
    line-height: 1.6;
}

.memory-table-view h1,
.memory-table-view h2,
.memory-table-view h3,
.memory-table-view h4 {
    font-weight: 600;
    color: #111;
    margin-top: 24px;
    margin-bottom: 16px;
}

.memory-table-view h1 { font-size: 1.5em; }
.memory-table-view h2 { font-size: 1.3em; }
.memory-table-view h3 { font-size: 1.1em; }
.memory-table-view h4 { font-size: 1em; }

.memory-table-view p {
    margin-bottom: 16px;
}

.memory-table-view ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.memory-table-view table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    background-color: #EEEEEE;
    border-radius: 8px;
    overflow: hidden; /* 确保圆角生效 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.memory-table-view th,
.memory-table-view td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0; /* 水平分割线 */
}

.memory-table-view th {
    background-color: #DCCFC0;
    font-weight: 600;
    color: #333;
}

.memory-table-view tr:last-child th,
.memory-table-view tr:last-child td {
    border-bottom: none;
}

.memory-table-view hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 24px 0;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #EEEEEE;
    border-top: 0.5px solid #DCCFC0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease-out;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 0.2s ease;
}

.nav-item.active .nav-icon {
    color: #768E69;
    transform: scale(1.05);
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

.nav-text {
    font-size: 10px;
    color: #999;
}

.nav-item.active .nav-text {
    color: #768E69;
}

/* 朋友圈页面 */
.moments-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background-color: #FEFEFE;
    display: flex;
    flex-direction: column;
    z-index: 120;
}

.moments-page.active {
    /* This is now handled by the global .active class */
}

.moments-header {
    background-color: #768E69;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid #DCCFC0;
    flex-shrink: 0;
}

.moments-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.moments-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.moments-empty-icon {
    margin-bottom: 18px;
    color: #768E69;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background-color: rgba(118, 142, 105, 0.1);
    margin: 0 auto 18px;
}

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

.moments-empty-btn {
    background-color: #768E69;
    color: #EEEEEE;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.3);
}

.moments-empty-btn:hover {
    background-color: #5a6b52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.3);
}

.moments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.moment-item {
    background-color: #EEEEEE;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    border: 1px solid #DCCFC0;
}

.moment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(118, 142, 105, 0.15);
    border-color: #768E69;
}

.moment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.moment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-right: 12px;
    background-color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    font-size: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.2);
    transition: all 0.2s ease;
}

.moment-avatar:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.2);
}

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

.moment-info {
    flex: 1;
}

.moment-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

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

.moment-content {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.moment-image {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 发布朋友圈模态框 */
.publish-moment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
}

.publish-moment-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #EEEEEE;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid #DCCFC0;
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.publish-moment-header {
    padding: 15px;
    border-bottom: 0.5px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.publish-moment-title {
    font-size: 17px;
    font-weight: 500;
}

.publish-moment-close {
    font-size: 14px;
    color: #768E69;
    cursor: pointer;
}

.publish-moment-body {
    padding: 15px;
}

.generate-moment-section {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.generate-moment-btn {
    background-color: #768E69;
    color: #EEEEEE;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

.generate-moment-hint {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.moment-preview {
    display: none;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
}

.moment-preview-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.moment-preview-content {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.moment-preview-image {
    width: 100%;
    max-width: 200px;
    border-radius: 8px;
}

.unsplash-key-section {
    margin-bottom: 20px;
}

.unsplash-key-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.unsplash-key-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

.unsplash-key-input:focus {
    border-color: #768E69;
}

.publish-moment-submit {
    width: 100%;
    padding: 12px;
    background-color: #768E69;
    color: #EEEEEE;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.publish-moment-submit:active {
    background-color: #5a6b52;
}

.publish-moment-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #EEEEEE;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid #DCCFC0;
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    0% {
        transform: translateY(100%) scale(0.95);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) scale(1.02);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px;
    border-bottom: 0.5px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 17px;
    font-weight: 500;
}

.modal-close {
    font-size: 14px;
    color: #768E69;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 15px;
    text-align: right;
    border-top: 1px solid #eee;
}

/* Specific styles for the Update Modal to make it scrollable */
#updateModal .modal-body {
    max-height: 60vh; /* Limit height to 60% of the viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
    padding-right: 20px; /* Add some space for the scrollbar */
}

#updateModal .modal-footer {
    display: none; /* Initially hide the footer */
}

#updateModal .modal-footer.visible {
    display: block; /* Show the footer when it has the 'visible' class */
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-size: 14px;
    color: #000;
    margin-bottom: 8px;
    display: block;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #DCCFC0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background-color: #EEEEEE;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    border-color: #768E69;
    background-color: #FEFEFE;
    box-shadow: 0 0 0 3px rgba(118, 142, 105, 0.15);
    transform: translateY(-1px);
}



.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.api-key-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.api-key-input {
    flex: 1;
}

.timeout-group {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #F8F9FA;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
    min-width: 120px;
}

.timeout-group:hover {
    border-color: #768E69;
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.1);
}

.timeout-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.timeout-input {
    width: 44px;
    padding: 4px 6px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    text-align: center;
    color: #374151;
}



.timeout-unit {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.form-submit {
    width: 100%;
    padding: 14px;
    background-color: #768E69;
    color: #EEEEEE;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.3);
}

.form-submit:hover {
    background-color: #5a6b52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.3);
}

.form-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.3);
}

/* 表情面板 */
.emoji-panel {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background-color: #EEEEEE;
    border-top: 0.5px solid #DCCFC0;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
}

.emoji-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #DCCFC0;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.emoji-item:active {
    background-color: #e5e5e5;
}

.emoji-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emoji-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.emoji-item:hover .emoji-delete-btn {
    display: flex;
}

.add-emoji-btn {
    grid-column: span 4;
    padding: 10px;
    background-color: #DCCFC0;
    border: 1px dashed #768E69;
    border-radius: 8px;
    color: #768E69;
    text-align: center;
    cursor: pointer;
}

/* 设置菜单 */
.settings-menu {
    display: none;
    position: fixed;
    top: 50px; /* 调整位置 */
    right: 10px;
    background-color: #4c4c4c;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 120px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1500;
}

.settings-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #4c4c4c;
}

.menu-item {
    padding: 10px 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.menu-item:active {
    background-color: #3c3c3c;
}

/* 新增删除选项的样式 */
.menu-item.delete-item {
    color: #ff4444; /* 红色字体 */
}

.menu-item.delete-item:active {
    background-color: #8b0000; /* 深红色背景 */
}

/* 正在输入指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-indicator-container {
    animation: fadeIn 0.3s ease;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 3000;
    display: none;
}

.toast.show {
    display: block;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* 顶部提示 */
.top-notification {
    position: fixed;
    top: 20px; /* 调整位置 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 3000;
    display: none;
}

.top-notification.show {
    display: block;
    animation: slideDown 1.5s ease;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 模型列表 */
.model-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-top: 10px;
}

.model-item {
    padding: 12px;
    border-bottom: 0.5px solid #e5e5e5;
    cursor: pointer;
    font-size: 14px;
}

.model-item:last-child {
    border-bottom: none;
}

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

.model-item.selected {
    background-color: rgba(118, 142, 105, 0.1);
    color: #768E69;
}


.loading-text {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 提示词管理 */
.prompt-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.prompt-title {
    font-size: 14px;
    font-weight: 500;
}

.prompt-actions {
    display: flex;
    gap: 10px;
}

.prompt-btn {
    padding: 5px 10px;
    background-color: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.prompt-btn:active {
    background-color: #e5e5e5;
}

.file-input {
    display: none;
}

/* 美化文件上传组件 */
input[type="file"] {
    padding: 10px 14px;
    border: 2px dashed #D1D5DB;
    border-radius: 8px;
    background: #F9FAFB;
    font-size: 14px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="file"]:hover {
    border-color: #768E69;
    background: #F0FDF4;
    color: #374151;
}

input[type="file"]:focus {
    outline: none;
    border-color: #768E69;
    box-shadow: 0 0 0 3px rgba(118, 142, 105, 0.1);
}

/* 个人信息页面 */
.profile-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background-color: #FEFEFE;
    z-index: 150;
    overflow-y: auto;
}

.profile-page.active {
    /* This is now handled by the global .active class */
}

.profile-header {
    background-color: #FEFEFE;
    padding: 20px 15px; /* 调整内边距 */
    text-align: center;
    border-bottom: 10px solid #F8F9FA;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 auto 15px;
    background-color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    font-size: 32px;
    overflow: hidden;
}

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

.profile-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 5px;
}

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

.profile-section {
    background-color: #EEEEEE;
    margin-bottom: 10px;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 0.5px solid #e5e5e5;
    cursor: pointer;
}

.profile-item:last-child {
    border-bottom: none;
}

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

.profile-item-label {
    flex: 1;
    font-size: 16px;
}

.profile-item-value {
    color: #999;
    font-size: 14px;
    margin-right: 5px;
}

.profile-item-arrow {
    color: #c7c7c7;
}

.feature-hint {
    position: absolute;
    bottom: 60px;
    right: 15px;
    background: #768E69;
    color: #EEEEEE;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 12px;
    z-index: 150;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(1.1) rotate(0deg); }
    75% { transform: scale(1.05) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* 新增动画效果 */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 改进的按钮悬停效果 */
.send-btn:hover {
    background-color: #5a9fd4;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 联系人项目悬停效果 */
.contact-item:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
    transition: all 0.2s ease;
}

/* 导航项目动画 */
.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateY(-2px);
    background-color: rgba(255,255,255,0.1);
}

.nav-item.active {
    animation: pulse 0.3s ease;
}

/* 模态框动画 */
.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideInRight 0.3s ease;
}

/* 消息动画 */
.message {
    animation: fadeIn 0.3s ease;
}

.message.user .message-content {
    animation: slideInRight 0.3s ease;
}

.message.ai .message-content {
    animation: slideInLeft 0.3s ease;
}

/* Toast动画 */
.toast {
    animation: bounce 0.5s ease;
}

/* 表情面板动画 */
.emoji-panel {
    animation: fadeIn 0.2s ease;
}

.emoji-item:hover {
    transform: scale(1.2);
    transition: transform 0.1s ease;
}

/* 设置菜单动画 */
.settings-menu {
    animation: fadeIn 0.2s ease;
}

.menu-item:hover {
    background-color: #666;
    transform: translateX(5px);
    transition: all 0.2s ease;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

/* 输入框聚焦效果 */
.chat-input:focus,
.form-input:focus,
.form-textarea:focus {
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* 头像悬停效果 */
.contact-avatar:hover,
.profile-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.2s ease;
}

/* 按钮点击反馈 */
.form-submit:active,
.header-btn:active,
.action-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* 页面切换动画优化 */
.contact-list-page,
.chat-page,
.moments-page,
.profile-page,
.weibo-page,
.data-management-page,
.debug-log-page {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片悬停效果 */
.moment-item:hover,
.weibo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* 图标旋转动画 */
.header-icon:hover svg {
    transform: rotate(15deg);
    transition: transform 0.2s ease;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(118, 142, 105, 0.3); }
    50% { box-shadow: 0 0 20px rgba(118, 142, 105, 0.6), 0 0 30px rgba(118, 142, 105, 0.4); }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
    70% {
        transform: scale(0.9) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.context-control {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 0 12px 0 !important; /* 与下方"测试连接"拉开间距 */
    box-shadow: none !important;
    position: relative;
    border: 0 !important;
    transition: all 0.2s ease;
}

.context-control:hover {
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.context-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 2px !important;
}

.context-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.context-value {
    font-size: 14px;
    color: #768E69;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.context-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent; /* 统一用自定义track */
    outline: none;
    margin: 0;
    cursor: pointer;
}

.context-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #768E69;
    border: 2px solid #FEFEFE;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    margin-top: -5px; /* 10px thumb on 2px track */
}

.context-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.25);
}

/* WebKit track */
.context-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
}

/* Firefox track */
.context-slider::-moz-range-track {
    height: 4px;
    background: #E5E7EB;
    border: none;
    border-radius: 2px;
}

/* Firefox thumb */
.context-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #768E69;
    border: 2px solid #FEFEFE;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

/* Edge (legacy) */
.context-slider::-ms-track {
    height: 4px;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

.context-slider::-ms-fill-lower,
.context-slider::-ms-fill-upper {
    background: #E5E7EB;
    border-radius: 2px;
}

.context-slider::-ms-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #768E69;
    border: 2px solid #FEFEFE;
}

/* 隐藏滚动条但保留滚动（主要滚动区域） */
body, .main-container, .chat-messages, .contact-list-page, .chat-page, .moments-page, .moments-content, .weibo-page, .weibo-container, .profile-page, .data-management-page, .memory-panel, .debug-log-content {
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none;    /* Firefox */
}

body::-webkit-scrollbar,
.main-container::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.contact-list-page::-webkit-scrollbar,
.chat-page::-webkit-scrollbar,
.moments-page::-webkit-scrollbar,
.moments-content::-webkit-scrollbar,
.weibo-page::-webkit-scrollbar,
.weibo-container::-webkit-scrollbar,
.profile-page::-webkit-scrollbar,
.data-management-page::-webkit-scrollbar,
.memory-panel::-webkit-scrollbar,
.debug-log-content::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.context-info {
    display: none; /* 极致压缩：默认隐藏说明 */
}

.context-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(118, 142, 105, 0.1);
    color: #768E69;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}



.debug-info {
    position: fixed;
    top: 20px; /* 调整位置 */
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    margin-right: 12px;
    background-color: #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.group-avatar-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.group-avatar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    overflow: hidden;
    border: 1px solid white;
    background-color: #768E69;
}

.group-avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-group-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.group-member-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-top: 10px;
    padding: 10px;
}

.group-member-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 0.5px solid #eee;
    cursor: pointer;
}

.group-member-item:last-child {
    border-bottom: none;
}

.group-member-item.selected {
    background-color: #e6f7ff;
}

.group-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    margin-right: 10px;
    background-color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EEEEEE;
    font-size: 14px;
    overflow: hidden;
}

.group-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-member-name {
    flex: 1;
    font-size: 14px;
}

.group-member-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-member-checkbox.selected {
    background-color: #768E69;
    color: #EEEEEE;
    border-color: #768E69;
}

.group-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.group-message-name {
    font-size: 12px;
    font-weight: bold;
    color: #768E69;
}

.group-message-time {
    font-size: 10px;
    color: #999;
    margin-left: 8px;
}

.group-info-hint {
    background-color: #f0f0f0;
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    margin: 10px 0;
}

.weibo-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background-color: #FEFEFE;
    z-index: 130;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.weibo-page.active {
    /* This is now handled by the global .active class */
}

/* 论坛页面头部 */
.weibo-page .weibo-header {
    background-color: #768E69;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid #DCCFC0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.weibo-container {
    max-width: 600px;
    margin: 0 auto;
    background: #FEFEFE;
    min-height: 100%;
    padding: 15px;
    padding-bottom: 50px;
}

.weibo-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
}

.weibo-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    position: relative;
}

.weibo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.weibo-info {
    flex: 1;
    min-width: 0;
}

.weibo-author {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

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

.weibo-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.weibo-content {
    color: #333;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.post {
    background: #EEEEEE;
    margin-bottom: 10px;
    padding: 18px;
    border-radius: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    border: 1px solid #DCCFC0;
}

.post:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(118, 142, 105, 0.12);
    border-color: #768E69;
}

.post-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    position: relative; /* For menu positioning */
}

.post-menu {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
}

.post-menu:hover {
    background-color: #f0f0f0;
}

.post-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
    min-width: 80px;
    padding: 4px 0;
}

.post-menu-dropdown .menu-item {
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.post-menu-dropdown .menu-item:hover {
    background-color: #f5f5f5;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff8a80, #ff5722);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.user-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}

.vip-badge {
    display: inline-block;
    background: linear-gradient(45deg, #ffb74d, #ff9800);
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.post-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.post-source {
    font-size: 12px;
    color: #999;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    color: #333;
    word-wrap: break-word;
}

.hashtag, .mention {
    color: #4a90e2;
    text-decoration: none;
}

.post-image-desc {
    width: 100px;
    height: 100px;
    background: #f0f2f5;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 8px;
    line-height: 1.3;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: 12px;
}

.action-btn-weibo {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn-weibo:hover {
    background-color: #f5f5f5;
}

.action-icon {
    margin-right: 4px;
    font-size: 16px;
}

.comments-section {
    background: #f8f9fa;
    margin: 12px -16px -16px -16px;
    padding: 12px 16px;
}

.comment {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.comment:last-child {
    margin-bottom: 0;
}

.comment-user {
    color: #4a90e2;
    font-weight: 500;
    margin-right: 4px;
}

.comment-content {
    color: #333;
}

.comment-time {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}

/* 新增：加载更多消息按钮 */
.load-more-messages {
    text-align: center;
    padding: 10px;
    color: #768E69;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}
.load-more-messages:hover {
    text-decoration: underline;
}

/* 确认对话框样式 */
.confirm-dialog-overlay {
    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: 4000;
}

/* Update Modal Specifics */
#updateModalBody {
    max-height: 60vh; /* Limit height for long content */
    overflow-y: auto;
    padding-bottom: 15px;
}

#updateModalBody h2 {
    font-size: 1.2em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    text-align: center;
}

#updateModalBody h3 {
    font-size: 1.1em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #07c160;
}

#updateModalBody ul {
    padding-left: 20px;
    margin-bottom: 1em;
}

#updateModalBody li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.modal-footer {
    padding: 15px;
    border-top: 0.5px solid #e5e5e5;
}

/* 新增：回复框样式 */
.reply-box {
    margin-top: 12px;
    padding-top: 12px;
    padding-bottom: 60px; /* 为底部导航栏留出空间 */
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}

.reply-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 18px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.reply-input:focus {
    border-color: #4a90e2;
}

.reply-button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reply-button:hover {
    background-color: #357bd8;
}

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

.confirm-dialog {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.confirm-dialog-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.confirm-dialog-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: space-between;
}

.confirm-dialog-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.confirm-dialog-btn.cancel {
    background-color: #f0f0f0;
    color: #333;
    margin-right: 10px;
}

.confirm-dialog-btn.confirm {
    background-color: #ff4444;
    color: white;
}

/* 帖子选择对话框样式 */
.post-choice-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-option {
    padding: 24px;
    border: 2px solid #DCCFC0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background-color: #EEEEEE;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.choice-option:hover {
    border-color: #768E69;
    background-color: #FEFEFE;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(118, 142, 105, 0.15);
}

.choice-option:active {
    transform: scale(0.98);
}

.choice-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: #768E69;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background-color: rgba(118, 142, 105, 0.1);
    margin: 0 auto 12px;
    transition: all 0.2s ease;
}

.choice-option:hover .choice-icon {
    background-color: #768E69;
    color: #EEEEEE;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(118, 142, 105, 0.2);
}

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

.choice-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* 手动发帖表单样式 */
#manualPostModal .form-input {
    width: 100%;
}

/* 论坛帖子样式优化 */
.weibo-item .weibo-header {
    position: relative;
}

.weibo-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.weibo-menu:hover {
    background-color: rgba(0,0,0,0.1);
}

.weibo-actions {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
}

.weibo-like,
.weibo-comment {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background-color 0.2s;
    user-select: none;
}

.weibo-like:hover,
.weibo-comment:hover {
    background-color: rgba(0,0,0,0.05);
}

.weibo-like:active,
.weibo-comment:active {
    transform: scale(0.95);
}

.comment-input-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.comment-input:focus {
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
}

.comment-input-area button {
    padding: 8px 16px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.comment-input-area button:hover {
    background-color: #06a552;
}

.comment-input-area button:active {
    transform: scale(0.95);
}

.comment-item {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.comment-time {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

/* AI设置相关样式 */
.ai-settings-btn {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-settings-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.range-labels span:nth-child(2) {
    font-weight: bold;
    color: #07c160;
}

.context-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

#manualPostModal textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

#manualPostAuthor {
    background-color: #f5f5f5;
    color: #666;
}

/* 批量删除消息样式 */
.message-selected {
    background-color: rgba(255, 99, 99, 0.2) !important;
    border-left: 4px solid #ff6b6b !important;
}

.message-selected .message-bubble {
    background-color: rgba(255, 99, 99, 0.15) !important;
}

.multi-select-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 1001;
    height: 80px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.multi-select-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 45px;
}

.multi-select-btn.cancel-btn {
    background-color: #6c757d;
    color: white;
}

.multi-select-btn.cancel-btn:hover {
    background-color: #5a6268;
}

.multi-select-btn.delete-btn {
    background-color: #dc3545;
    color: white;
}

.multi-select-btn.delete-btn:hover {
    background-color: #c82333;
}

/* 语音播放器样式 */
.voice-player {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 18px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 8px;
}
.message.sent .voice-player {
    background-color: #8be061; /* 适配发送气泡的颜色 */
}
.voice-player:hover {
    background-color: #e0e0e0;
}
.message.sent .voice-player:hover {
    background-color: #7dce55;
}

.play-button {
    font-size: 16px;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #555;
}
.message.sent .play-button {
    color: #333;
}

.waveform {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.waveform-bar {
    width: 2px;
    background-color: #aaa;
    border-radius: 1px;
}
.message.sent .waveform-bar {
     background-color: #666;
}
.waveform-bar:nth-child(1) { height: 40%; }
.waveform-bar:nth-child(2) { height: 70%; }
.waveform-bar:nth-child(3) { height: 100%; }
.waveform-bar:nth-child(4) { height: 80%; }
.waveform-bar:nth-child(5) { height: 50%; }
.waveform-bar:nth-child(6) { height: 90%; }
.waveform-bar:nth-child(7) { height: 60%; }
.waveform-bar:nth-child(8) { height: 30%; }
.waveform-bar:nth-child(9) { height: 75%; }

.voice-player.playing .waveform-bar {
    animation: wave 1.2s infinite ease-in-out;
}
@keyframes wave {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}
.voice-player.playing .waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-player.playing .waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-player.playing .waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-player.playing .waveform-bar:nth-child(5) { animation-delay: 0.4s; }

.duration {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
    min-width: 35px;
    text-align: right;
}
.message.sent .duration {
    color: #333;
}

/* 如果有播放器，给下面的文本消息增加一点间距 */
.message-content.has-voice-player {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 8px;
    margin-top: 8px;
}
.message.sent .message-content.has-voice-player {
     border-top: 1px solid rgba(0,0,0,0.1);
}

/* === 调试日志页面样式 === */
.debug-log-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.debug-log-page.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.debug-log-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    padding-bottom: 70px; /* 给底部导航留出空间 */
}

.debug-log-info {
    margin-bottom: 15px;
}

.debug-log-stats {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.debug-log-hint {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.debug-log-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 10px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.debug-log-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.debug-log-item {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #ddd;
    font-size: 13px;
    word-break: break-all;
}

.debug-log-item.debug-log-error {
    background: #fff5f5;
    border-left-color: #e53e3e;
}

.debug-log-item.debug-log-warn {
    background: #fffbf0;
    border-left-color: #dd6b20;
}

.debug-log-item.debug-log-info {
    background: #f0f8ff;
    border-left-color: #3182ce;
}

.debug-log-item.debug-log-log {
    background: #f7fafc;
    border-left-color: #718096;
}

.debug-log-item.debug-log-debug {
    background: #f0fff4;
    border-left-color: #38a169;
}

.debug-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.debug-log-time {
    color: #666;
    font-size: 11px;
}

.debug-log-level {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.debug-log-error .debug-log-level {
    background: #e53e3e;
    color: white;
}

.debug-log-warn .debug-log-level {
    background: #dd6b20;
    color: white;
}

.debug-log-info .debug-log-level {
    background: #3182ce;
    color: white;
}

.debug-log-log .debug-log-level {
    background: #718096;
    color: white;
}

.debug-log-debug .debug-log-level {
    background: #38a169;
    color: white;
}

.debug-log-message {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
    white-space: pre-wrap;
    color: #333;
}

.header-btn {
    background: #768E69;
    color: #EEEEEE;
    border: none;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(118, 142, 105, 0.3);
}

.header-btn:hover {
    background: #5a6b52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 142, 105, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
}

/* 同样隐藏模态内容的滚动条 */
.modal-content, .publish-moment-content { -ms-overflow-style: none; scrollbar-width: none; }
.modal-content::-webkit-scrollbar, #apiSettingsModal .modal-content::-webkit-scrollbar { width: 0 !important; height: 0 !important; background: transparent !important; }

/* 兜底：尽量隐藏 WebKit 内所有元素的滚动条（不影响滚动） */
*::-webkit-scrollbar { width: 0; height: 0; background: transparent; }

/* High-specificity override for context slider */
#contextSlider {
  width: 100% !important;
  height: 4px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
}
#contextSlider::-webkit-slider-runnable-track { height: 4px !important; background: #E5E7EB !important; border-radius: 2px !important; }
#contextSlider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 14px !important; height: 14px !important; border-radius: 50% !important;
  background: #768E69 !important; border: 2px solid #FEFEFE !important; margin-top: -5px !important;
}
#contextSlider::-moz-range-track { height: 4px !important; background: #E5E7EB !important; border: none !important; border-radius: 2px !important; }
#contextSlider::-moz-range-thumb { width: 14px !important; height: 14px !important; border-radius: 50% !important; background: #768E69 !important; border: 2px solid #FEFEFE !important; }
#contextSlider::-ms-track { height: 4px !important; background: transparent !important; border-color: transparent !important; color: transparent !important; }
#contextSlider::-ms-fill-lower, #contextSlider::-ms-fill-upper { background: #E5E7EB !important; border-radius: 2px !important; }
#contextSlider::-ms-thumb { width: 14px !important; height: 14px !important; border-radius: 50% !important; background: #768E69 !important; border: 2px solid #FEFEFE !important; }
