/* 双人私密朋友圈样式表 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    display: none;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    display: block;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==================== 页面通用 ==================== */
.page {
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* ==================== 登录页 ==================== */
#login-page {
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 60px;
    position: relative;
}

#login-page > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 28px;
    color: #07C160;
    margin-bottom: 10px;
}

.login-header p {
    font-size: 14px;
    color: #999;
}

.login-tabs {
    display: flex;
    background-color: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    font-size: 16px;
}

.tab-item.active {
    color: #07C160;
    background-color: #f0fff5;
    font-weight: 500;
}

.login-form {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    display: none;
}

.login-form.active {
    display: block;
}

.form-item {
    margin-bottom: 15px;
}

.form-item input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-item input:focus {
    border-color: #07C160;
}

.form-item input::placeholder {
    color: #999;
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #06ad56;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-default {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-danger {
    width: 100%;
    padding: 14px;
    background-color: #ff4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.btn-cancel {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-footer .btn-cancel,
.modal-footer .btn-danger {
    flex: 1;
    width: auto;
}

.btn-share {
    margin-bottom: 12px;
}

/* ==================== 首页 ==================== */
.header {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header h2 {
    font-size: 18px;
    color: #333;
}

.header-left {
    display: flex;
    align-items: center;
}

.back-btn {
    color: #07C160;
    cursor: pointer;
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
}

.avatar-btn {
    width: 36px;
    height: 36px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    overflow: hidden;
}

#header-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== 动态列表 ==================== */
.post-list {
    padding: 10px;
}

.post-card {
    background-color: #fff;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.post-author {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.post-time {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.post-delete {
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 5px 10px;
}

.post-delete:hover {
    color: #ff4444;
}

.post-content {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 12px;
    word-break: break-all;
}

/* ==================== 图片九宫格 ==================== */
.post-images {
    display: grid;
    gap: 5px;
}

.post-images.cols-1 {
    grid-template-columns: 1fr;
}

.post-images.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.post-images.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.post-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.post-image:hover {
    opacity: 0.9;
}

/* 单张大图特殊处理 */
.post-images.cols-1 .post-image {
    aspect-ratio: 16/9;
    max-height: 300px;
    object-fit: cover;
}

/* ==================== 空状态 ==================== */
.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-tip p:first-child {
    font-size: 16px;
    margin-bottom: 10px;
}

.empty-tip p:last-child {
    font-size: 14px;
}

/* ==================== 发布按钮 ==================== */
.publish-btn {
    position: fixed;
    left: 25%;
    transform: translateX(-50%);
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: 40px;
    height: 40px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
    z-index: 9999;
    transition: transform 0.3s;
    visibility: visible;
    opacity: 1;
}

.publish-btn:hover {
    transform: translateX(-50%) scale(1.1);
}

.publish-btn.visible {
    display: flex;
}

/* ==================== 个人中心 ==================== */
.profile-content {
    padding: 20px;
}

.profile-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin-right: 15px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar #profile-avatar-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.profile-info {
    flex: 1;
}

.profile-nickname {
    font-size: 20px;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

.profile-code {
    font-size: 14px;
    color: #666;
}

.copy-btn {
    color: #07C160;
    cursor: pointer;
    margin-left: 10px;
}

.space-info {
    background-color: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.space-info-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.space-info-item:last-child {
    border-bottom: none;
}

.space-info-label {
    color: #999;
    font-size: 14px;
}

.space-info-value {
    color: #333;
    font-size: 16px;
    margin-left: 10px;
}

.member-list {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.member-item {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 20px;
}

.member-avatar {
    width: 24px;
    height: 24px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    margin-right: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-size: 14px;
    color: #333;
}

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
}

/* ==================== 发布弹窗 ==================== */
.publish-modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
}

.publish-modal-content .modal-body {
    padding: 15px 20px;
}

.publish-modal-content textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    outline: none;
}

.publish-modal-content textarea:focus {
    border-color: #07C160;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.image-upload-area {
    margin-top: 15px;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    position: relative;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-preview-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #ff4444;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
}

.image-upload-btn {
    width: 80px;
    height: 80px;
    background-color: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-upload-btn span {
    font-size: 24px;
    color: #999;
}

.image-upload-btn p {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.image-tip {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.btn-publish {
    margin-top: 15px;
}

/* ==================== 图片预览弹窗 ==================== */
.image-preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s;
}

.image-preview-close:hover {
    opacity: 0.7;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-prev, .nav-next {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.nav-prev:hover, .nav-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.image-preview-index {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ==================== 右键菜单 ==================== */
.context-menu {
    position: fixed;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 6px 0;
    z-index: 2000;
    min-width: 140px;
}

.context-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.context-menu-item:hover {
    background-color: #f5f5f5;
}

.context-menu-separator {
    height: 1px;
    background-color: #eee;
    margin: 4px 0;
}

/* ==================== 删除确认弹窗 ==================== */
.delete-modal-content {
    max-width: 300px;
}

.delete-modal-content p {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.delete-actions {
    display: flex;
    gap: 10px;
}

.delete-actions button {
    flex: 1;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 375px) {
    .login-header h1 {
        font-size: 24px;
    }
    
    .tab-item {
        font-size: 14px;
    }
    
    .publish-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) {
    .image-preview-content img {
        max-height: 70vh;
    }
}

/* ==================== 互动区域（点赞+评论） ==================== */
.card-interaction {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.interaction-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #666;
}

.interaction-item:hover {
    background-color: #f5f5f5;
}

.interaction-item.liked {
    color: #fa5151;
}

.interaction-icon {
    font-size: 18px;
}

/* ==================== 评论区 ==================== */
.comment-section {
    margin-top: 10px;
    padding: 10px 12px;
    background-color: #f7f7f7;
    border-radius: 8px;
}

.like-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    color: #576b95;
    flex-wrap: wrap;
}

.like-icon {
    font-size: 14px;
}

.like-names {
    flex: 1;
    word-break: break-all;
}

.like-item {
    display: inline;
}

.like-time {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-item {
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    padding: 2px 0;
    word-break: break-all;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.comment-author {
    color: #576b95;
    font-weight: 500;
}

.reply-prefix {
    color: #666;
    margin: 0 2px;
}

.reply-to {
    color: #576b95;
    font-weight: 500;
}

.comment-content {
    color: #333;
    flex: 1;
    min-width: 0;
}

.comment-time {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
    flex-shrink: 0;
}

.comment-delete {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.comment-delete:hover {
    color: #ff4444;
}

/* ==================== 分享弹窗 ==================== */
.share-modal-content {
    max-width: 360px;
}

.share-modal-content .modal-body {
    text-align: center;
}

.share-tip {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.share-code-box {
    background-color: #f7f7f7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.share-code-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.share-code {
    font-size: 32px;
    font-weight: bold;
    color: #07C160;
    letter-spacing: 4px;
}

.share-link-box {
    margin-bottom: 15px;
}

.share-link-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    text-align: left;
}

.share-link-row {
    display: flex;
    gap: 8px;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    background-color: #f7f7f7;
}

.btn-copy {
    padding: 10px 16px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-copy:hover {
    background-color: #06ad56;
}

.share-qrcode-box {
    background-color: #f7f7f7;
    border-radius: 12px;
    padding: 20px;
}

.share-qrcode-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.share-qrcode canvas {
    border-radius: 8px;
}

.expand-comments {
    margin-top: 8px;
    font-size: 13px;
    color: #576b95;
    cursor: pointer;
    padding-top: 4px;
}

/* ==================== 评论输入区 ==================== */
.comment-input-area {
    margin-top: 10px;
    padding: 10px 0 0 0;
    border-top: 1px solid #f0f0f0;
    width: 100%;
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 100%;
}

.reply-hint {
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    padding: 2px 4px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.cancel-reply {
    color: #576b95;
    cursor: pointer;
    font-size: 12px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background-color: #f7f7f7;
}

.comment-input:focus {
    border-color: #07C160;
    background-color: #fff;
}

.emoji-btn {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    user-select: none;
}

.comment-send-btn {
    padding: 8px 16px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-send-btn:hover {
    background-color: #06ad56;
}

.comment-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ==================== 表情包选择器 ==================== */
.post-card .emoji-picker {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.post-card .emoji-picker .emoji-item {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1;
    box-sizing: border-box;
}

.emoji-item:hover {
    background-color: #f0f0f0;
}

/* ==================== 底部导航栏 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #e8e8e8;
    z-index: 100;
}

.bottom-nav > div:first-child {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-bottom: 5px;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-bottom: 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px 20px;
    transition: all 0.2s;
    position: relative;
}

.nav-item.active {
    color: #07C160;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
    color: inherit;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    background-color: #ff4444;
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
}

/* ==================== 页面内容区域 ==================== */
.page-content {
    padding-bottom: 60px;
    min-height: calc(100vh - 110px);
}

#chat-content {
    background-color: #fff;
}

/* ==================== 聊天列表 ==================== */
.chat-list {
    background-color: #fff;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.chat-item:hover {
    background-color: #f5f5f5;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    background-color: #07C160;
    color: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}

.chat-last-msg {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-time {
    font-size: 12px;
    color: #999;
}

.chat-unread {
    background-color: #ff4444;
    color: #fff;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 6px;
}

/* ==================== 聊天详情页 ==================== */
#chat-detail-page {
    background-color: #f5f5f5;
}

.chat-messages {
    padding: 15px;
    padding-bottom: 80px;
    min-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
}

.message-item {
    display: flex;
    align-items: flex-start;
    max-width: 75%;
}

.message-item.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-item.received {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    margin: 0 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-item.sent .message-avatar {
    background-color: #07C160;
    color: #fff;
}

.message-item.received .message-avatar {
    background-color: #576b95;
    color: #fff;
}

.message-content {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.message-item.sent .message-content {
    background-color: #07C160;
    color: #fff;
    border-radius: 8px 8px 0 8px;
}

.message-item.received .message-content {
    background-color: #fff;
    color: #333;
    border-radius: 8px 8px 8px 0;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

/* 聊天搜索栏 */
.chat-search-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}

.chat-search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
}

.chat-search-bar input:focus {
    border-color: #07C160;
}

.chat-search-cancel {
    margin-left: 10px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

/* 搜索高亮 */
.message-item.highlight {
    background-color: #fffde7;
}

/* 搜索无结果提示 */
.chat-no-result {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.message-item.received .message-time {
    text-align: left;
}

/* ==================== 撤回消息 ==================== */
.message-recalled {
    padding: 8px 14px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.recall-link {
    color: #576b95;
    cursor: pointer;
    font-size: 12px;
}

.recall-link:hover {
    text-decoration: underline;
}

/* ==================== 聊天输入栏 ==================== */
.chat-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-top: 1px solid #e8e8e8;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    flex-wrap: nowrap;
}

.chat-input-bar input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.chat-input-bar input:focus {
    border-color: #07C160;
}

.chat-send-btn {
    padding: 8px 18px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background-color: #06ad56;
}

.chat-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ==================== 聊天工具栏 ==================== */
.chat-toolbar {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.chat-tool-btn {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
    line-height: 1;
}

.chat-tool-btn:hover {
    background-color: #f0f0f0;
}

/* ==================== 聊天表情包选择器 ==================== */
.chat-emoji-picker {
    position: fixed;
    bottom: 60px;
    left: 10px;
    right: 10px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.emoji-item:hover {
    background-color: #f0fff5;
    transform: scale(1.1);
}

/* ==================== 消息图片 ==================== */
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
}

/* ==================== 消息文件 ==================== */
.message-file {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
    max-width: 300px;
}

.message-file:hover {
    background-color: #f5f5f5;
}

.file-icon {
    font-size: 24px;
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ==================== 语音通话页面 ==================== */
.call-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.call-content {
    text-align: center;
    color: #fff;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.call-avatar {
    width: 120px;
    height: 120px;
    background-color: #07C160;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    margin: 0 auto 20px;
    box-shadow: 0 10px 40px rgba(7, 193, 96, 0.3);
    overflow: hidden;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-nickname {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
}

.call-status {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.call-duration {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 40px;
    font-family: 'Courier New', monospace;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 20px;
}

.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin-bottom: 8px;
}

.call-btn-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.mute-btn .call-btn-icon {
    background-color: rgba(255, 255, 255, 0.2);
}

.mute-btn.active .call-btn-icon {
    background-color: rgba(255, 0, 0, 0.3);
}

.end-btn .call-btn-icon {
    background-color: #e74c3c;
}

.accept-btn .call-btn-icon {
    background-color: #07C160;
}

.reject-btn .call-btn-icon {
    background-color: #e74c3c;
}

.call-answer-controls {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 30px;
}

/* 通话记录消息样式 */
.message-call {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

.message-call-icon {
    font-size: 18px;
}

.message-call-info {
    display: flex;
    flex-direction: column;
}

.message-call-type {
    font-size: 13px;
}

.message-call-duration {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.message-item.sent .message-call {
    background-color: rgba(7, 193, 96, 0.2);
}

.message-item.received .message-call {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 通话按钮（聊天详情页） */
.call-action-btn {
    padding: 8px 15px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 8px;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 60px;
    min-height: 32px;
}

.call-action-btn:hover {
    background-color: #06ad56;
}

.call-action-btn:active {
    background-color: #05994a;
    transform: scale(0.98);
}

.clear-btn {
    padding: 8px;
    background-color: transparent;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-right: 4px;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.clear-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

/* ==================== ICP备案号 ==================== */
.icp-footer {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 5px 0;
}

.icp-footer a {
    color: #999;
    text-decoration: none;
}

.icp-footer a:hover {
    color: #666;
}