/* ================= 基础（微信风格：绿 / 灰 / 白） ================= */
:root {
    --green: #07c160;
    --green-dark: #06ad56;
    --green-bubble: #95ec69;
    --bg: #ededed;
    --panel: #f7f7f7;
    --line: #e6e6e6;
    --text: #191919;
    --muted: #7f7f7f;
    --weak: #b2b2b2;
    --danger: #fa5151;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 14px; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
a { color: #576b95; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* 图标 */
.ico { width: 20px; height: 20px; display: block; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }

/* ================= 登录 / 注册 ================= */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #f2fbf5 0%, #f7f7f7 55%, #eef7f1 100%);
    padding: 20px;
}
.auth-card {
    width: 380px; max-width: 100%; background: #fff; border-radius: 14px; padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .06); border: 1px solid #f0f0f0;
}
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card label { display: block; font-size: 13px; color: #5b5b5b; margin: 14px 0 6px; }
.auth-card input {
    width: 100%; padding: 12px; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; background: #fafafa;
}
.auth-card input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(7, 193, 96, .1); }
.auth-card .btn-primary { width: 100%; margin-top: 22px; padding: 12px; font-size: 15px; }
.auth-card .switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }
.auth-invite {
    background: #e8f8ee; border: 1px solid #bfe9cd; color: #079e4e;
    border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.auth-tip { background: #f6f6f6; border-radius: 8px; padding: 10px 12px; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.7; }

/* ================= 按钮 ================= */
.btn {
    border: 1px solid transparent; background: #f2f2f2; color: var(--text);
    padding: 8px 14px; border-radius: 6px; font-size: 13px; transition: background .15s, color .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: #e9e9e9; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-line { background: #fff; border-color: var(--line); color: #4a4a4a; }
.btn-line:hover { background: #f2f2f2; }
.btn-danger { background: #fff; border-color: #f3c9cb; color: var(--danger); }
.btn-danger:hover { background: #fdf2f2; border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn-sm .ico { width: 15px; height: 15px; }
.btn-ghost { background: transparent; border: 0; color: #5b5b5b; padding: 6px 8px; border-radius: 6px; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn {
    width: 34px; height: 34px; border: 0; background: transparent; color: #5b5b5b;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.icon-btn.active { color: var(--green); }

/* ================= 主框架 ================= */
.app {
    display: flex; height: 100vh; height: 100dvh; max-width: 1240px; margin: 0 auto;
    background: #fff; overflow: hidden; box-shadow: 0 0 40px rgba(0, 0, 0, .05);
}
.sidebar {
    width: 308px; min-width: 308px; display: flex; flex-direction: column;
    background: var(--panel); border-right: 1px solid var(--line);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 18px 12px 12px; }
.avatar {
    width: 40px; height: 40px; border-radius: 8px; background: #dcdcdc; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px;
    overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; border-radius: 6px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 10px; font-size: 22px; }
.avatar.group { background: linear-gradient(135deg, #4ecb7a, #07c160); color: #fff; }
.avatar.group .ico { width: 22px; height: 22px; }
.me-info { flex: 1; min-width: 0; }
.me-info .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info .uid { font-size: 12px; color: var(--muted); margin-top: 2px; cursor: pointer; }
.me-info .uid.inviter { color: var(--green); cursor: default; margin-top: 1px; }
.side-actions { display: flex; gap: 8px; padding: 0 12px 10px; }
.side-actions .btn { flex: 1; height: 34px; font-size: 13px; border: 1px solid var(--line); background: #fff; position: relative; }
.side-actions .btn:hover { background: #f2f2f2; }
.side-actions .btn .ico { color: var(--green); }
.side-search {
    margin: 0 12px 8px; display: flex; align-items: center; gap: 6px;
    background: #e9e9e9; border-radius: 6px; padding: 0 8px; height: 34px;
}
.side-search .ico { color: #9a9a9a; }
.side-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
    font-size: 13px; color: var(--text); padding: 0;
}
.side-search input::placeholder { color: #9a9a9a; }
.side-search .icon-btn { width: 26px; height: 26px; }
.side-search .icon-btn .ico { width: 17px; height: 17px; }
.badge {
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
    font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 1;
}
.badge.mention { background: #fa9d3b; }
.side-actions .badge { position: absolute; top: -6px; right: -6px; }
.conv-list { flex: 1; overflow-y: auto; padding: 0 0 10px; }
.conv-item {
    display: flex; gap: 0; align-items: center; padding: 10px 12px;
    cursor: pointer; position: relative; transition: background .12s;
}
.conv-item:hover { background: #ececec; }
.conv-item.active { background: #dedede; }
/* 头像区 30% / 名字区 70% */
.conv-av {
    flex: 0 0 30%; max-width: 84px; display: flex; align-items: center;
    position: relative; align-self: stretch;
}
.conv-av .avatar {
    width: 78%; max-width: 62px; height: auto; aspect-ratio: 1 / 1;
    border-radius: 10px; font-size: 18px; cursor: pointer; transition: transform .12s;
}
.conv-av .avatar:hover { transform: scale(1.04); }
.conv-av .badge { position: absolute; top: 2px; right: calc(22% - 6px); box-shadow: 0 0 0 2px var(--panel); }
.conv-item.active .conv-av .badge { box-shadow: 0 0 0 2px #dedede; }
.conv-main { flex: 1 1 70%; min-width: 0; padding-left: 10px; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 400; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: #a8a8a8; flex: none; }
.conv-preview { font-size: 12px; color: #9a9a9a; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-empty { text-align: center; color: #a8a8a8; font-size: 13px; padding: 40px 16px; line-height: 1.9; }

/* ================= 聊天区 ================= */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: #f5f5f5; }
.chat-header {
    height: 60px; display: flex; align-items: center; gap: 8px;
    padding: 0 18px; border-bottom: 1px solid var(--line); background: #f5f5f5; flex: none;
}
.chat-avatar {
    width: 36px; height: 36px; border-radius: 8px; flex: none; overflow: hidden;
    background: #dcdcdc; color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px; cursor: pointer; transition: opacity .12s;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.group { background: linear-gradient(135deg, #4ecb7a, #07c160); }
.chat-avatar.group .ico { width: 20px; height: 20px; }
.chat-avatar:hover { opacity: .82; }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-title > span:first-child {
    font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.chat-tools { display: flex; gap: 2px; flex: none; }
.only-mobile { display: none; }
.notice-bar {
    padding: 7px 18px; background: #fdf6e3; color: #9a7b2e; font-size: 12px;
    border-bottom: 1px solid #f3e9cd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.messages { flex: 1; overflow-y: auto; padding: 18px 20px 10px; overscroll-behavior: contain; }
.empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #a8a8a8; font-size: 14px; }

/* 消息 */
.msg { display: flex; gap: 10px; margin-bottom: 18px; align-items: flex-start; }
.msg.self { flex-direction: row-reverse; }
.msg-body { max-width: 66%; min-width: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: 12px; color: #a8a8a8; }
.msg.self .msg-head { justify-content: flex-end; }
.msg-name { font-size: 12px; color: #8c8c8c; }
.msg-time { font-size: 11px; color: #b2b2b2; }
.bubble {
    background: #fff; padding: 10px 13px; border-radius: 6px; position: relative;
    font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.msg.self .bubble { background: var(--green-bubble); color: #191919; box-shadow: none; }
.bubble a { color: #3a6ea5; text-decoration: underline; }
.bubble.mention-me { box-shadow: 0 0 0 2px #fa9d3b; }
.bubble img.chat-img { max-width: 240px; max-height: 240px; border-radius: 4px; display: block; cursor: zoom-in; }
.quote {
    border-left: 2px solid #c9c9c9; background: rgba(0, 0, 0, .04); padding: 5px 8px; border-radius: 3px;
    font-size: 12px; color: #7f7f7f; margin-bottom: 6px; cursor: pointer; max-height: 62px; overflow: hidden;
}
.msg.self .quote { border-left-color: rgba(0, 0, 0, .18); background: rgba(0, 0, 0, .06); color: #4a4a4a; }
.quote b { font-weight: 600; }
.fwd-tag { font-size: 11px; color: #9a9a9a; margin-bottom: 4px; }
.msg.self .fwd-tag { color: #5a7d4a; }
.recalled { font-style: normal; color: #9a9a9a; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.msg.self .recalled { color: #5f7a52; }
.recalled .btn-sm { background: rgba(255, 255, 255, .75); }
.sys-msg { text-align: center; margin: 12px 0; }
.sys-msg span { background: rgba(0, 0, 0, .06); color: #8c8c8c; font-size: 12px; padding: 3px 10px; border-radius: 4px; }
.read-state { font-size: 11px; color: #b2b2b2; margin-top: 4px; text-align: right; }
.read-state.read { color: var(--green); }
.msg-wrap { position: relative; }
.msg-actions {
    position: absolute; top: -18px; right: 0; display: none; gap: 2px; background: #fff;
    border: 1px solid #e6e6e6; border-radius: 8px; padding: 3px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12); z-index: 5; white-space: nowrap;
}
.msg.self .msg-actions { right: auto; left: 0; }
.msg.show-actions .msg-actions { display: flex; }
.msg-actions button {
    width: auto; min-width: 46px; height: 30px; border: 0; background: transparent; color: #4a4a4a;
    border-radius: 6px; padding: 0 10px; font-size: 13px; line-height: 30px;
    font-family: inherit; cursor: pointer; flex: none;
}
.msg-actions button:hover { background: #f1f1f1; color: #191919; }
.msg-actions button:active { background: #e8e8e8; }
.time-sep { text-align: center; font-size: 11px; color: #a8a8a8; margin: 16px 0; }
.load-more { text-align: center; padding: 4px 0 12px; }
.load-more button { font-size: 12px; color: #8c8c8c; background: transparent; border: 0; }
.load-more button:hover { color: var(--green); }
.msg.highlight .bubble { animation: hl 1.4s ease; }
@keyframes hl { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px #fa9d3b; } }

/* ================= 输入区 ================= */
.composer { border-top: 1px solid var(--line); background: #fff; padding: 8px 16px 10px; position: relative; flex: none; }
.composer .toolbar { display: flex; align-items: center; gap: 2px; padding-bottom: 4px; }
.tool-btn {
    width: 46px; height: 46px; border: 0; background: transparent; color: #5b5b5b;
    border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.tool-btn:hover { background: #f0f0f0; color: #191919; }
.tool-btn .ico { width: 42px; height: 42px; }
.composer .hint { margin-left: auto; font-size: 11px; color: #b2b2b2; }
.input-row { display: flex; align-items: flex-end; gap: 10px; }
.input-row textarea {
    flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; border: 0; outline: none;
    font-size: 14px; line-height: 1.6; font-family: inherit; padding: 6px 0; background: transparent; color: var(--text);
}
.btn-send {
    flex: none; height: 34px; padding: 0 20px; border: 0; border-radius: 5px;
    background: var(--green); color: #fff; font-size: 14px; transition: background .15s;
}
.btn-send:hover { background: var(--green-dark); }
.btn-send:disabled { background: #d8d8d8; color: #fff; cursor: default; }
.reply-bar {
    display: flex; align-items: center; gap: 8px; background: #f2f2f2; border-left: 3px solid var(--green);
    padding: 6px 10px; border-radius: 4px; font-size: 12px; color: #5b5b5b; margin-bottom: 6px;
}
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar button { border: 0; background: transparent; color: #9a9a9a; font-size: 16px; line-height: 1; padding: 2px; }
.emoji-panel {
    position: absolute; bottom: 104px; left: 16px; width: 330px; max-height: 220px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 26px rgba(0, 0, 0, .12);
    padding: 8px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; z-index: 20;
}
.emoji-panel button { border: 0; background: transparent; font-size: 19px; padding: 4px; border-radius: 5px; }
.emoji-panel button:hover { background: #f0f0f0; }
.mention-panel {
    position: absolute; bottom: 104px; left: 96px; width: 210px; max-height: 220px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 26px rgba(0, 0, 0, .12);
    padding: 6px; z-index: 20;
}
.mention-panel button {
    display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent;
    padding: 7px 8px; border-radius: 5px; font-size: 13px; text-align: left; color: var(--text);
}
.mention-panel button:hover { background: #f0f0f0; }

/* ================= 弹窗 ================= */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: flex; align-items: center;
    justify-content: center; z-index: 100; padding: 20px;
}
.modal {
    background: #fff; border-radius: 10px; width: 440px; max-width: 100%; max-height: 86vh;
    display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
}
.modal.wide { width: 600px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 500; }
.modal-head .close {
    border: 0; background: transparent; color: #9a9a9a; padding: 4px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
}
.modal-head .close:hover { background: #f2f2f2; color: #191919; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input[type=text], .field input[type=password], .field input[type=file], .field textarea, .field select {
    width: 100%; padding: 9px 11px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 13px;
    outline: none; font-family: inherit; background: #fafafa; color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); background: #fff; }
.field textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #f4f4f4; }
.list-item:last-child { border-bottom: 0; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .t { font-size: 13px; font-weight: 500; }
.list-item .info .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-empty { text-align: center; color: #a8a8a8; font-size: 13px; padding: 24px 0; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 3px; background: #f0f0f0; color: #7f7f7f; }
.pill.owner { background: #fff3d6; color: #a2761b; }
.pill.admin { background: #e6f7ee; color: #079e4e; }
.muted-badge { font-size: 11px; color: var(--danger); }
.member-ops { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.member-ops button {
    font-size: 11px; padding: 3px 7px; border-radius: 4px; border: 1px solid #e6e6e6;
    background: #fff; color: #5b5b5b;
}
.member-ops button:hover { border-color: #c9c9c9; }
.forward-item { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 6px; cursor: pointer; }
.forward-item:hover { background: #f2f2f2; }
.forward-item .t { font-size: 13px; }
.search-result { padding: 10px 8px; border-radius: 6px; cursor: pointer; border-bottom: 1px solid #f4f4f4; }
.search-result:hover { background: #f7f7f7; }
.search-result .t { font-size: 13px; }
.search-result .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.search-result mark { background: #fff2b8; color: inherit; padding: 0 1px; }

/* ================= 图片预览 / 截图编辑 ================= */
.img-view { background: rgba(0, 0, 0, .78); }
.img-view img { max-width: 88vw; max-height: 82vh; border-radius: 4px; background: #fff; }
.img-close {
    position: absolute; top: 20px; right: 20px; width: 42px; height: 42px;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background .15s;
}
.img-close:hover { background: rgba(255, 255, 255, .34); }
.img-close .ico { width: 20px; height: 20px; }
.img-tip {
    position: absolute; left: 0; right: 0; bottom: 18px; text-align: center;
    color: rgba(255, 255, 255, .62); font-size: 12px; pointer-events: none;
}

/* ================= 个人主页 / 群介绍 ================= */
.profile-modal { width: 400px; }
.profile-hero { text-align: center; padding: 6px 0 2px; }
.profile-hero .avatar {
    width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 14px; font-size: 28px;
}
.profile-hero .avatar .ico { width: 34px; height: 34px; }
.profile-name-row {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 17px; font-weight: 600; flex-wrap: wrap;
}
.profile-uid { font-size: 12px; color: var(--muted); margin-top: 6px; }
.profile-field { margin-top: 14px; }
.profile-field > label { display: block; font-size: 12px; color: #8a919f; margin-bottom: 6px; }
.profile-field > div {
    font-size: 14px; line-height: 1.65; color: #333; background: #f7f8fa;
    border-radius: 8px; padding: 10px 12px; word-break: break-word;
}
.gi-notice { white-space: pre-wrap; }
.profile-field .gi-members { display: flex; flex-wrap: wrap; gap: 8px; background: transparent; padding: 0; }
.gi-members .avatar { width: 34px; height: 34px; font-size: 13px; border-radius: 6px; }
.profile-actions { margin-top: 16px; }
.profile-actions .btn { width: 100%; }
.shot-modal { width: 920px; max-width: 96vw; }
.shot-canvas-wrap { background: #f0f0f0; padding: 10px; border-radius: 6px; text-align: center; overflow: auto; max-height: 62vh; }
.shot-canvas-wrap canvas { max-width: 100%; cursor: crosshair; border-radius: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.shot-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.shot-tools button {
    border: 1px solid #e0e0e0; background: #fff; padding: 6px 11px; border-radius: 5px;
    font-size: 12px; color: #4a4a4a;
}
.shot-tools button:hover { background: #f5f5f5; }
.shot-tools button.active { background: var(--green); border-color: var(--green); color: #fff; }
.shot-tools .colors { display: flex; gap: 4px; margin-left: 4px; }
.shot-tools .colors i {
    width: 18px; height: 18px; border-radius: 50%; display: block; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 0 0 1px #e0e0e0;
}
.shot-tools .colors i.active { box-shadow: 0 0 0 2px var(--green); }

/* ================= Toast ================= */
.toast-wrap {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200;
    display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
    background: rgba(0, 0, 0, .78); color: #fff; font-size: 13px; padding: 9px 16px;
    border-radius: 6px; animation: tin .2s ease; max-width: 80vw;
}
.toast.err { background: rgba(250, 81, 81, .95); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* @提醒高亮 */
.at { color: #2b7bd4; }
.msg.self .at { color: #1f6f3f; }

/* 实名认证标识 */
.v-badge {
    display: inline-flex; align-items: center; gap: 3px;
    background: #e8f8ee; border: 1px solid #bfe9cd; color: #079e4e;
    font-size: 11px; font-weight: 600; line-height: 1;
    padding: 3px 8px; border-radius: 4px; vertical-align: middle;
}
.v-badge.sm {
    background: var(--green); border-color: var(--green); color: #fff;
    font-size: 10px; padding: 2px 5px; border-radius: 8px; flex: none; margin-right: 2px;
}

/* ================= 平板 ================= */
@media (max-width: 1024px) {
    .sidebar { width: 250px; min-width: 250px; }
    .msg-body { max-width: 74%; }
    .chat-header { padding: 0 14px; }
    .messages { padding: 14px 16px 8px; }
    .composer { padding: 8px 14px 10px; }
    .composer .hint { display: none; }
}

/* ================= 手机 ================= */
@media (max-width: 640px) {
    .app { max-width: none; box-shadow: none; }
    .sidebar { width: 100%; min-width: 0; border-right: 0; }
    .chat { display: none; }
    body.chat-open .sidebar { display: none; }
    body.chat-open .chat { display: flex; }
    .only-mobile { display: inline-flex; }
    .side-head { padding: 14px 12px 10px; }
    .side-head .avatar { width: 44px; height: 44px; }
    .conv-item { padding: 10px 8px; }
    .conv-av { max-width: 78px; }
    .conv-av .avatar { max-width: 54px; }
    .chat-header { height: 52px; padding: 0 10px; gap: 4px; }
    .chat-title > span:first-child { font-size: 15px; }
    .messages { padding: 12px 10px 8px; }
    .msg { gap: 8px; margin-bottom: 16px; }
    .msg-body { max-width: 76%; }
    .bubble { padding: 9px 11px; }
    .bubble img.chat-img { max-width: 170px; max-height: 170px; }
    .msg-actions { top: auto; bottom: -14px; }
    .msg-actions button { height: 34px; line-height: 34px; font-size: 14px; padding: 0 12px; min-width: 52px; }
    .composer { padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); }
    .tool-btn { width: 46px; height: 46px; }
    .composer .hint { display: none; }
    .input-row textarea { font-size: 15px; }
    .btn-send { padding: 0 16px; height: 36px; }
    .emoji-panel { left: 8px; right: 8px; width: auto; bottom: calc(100% + 4px); grid-template-columns: repeat(8, 1fr); }
    .mention-panel { left: 8px; width: 210px; bottom: calc(100% + 4px); }
    .modal-mask { padding: 0; align-items: flex-end; }
    .modal {
        width: 100%; max-width: 100%; max-height: 90vh;
        border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom);
    }
    .modal.wide, .shot-modal { width: 100%; max-height: 94vh; }
    .img-view { align-items: center; padding: 12px; }
    .img-close { top: 12px; right: 12px; width: 38px; height: 38px; }
    .img-tip { bottom: calc(12px + env(safe-area-inset-bottom)); }
    .toast-wrap { top: auto; bottom: 24px; }
    .modal-foot .btn, .btn-send { min-height: 38px; }
}
