* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0; height: 100%; width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #ededed; color: #333; font-size: 15px;
}
button { cursor: pointer; border: none; outline: none; font-size: 15px; }
input { outline: none; }

#app { max-width: 480px; margin: 0 auto; height: 100%; position: relative; background: #fff; }
.page { height: 100%; display: flex; flex-direction: column; }

/* 登录/注册 */
#auth { background: #fff; align-items: center; justify-content: flex-start; padding: 30px 0; overflow-y: auto; }
.auth-box { width: 85%; max-width: 360px; padding: 20px; flex-shrink: 0; }
.chat-input .iconfont{font-size:22px;}
/* SEO帖子列表 - 极简版 */
.seo-posts {
    width: 85%; max-width: 360px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    max-height: 160px; overflow-y: auto;
}
.seo-posts-title {
    font-size: 12px; font-weight: 600;
    color: #999; margin-bottom: 6px;
}
.seo-post-item {
    display: flex; align-items: center;
    padding: 5px 0;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none; color: inherit;
}
.seo-post-item:hover .seo-post-title { color: #07c160; }
.seo-post-title {
    font-size: 13px; color: #333; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex-shrink: 0; min-width: 0;
}
.seo-post-snippet {
    font-size: 12px; color: #ccc;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
    margin: 0 6px;
}
.seo-post-time {
    font-size: 11px; color: #bbb; flex-shrink: 0;
}
.logo-text { text-align: center; font-size: 28px; color: #07c160; margin: 40px 0 30px; font-weight: 600; }
.tabs { display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.tab { flex: 1; text-align: center; padding: 12px 0; cursor: pointer; color: #666; }
.tab.active { color: #07c160; border-bottom: 2px solid #07c160; }
.tab-panel input { display: block; width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 12px; }
.tab-panel button { width: 100%; padding: 12px; background: #07c160; color: #fff; border-radius: 6px; margin-top: 8px; }

/* 主界面 */
#main { height: 100vh; display: flex; flex-direction: column; }
#top-bar {
    height: 48px; background: #ededed; display: flex; align-items: center;
    padding: 0 14px; border-bottom: 1px solid #ddd; flex: 0 0 auto;
    position: relative;
}
#top-title { flex: 1; font-weight: 600; font-size: 17px; }
#top-action { color: #07c160; font-size: 14px; }
#main-content { flex: 1; overflow-y: auto; background: #fff; position: relative; }
#bottom-bar {
    height: 56px; background: #f7f7f7; display: flex; border-top: 1px solid #ddd;
    flex: 0 0 auto;
}
.bottom-item {
    flex: 1; text-align: center; padding: 6px 0; color: #666; cursor: pointer;
    font-size: 12px;
}
.bottom-item > div { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.bottom-item.active { color: #07c160; }

/* 聊天列表 */
.search-row { padding: 10px 14px; background: #f7f7f7; position: relative; }
#search-input {
    width: 100%; padding: 8px 12px; border-radius: 6px; border: none;
    background: #fff; font-size: 14px;
}
#search-results { position: absolute; left: 14px; right: 14px; top: 48px; background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.15); z-index: 10; max-height: 320px; overflow-y: auto; display: none; }
#search-results .item { padding: 10px; display: flex; align-items: center; border-bottom: 1px solid #f3f3f3; cursor: pointer; }
#search-results .item:hover { background: #f7f7f7; }

.chat-list-item {
    display: flex; padding: 12px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.chat-list-item .avatar { width: 40px; height: 40px; border-radius: 6px; background: #07c160; color: #fff; text-align: center; line-height: 40px; margin-right: 10px; flex: 0 0 auto; font-size: 13px; }
.chat-list-item .avatar img { width: 100%; height: 100%; border-radius: 6px; object-fit: cover; }
.chat-list-item .meta { flex: 1; min-width: 0; }
.chat-list-item .row1 { display: flex; justify-content: space-between; }
.chat-list-item .name { font-weight: 500; }
.chat-list-item .time { color: #999; font-size: 12px; }
.chat-list-avatar-wrap{position:relative;}
.chat-list-item .content { color: #888; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 4px; }
.chat-list-item .badge { background: #fa5151; color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 11px; margin-left: 6px;position: absolute;
    left: -10px;
    bottom: -5px; }

/* 通讯录 */
.contact-section { border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: #fff; }
.contact-item { padding: 14px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; cursor: pointer; position: relative; }
.contact-item:last-child { border-bottom: none; }
.contact-item span { margin-right: 12px; font-size: 18px; }
.badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 6px;
    background: #fa5151;
    color: #fff;
    font-size: 12px;
    border-radius: 9px;
    text-align: center;
    margin-left: auto;
    margin-right: 0;
}
.contact-title { padding: 14px; color: #999; font-size: 13px; background: #f7f7f7; }

/* 我的 */
.me-card { padding: 18px 14px; display: flex; align-items: center; background: #fff; border-bottom: 1px solid #eee; }
.me-card img { width: 56px; height: 56px; border-radius: 8px; background: #07c160; margin-right: 14px; object-fit: cover; }
.me-info #me-nick { font-size: 18px; font-weight: 500; }
.muted { color: #888; font-size: 13px; margin-top: 4px; }
.form-section { padding: 12px 14px; background: #fff; border-bottom: 1px solid #eee; }
.form-section label { font-size: 13px; color: #666; display: block; margin-bottom: 6px; }
.form-section input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
#btn-save-me, #btn-logout { display: block; margin: 18px auto; padding: 10px 30px; background: #07c160; color: #fff; border-radius: 6px; width: 80%; }
#btn-logout.secondary { background: #fff; color: #fa5151; border: 1px solid #fa5151; }
.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    margin: 0 auto; padding: 14px 20px;
    background: #fff; border-radius: 6px; width: 80%; cursor: pointer;
    border: 1px solid #ddd; color: #333; font-size: 14px;
    transition: background 0.15s;
}
.setting-row:hover { background: #f5f5f5; }
.setting-row .setting-value { color: #07c160; font-weight: 500; }

/* 聊天窗口 */
.chat-window {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%;
    max-width: 480px; height: 100vh; background: #ededed;
    display: flex; flex-direction: column; z-index: 99;
}
#chat-header {
    height: 48px; background: #ededed; border-bottom: 1px solid #ccc;
    display: flex; align-items: center; padding: 0 12px; flex: 0 0 auto;
}
.back-btn { font-size: 22px; margin-right: 8px; color: #333; cursor: pointer; }
#chat-title { flex: 1; font-weight: 500; cursor: pointer; }
.menu-btn {
    font-size: 22px; cursor: pointer; padding: 4px 8px;
    color: #333; margin-left: auto; user-select: none;
}
.menu-btn:hover { color: #07c160; }
.dropdown-menu {
    position: absolute; top: 50px; right: 12px; z-index: 200;
    background: #fff; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    min-width: 140px; overflow: hidden; font-size: 14px;
}
.dropdown-item {
    padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f5f5f5; color: #07c160; }
.dropdown-item.danger:hover { background: #fef0f0; color: #fa5151; }
.m-avatar { cursor: pointer; }


#chat-messages { flex: 1; overflow-y: auto; padding: 12px; background: #ededed; }

.msg { display: flex; margin: 8px 0; width: 100%; }
.msg .bubble {
    padding: 8px 12px; border-radius: 6px;
    background: #fff; position: relative;
    overflow-wrap: anywhere; word-wrap: break-word;
    line-height: 1.5;
    display: inline-block;
    box-sizing: border-box;
}
.msg.self .bubble { background: #95ec69; }
.msg .nick { font-size: 12px; color: #999; margin-bottom: 4px; }
.msg .m-row {
    display: flex; align-items: flex-start;
    width: 100%;
}
.msg.self .m-row { flex-direction: row-reverse; }  /* self 时头像移到右边 */
.msg .m-content {
    display: flex; flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}
.msg.self .m-content { align-items: flex-end;position:relative; }    /* self 时气泡右对齐 */
.msg .m-avatar {
    width: 32px; height: 32px; border-radius: 4px; background: #07c160; color: #fff;
    text-align: center; line-height: 32px; margin: 0 8px; flex: 0 0 auto; font-size: 12px;
    overflow: hidden;
}
.msg .m-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.msg-time { text-align: center; color: #999; font-size: 11px; margin: 6px 0; }

/* 引用回复 */
.reply-quoted {
    border-left: 3px solid #07c160;
    padding: 4px 8px 4px 8px;
    margin-bottom: 6px;
    background: rgba(7,193,96,0.06);
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    line-height: 1.4;
}
.reply-nick { color: #07c160; font-weight: 500; margin-right: 4px; }
.reply-text { color: #666; }

/* 消息菜单按钮 */
.nick-row { display: flex; align-items: center; gap: 8px; }
.msg-menu-btn {
    font-size: 18px; color: #999; cursor: pointer; padding: 2px 6px;
}
.msg-menu-btn:hover { color: #07c160; }

/* 消息操作菜单 */
.msg-action-menu {
    position: fixed; display: flex; gap: 0;
    background: #fff; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 4px; z-index: 1000;
}
.msg-action-item {
    padding: 6px 8px; font-size: 13px;
    color: #333; cursor: pointer;
    border-radius: 6px; white-space: nowrap;
}
.msg-action-item:hover { background: #f5f5f5; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center; justify-content: center;
    z-index: 997; padding: 16px;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.modal-title-bar {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-close-btn {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: #bbb; line-height: 1;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.modal-close-btn:hover { background: #f5f5f5; color: #666; }
.modal-content {
    overflow-y: auto;
    flex: 1;
}

/* 用户资料弹窗 */
.user-profile-card {
    padding: 0;
}
.profile-hero {
    background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
    padding: 28px 20px 22px;
    text-align: center;
    color: #fff;
    position: relative;
}
.profile-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -30px;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    z-index: 1;
}
.profile-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: #fff;
    color: #07c160;
    font-size: 28px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-online-dot {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 14px; height: 14px;
    background: #4cd964;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 2;
}
.profile-nick {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative; z-index: 1;
}
.profile-uname {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
    position: relative; z-index: 1;
}
.profile-signature {
    font-size: 13px;
    opacity: 0.9;
    max-width: 280px;
    margin: 0 auto;
    position: relative; z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-info-list {
    background: #fff;
    padding: 6px 0;
}
.profile-info-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #f7f7f7;
    font-size: 14px;
}
.profile-info-item:last-child { border-bottom: none; }
.profile-info-icon {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 16px;
}
.profile-info-label {
    color: #999;
    flex: 0 0 56px;
    font-size: 14px;
}
.profile-info-value {
    flex: 1;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-btn.danger-outline {
    width: 100%; padding: 12px; border: 1px solid #fa5151; border-radius: 8px;
    font-size: 15px; cursor: pointer;
    background: #fff; color: #fa5151;
}

/* 用户资料 - 旧样式保留兼容 */
.profile-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.profile-label {
    flex: 0 0 60px;
    font-size: 14px;
    color: #999;
}
.profile-value {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-btn {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    font-size: 15px; cursor: pointer;
}
.form-btn.primary { background: #07c160; color: #fff; }
.form-btn.danger { background: #fa5151; color: #fff; }

/* 我的页面 */
.me-header {
    display: flex; align-items: center; padding: 16px 14px;
    background: #fff; margin-bottom: 8px;
}
.me-header .me-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background: #07c160; color: #fff; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; overflow: hidden; flex-shrink: 0;
}
.me-header .me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-user-info { flex: 1; min-width: 0; }
.me-nickname { font-size: 16px; font-weight: 600; color: #333; }
.me-username { font-size: 12px; color: #999; margin-top: 3px; }
.me-arrow { color: #ccc; font-size: 18px; margin-left: 8px; }

.me-list {
    background: #fff; margin-bottom: 8px;
}
.me-list-item {
    display: flex; align-items: center; padding: 12px 14px;
    border-bottom: 1px solid #f5f5f5; cursor: pointer;
    font-size: 14px; color: #333;
}
.me-list-item:last-child { border-bottom: none; }
.me-item-icon { width: 20px; margin-right: 10px; text-align: center; }
.me-item-label { flex: 1; }
.me-item-arrow { color: #ccc; font-size: 16px; }
.me-item-value { color: #999; font-size: 13px; }
.logout-item { justify-content: center; color: #fa5151; }
.logout-item .me-item-icon { margin-right: 6px; }

/* 页面头部 */
.page-header {
    display: flex; align-items: center; height: 44px;
    background: #fff; border-bottom: 1px solid #eee;
    padding: 0 10px; position: sticky; top: 0; z-index: 10;
}
.page-header .back-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #333; cursor: pointer; flex-shrink: 0;
}
.page-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.page-action-placeholder { width: 32px; flex-shrink: 0; }

/* 编辑资料页 */
.edit-avatar-row {
    background: #fff; padding: 16px 0; text-align: center;
    margin-bottom: 8px;
}
.edit-avatar-circle {
    width: 60px; height: 60px; border-radius: 50%;
    background: #07c160; color: #fff; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 6px; overflow: hidden; cursor: pointer;
}
.edit-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.edit-avatar-hint { font-size: 12px; color: #999; }

.edit-form-list {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.edit-form-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.edit-form-item:last-child { border-bottom: none; }
.edit-form-label {
    flex: 0 0 70px;
    color: #333;
    font-size: 14px;
}
.edit-form-input {
    flex: 1;
    padding: 6px 8px;
    border: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    outline: none;
    text-align: right;
}
.edit-form-input:disabled {
    color: #999;
    background: transparent;
}
.edit-form-select {
    flex: 1;
    padding: 6px 8px;
    border: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    outline: none;
    text-align: right;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 20px;
}
.edit-save-wrap {
    padding: 16px 14px;
}

/* 我的帖子列表 */
.my-posts-list { padding: 10px 14px; }
.my-post-card {
    background: #fff; border-radius: 8px; padding: 12px;
    margin-bottom: 10px; cursor: pointer;
}
.my-post-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 6px; }
.my-post-summary { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 8px; }
.my-post-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #999;
}
.my-post-stats span { margin-right: 10px; }
.my-post-del {
    color: #fa5151; cursor: pointer; padding: 4px 8px;
    border: 1px solid #fa5151; border-radius: 4px; font-size: 12px;
}

/* 好友分组管理 */
.friend-groups-list { padding: 10px 0; }
.group-manage-item {
    display: flex; align-items: center;
    padding: 12px 14px; background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.group-manage-item:first-child { border-top: 1px solid #f0f0f0; }
.group-manage-info { flex: 1; display: flex; align-items: center; gap: 10px; }
.group-manage-name { font-size: 15px; color: #333; }
.group-manage-count { font-size: 13px; color: #999; }
.group-manage-actions { display: flex; gap: 10px; }
.group-action-btn {
    font-size: 13px; color: #576b95; cursor: pointer;
    padding: 4px 10px; border: 1px solid #ddd;
    border-radius: 4px;
}
.group-action-btn.danger { color: #fa5151; border-color: #fa5151; }
.group-action-btn:active { opacity: 0.7; }
.my-post-empty { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* 帖子详情图片 */
.post-detail-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.post-detail-images img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; }

/* 全屏iframe帖子详情 */
.post-iframe-overlay {
    position: fixed; inset: 0; z-index: 9999; background: #fff;
    display: none; flex-direction: column;
}
.post-iframe-header {
    height: 48px; display: flex; align-items: center; padding: 0 14px;
    background: #fff; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
}
.post-iframe-close {
    font-size: 26px; color: #333; cursor: pointer; width: 30px;
    display: flex; align-items: center; justify-content: center;
}
.post-iframe-title {
    flex: 1; font-weight: 600; font-size: 17px; text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-iframe-placeholder { width: 30px; }
.post-iframe-frame { flex: 1; border: none; width: 100%; }

/* 气泡内的富内容 */
.bubble img.chat-img { max-width: 200px; max-height: 260px; border-radius: 4px; display: block; }
.bubble video.chat-video { max-width: 240px; max-height: 260px; border-radius: 4px; display: block; }
.bubble audio.chat-audio { width: 220px; display: block; }
.bubble .chat-file {
    display: flex; align-items: center; padding: 8px 12px;
    background: rgba(0,0,0,0.04); border-radius: 4px; min-width: 180px;
}
.bubble .chat-file .file-icon { font-size: 28px; margin-right: 10px; }
.bubble .chat-file .file-info { min-width: 0; }
.bubble .chat-file .file-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble .chat-file .file-size { font-size: 12px; color: #888; margin-top: 2px; }
.bubble a { color: inherit; text-decoration: underline; }

/* 上传进度条 */
.uploading-wrap {
    min-width: 200px; padding: 10px 14px;
}
.uploading-file-info {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.uploading-icon { font-size: 24px; }
.uploading-name {
    font-size: 14px; flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.uploading-size { font-size: 12px; color: #888; flex-shrink: 0; }
.upload-progress-bg {
    width: 100%; height: 4px; background: rgba(0,0,0,0.1);
    border-radius: 2px; overflow: hidden;
}
.upload-progress-bar {
    height: 100%; background: #07c160; border-radius: 2px;
    transition: width 0.2s ease;
}
.upload-progress-text {
    font-size: 12px; color: #888; text-align: right; margin-top: 4px;
}

/* 输入框扩展区 */
.chat-input {
    display: flex; padding: 6px; border-top: 1px solid #ddd; background: #f7f7f7;
    flex: 0 0 auto; align-items: center; gap: 4px;
}
.chat-input textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    max-height: 96px;
    min-height: 20px;
    overflow: hidden;
    font-family: inherit;
    outline: none;
}

/* 输入有内容时隐藏 + 号按钮 */
.chat-input.has-content [data-tool="plus"] { display: none; }
.chat-input button {
    padding: 0 14px; height: 34px; background: #07c160; color: #fff;
    border-radius: 4px; border: none; font-size: 13px; cursor: pointer;
    display: none;
    flex: 0 0 auto;
}
.chat-input button.show { display: block!important; }
.chat-tool {
    width: 36px; height: 30px; flex: 0 0 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer; color: #555;
    border-radius: 6px;
    transition: background .15s;
}
.chat-tool:hover { background: rgba(0,0,0,0.08); }
.chat-tool.active { background: rgba(7,193,96,0.15); color: #07c160; }

/* 表情/上传扩展面板 */
.chat-ext {
    background: #f7f7f7; border-top: 1px solid #e5e5e5;
    flex: 0 0 auto; overflow: auto; max-height: 220px;
    transition: max-height .25s;
}
.chat-panel { padding: 14px; }

.emoji-grid {
    display: flex; flex-wrap: wrap;
}
.emoji-grid .emoji-item {
    width: 11.11%; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer; border-radius: 4px;
}
.emoji-grid .emoji-item:hover { background: rgba(0,0,0,0.06); }

.at-list { max-height: 200px; overflow-y: auto; }
.at-item {
    display: flex; align-items: center; padding: 8px 12px;
    cursor: pointer; border-radius: 6px;
}
.at-item:hover { background: rgba(0,0,0,0.05); }
.at-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #07c160; color: #fff; text-align: center;
    line-height: 32px; font-size: 12px; margin-right: 10px;
    overflow: hidden; flex-shrink: 0;
}
.at-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.at-name { font-size: 14px; color: #333; }

/* @提及浮动面板 */
.at-mention-panel {
    position: absolute; z-index: 200;
    background: #fff; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 240px; overflow-y: auto;
    min-width: 180px;
}
.at-mention-list { display: flex; flex-direction: column; padding: 4px; }
.at-mention-item {
    display: flex; align-items: center; padding: 8px 10px;
    cursor: pointer; border-radius: 6px;
}
.at-mention-item:hover, .at-mention-item.active { background: #f5f5f5; }
.at-mention-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #07c160; color: #fff; text-align: center;
    line-height: 32px; font-size: 12px; margin-right: 10px;
    overflow: hidden; flex-shrink: 0;
}
.at-mention-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.at-mention-name { font-size: 14px; color: #333; }

.plus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
.plus-item {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
}
.plus-icon {
    width: 56px; height: 56px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform .15s;
}
.plus-item:hover .plus-icon { transform: scale(1.05); }
.plus-label { font-size: 13px; color: #555; margin-top: 8px; }

/* 头像选择弹窗 */
.avatar-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-popup-inner {
    background: #fff;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.avatar-popup-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.avatar-popup-body {
    padding: 16px;
    height: 440px;
    max-height: 70vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 70px;
    gap: 12px;
}
.avatar-choice {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: block;
    background: #f5f5f5;
    border: 2px solid transparent;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.avatar-choice img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
}
.avatar-choice.active,
.avatar-choice:hover { border-color: #07c160; }

/* 头像图片可点击 */
#me-avatar { cursor: pointer; }

/* iframe 发现页 - 列表样式 */
#view-discover { height: 100%; background: #ededed; overflow-y: auto; }
.discover-list { padding: 8px 0; }
.discover-item {
    background: #fff;
    margin: 8px 14px;
    padding: 14px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: background .15s;
}
.discover-item:active { background: #f0f0f0; }
.discover-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #07c160, #2ba558);
    color: #fff;
    border-radius: 6px;
    text-align: center;
    line-height: 36px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}
.discover-text { flex: 1; min-width: 0; }
.discover-title { font-size: 15px; color: #222; font-weight: 500; }
.discover-url {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.discover-arrow { color: #ccc; font-size: 20px; margin-left: 8px; flex-shrink: 0; }

/* 发现页 iframe 弹窗 */
.discover-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}
.discover-popup-header {
    height: 44px;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    flex-shrink: 0;
}
#discover-popup-title {
    flex: 1;
    font-size: 15px;
    color: #222;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.discover-close-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: #666;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}
.discover-close-btn:active { color: #07c160; }
#discover-popup-frame {
    width: 100%;
    flex: 1;
    border: 0;
    background: #fff;
}
.empty-tip { padding: 40px; text-align: center; color: #999; }

/* 在线状态指示点 */
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    right: -3px;
    bottom: -3px;
}
.online-dot.online { background: #07c160; }
.online-dot.offline { background: #bbb; }

/* 好友列表 */
.friend-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.friend-row:hover { background: #f8f8f8; }
.friend-row:last-child { border-bottom: none; }
.friend-avatar-wrap { position: relative; margin-right: 12px; flex-shrink: 0; }
.friend-avatar {
    width: 38px; height: 38px; border-radius: 6px;
    background: #07c160;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.friend-dot {
    position: absolute; right: -2px; bottom: -2px;
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid #fff;
}
.friend-dot.online { background: #4cd964; }
.friend-dot.offline { background: #c8c8c8; }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 15px; color: #333; display: flex; align-items: center; }

/* 好友分组 */
.friend-group { background: #fff; }
.friend-group-header {
    display: flex; align-items: center;
    padding: 8px 14px; cursor: pointer;
    background: #f7f7f7; font-size: 13px; color: #666;
    border-top: 1px solid #eee;
}
.friend-group:first-child .friend-group-header { border-top: none; }
.friend-group-arrow { margin-right: 6px; font-size: 12px; transition: transform 0.2s; }
.friend-group-name { flex: 1; font-weight: 500; }
.friend-group-count { color: #999; margin-right: 4px; }
.group-create-btn {
    padding: 3px 10px;
    background: #07c160;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}
.group-create-btn:active { opacity: 0.8; }
.friend-group-body { background: #fff; }
.friend-group-body .friend-row {
    padding-left: 30px;
}

/* 好友页下拉菜单 */
.more-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.more-item:last-child { border-bottom: none; }
.more-item:active { background: #f8f8f8; }
.more-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.more-item .badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #fa5151;
    color: #fff;
    font-size: 11px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.more-divider {
    height: 6px;
    background: #f7f7f7;
    border-bottom: 1px solid #f0f0f0;
    border-top: 1px solid #f0f0f0;
}

/* 消息长按菜单 - 小优化 */
.context-menu.msg-menu {
    top: 40px;
    min-width: 130px;
}

/* 聊天列表中的红点（置顶标签） */
.pin-tag {
    display: inline-block;
    background: #07c160;
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    line-height: 1.4;
}

/* 消息发送状态 */
.msg-status {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
	position: absolute;
    bottom: 0px;
    right: 0px;
}
.msg.self .msg-status { align-self: flex-end; }

/* 广场页面 */
.square-header {
    height: 48px; background: #ededed; border-bottom: 1px solid #ddd;
    display: flex; align-items: center; padding: 0 14px; flex: 0 0 auto;
}
.square-title { flex: 1; font-weight: 600; font-size: 17px; text-align: center; }
.square-action-placeholder { width: 22px; }
.square-list { padding: 8px 14px; }
.float-post-btn {
    position: fixed; right: 20px; bottom: calc(60px + env(safe-area-inset-bottom));
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(7,193,96,.4);
    cursor: pointer; z-index: 50;
}
.float-post-btn:active { transform: scale(0.95); }
.float-post-btn i { font-size: 24px; }
.square-post {
    background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.square-post-header { display: flex; align-items: center; margin-bottom: 10px; }
.square-post-avatar {
    width: 36px; height: 36px; border-radius: 6px; background: #07c160;
    color: #fff; text-align: center; line-height: 36px; margin-right: 10px;
    font-size: 13px; overflow: hidden; flex-shrink: 0;
}
.square-post-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.square-post-author { font-weight: 500; font-size: 15px; }
.square-post-time { color: #999; font-size: 12px; margin-left: 8px; }
.square-post-title { font-size: 16px; font-weight: 600; color: #222; margin-bottom: 8px; }
.square-post-summary { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.square-post-meta { display: flex; gap: 16px; font-size: 12px; color: #999; }
.square-post-meta span { display: flex; align-items: center; gap: 4px; }

/* 发帖弹窗 */
.post-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
    display: none; align-items: flex-end; justify-content: center;
}
.post-modal-inner {
    background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    max-height: 85vh; display: flex; flex-direction: column;
}
.post-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid #f0f0f0; flex: 0 0 auto;
}
.post-modal-close { font-size: 20px; color: #999; cursor: pointer; display: flex; align-items: center; }
.post-modal-close i { font-size: 22px; }
.post-modal-title { font-size: 17px; font-weight: 600; color: #333; }
.post-modal-submit {
    font-size: 15px; color: #07c160; cursor: pointer; font-weight: 500;
    padding: 6px 14px; border-radius: 4px;
}
.post-modal-submit:active { opacity: 0.7; }
.post-modal-body { padding: 16px; flex: 1; overflow-y: auto; }
.post-modal input[type="text"] {
    width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px; font-size: 17px; font-weight: 500; background: transparent;
    outline: none;
}
.post-modal input[type="text"]::placeholder { color: #ccc; font-weight: normal; font-size: 15px; }
.post-modal textarea {
    width: 100%; padding: 12px 0; border: none; font-size: 15px;
    min-height: 120px; resize: none; font-family: inherit; outline: none;
    background: transparent; line-height: 1.6;
}
.post-modal textarea::placeholder { color: #ccc; }
.post-images-preview {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.post-image-item { position: relative; width: 80px; height: 80px; }
.post-image-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.post-image-remove {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%;
    text-align: center; line-height: 18px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.post-image-add {
    width: 80px; height: 80px; border: 1px dashed #ddd; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #999; font-size: 28px; background: #fafafa;
}
.post-image-add:active { background: #f0f0f0; }
.post-image-add i { font-size: 28px; color: #ccc; }

.post-image-item.uploading {
    background: #f5f5f5; border-radius: 8px; display: flex;
    align-items: center; justify-content: center;
}
.post-img-uploading {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 12px; color: #999;
}
.post-img-spinner {
    width: 20px; height: 20px; border: 2px solid #ddd;
    border-top-color: #07c160; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.img-preview-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0,0,0,0.5); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; cursor: pointer; z-index: 10;
    user-select: none;
}
.img-preview-nav:hover { background: rgba(0,0,0,0.7); }
.img-preview-prev { left: 20px; }
.img-preview-next { right: 20px; }
.img-preview-counter {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 14px; background: rgba(0,0,0,0.5);
    padding: 6px 14px; border-radius: 20px; z-index: 10;
}

/* toast */
#toast {
    position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.7); color: #fff; padding: 10px 18px; border-radius: 6px;
    z-index: 999; font-size: 14px; display: none;
}

/* 通用 */
.view { min-height: 100%; }
button:disabled { opacity: .5; }
