/* =============================================================================
   web/css/app.css
   微信风格界面：深色导航条 + 浅灰侧栏 + 白色聊天区 + 绿色自己气泡
   ============================================================================= */

:root {
    --green: #07c160;
    --green-dark: #06a552;
    --green-bubble: #95ec69;
    --rail-bg: #2e2e2e;
    --rail-hover: #3a3a3a;
    --sidebar-bg: #f7f7f7;
    --chat-bg: #f5f5f5;
    --panel: #ffffff;
    --border: #e5e5e5;
    --text: #191919;
    --text-secondary: #8b8b8b;
    --text-muted: #b2b2b2;
    --danger: #fa5151;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, .14);
    --radius: 8px;
    --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

/* 关键：本项目大量用 [hidden] 控制显隐，而 .app/.auth-form 等又有 display:grid/flex，
   不加重置的话 hidden 会被直接覆盖掉。 */
[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: #ededed;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button,
input,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =============================================================================
   登录 / 注册
   ============================================================================= */
.auth {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 64px 72px;
    color: #fff;
    background: radial-gradient(circle at 15% 20%, #0f3d2e 0, #08211a 42%, #05130f 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(0);
    opacity: .25;
    background: radial-gradient(circle, rgba(7, 193, 96, .55), transparent 65%);
}

.auth-brand::before {
    width: 520px;
    height: 520px;
    right: -180px;
    top: -160px;
}

.auth-brand::after {
    width: 420px;
    height: 420px;
    left: -160px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(32, 130, 255, .35), transparent 65%);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--green);
    box-shadow: 0 8px 24px rgba(7, 193, 96, .4);
}

.brand-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 4px;
}

.brand-title {
    position: relative;
    margin: 0 0 18px;
    font-size: 42px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-desc {
    position: relative;
    margin: 0 0 36px;
    font-size: 15px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .72);
}

.brand-points {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, .86);
}

.brand-points span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    font-size: 16px;
}

.brand-footer {
    position: relative;
    margin-top: 56px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .38);
    letter-spacing: .5px;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 40px;
    background: #f7f7f7;
}

.auth-card {
    width: min(400px, 100%);
    padding: 36px 36px 30px;
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.auth-tabs {
    display: flex;
    gap: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    position: relative;
    padding: 0 2px 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-tab.active {
    color: var(--text);
}

.auth-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--green);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
}

.field-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    letter-spacing: .5px;
}

.field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    outline: none;
    transition: border-color .18s, background .18s, box-shadow .18s;
}

.field input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, .12);
}

.form-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: #fff1f0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.primary-btn {
    height: 46px;
    margin-top: 6px;
    border-radius: var(--radius);
    background: var(--green);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    transition: background .18s, transform .06s;
}

.primary-btn:hover {
    background: var(--green-dark);
}

.primary-btn:active {
    transform: translateY(1px);
}

.form-hint {
    margin: 4px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-hint a {
    color: var(--green);
    text-decoration: none;
}

/* =============================================================================
   主界面布局
   ============================================================================= */
.app {
    display: grid;
    grid-template-columns: 68px 320px minmax(0, 1fr);
    height: 100vh;
    background: var(--chat-bg);
}

/* ------------------------------- 左侧导航 ------------------------------- */
.rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 0 18px;
    background: var(--rail-bg);
}

.rail-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3a7afe, #7b5cff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
}

.rail-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    color: #9d9d9d;
    transition: background .16s, color .16s;
}

.rail-btn:hover {
    background: var(--rail-hover);
    color: #d8d8d8;
}

.rail-btn.active {
    color: var(--green);
}

.rail-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
}

.rail-spacer {
    flex: 1;
}

/* ------------------------------- 侧栏列表 ------------------------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 18px 0 22px;
}

.sidebar-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 1px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #666;
    transition: background .16s, color .16s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, .06);
    color: #222;
}

.icon-btn svg {
    width: 19px;
    height: 19px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin: 0 16px 12px;
    padding: 0 10px;
    border-radius: 6px;
    background: #ececec;
    color: #9a9a9a;
}

.search-box svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
}

.search-box input::placeholder {
    color: #a8a8a8;
}

.list-scroll {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
}

.list-scroll::-webkit-scrollbar,
.messages::-webkit-scrollbar {
    width: 6px;
}

.list-scroll::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(0, 0, 0, .16);
}

.conv-list,
.contact-list {
    display: flex;
    flex-direction: column;
}

.conv-item,
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    cursor: pointer;
    transition: background .14s;
}

.conv-item:hover,
.contact-item:hover {
    background: #ededed;
}

.conv-item.active,
.contact-item.active {
    background: #e3e3e3;
}

.avatar {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
}

.avatar.small {
    width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: 6px;
}

.avatar .online-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--sidebar-bg);
    border-radius: 50%;
    background: #c4c4c4;
}

.avatar .online-dot.on {
    background: var(--green);
}

.conv-main,
.contact-main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.conv-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.conv-name,
.contact-name {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.conv-time {
    flex: none;
    font-size: 11.5px;
    color: var(--text-muted);
}

.conv-preview {
    overflow: hidden;
    font-size: 12.5px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.contact-tag {
    padding: 1px 6px;
    border-radius: 4px;
    background: #e8f7ee;
    color: var(--green-dark);
    font-size: 10.5px;
}

.contact-tag.off {
    background: #eee;
    color: #999;
}

.section-label {
    padding: 12px 18px 6px;
    font-size: 11.5px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.list-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 48px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.list-empty-icon {
    font-size: 30px;
    opacity: .7;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c4c4c4;
}

.conn-dot.on {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, .16);
}

.conn-dot.off {
    background: var(--danger);
}

/* ------------------------------- 聊天区 ------------------------------- */
.chat {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--chat-bg);
}

.chat-empty {
    display: grid;
    place-items: center;
    height: 100%;
}

.chat-empty-inner {
    text-align: center;
    color: var(--text-secondary);
}

.chat-empty-logo {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 20px;
    background: #e4e4e4;
    color: #b0b0b0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
}

.chat-empty-inner h3 {
    margin: 0 0 8px;
    color: #8a8a8a;
    font-size: 17px;
    font-weight: 500;
}

.chat-empty-inner p {
    margin: 0;
    font-size: 13px;
}

.chat-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0 24px 0 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.chat-head-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chat-head-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c4c4c4;
}

.presence-dot.online {
    background: var(--green);
}

.chat-head-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-head-actions {
    margin-left: auto;
}

.peer-uid {
    font-size: 11.5px;
    color: var(--text-muted);
    letter-spacing: .5px;
}

.back-btn {
    display: none;
}

.messages {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px 8px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}

.load-more {
    display: flex;
    justify-content: center;
    padding: 4px 0 16px;
}

.ghost-btn {
    padding: 6px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .05);
    color: var(--text-secondary);
    font-size: 12px;
    transition: background .16s;
}

.ghost-btn:hover {
    background: rgba(0, 0, 0, .08);
}

.day-divider {
    display: flex;
    justify-content: center;
    margin: 6px 0;
}

.day-divider span {
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .07);
    color: #fff;
    background: #dadada;
    font-size: 11.5px;
}

.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 78%;
}

.msg-row.mine {
    flex-direction: row-reverse;
    margin-left: auto;
}

.msg-avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    user-select: none;
}

.msg-body {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.msg-row.mine .msg-body {
    justify-items: end;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.bubble {
    position: relative;
    padding: 10px 13px;
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    font-size: 14.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.bubble::before {
    content: "";
    position: absolute;
    top: 13px;
    left: -5px;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
}

.msg-row.mine .bubble {
    background: var(--green-bubble);
}

.msg-row.mine .bubble::before {
    left: auto;
    right: -5px;
}

.msg-status {
    font-size: 11px;
    color: var(--text-muted);
}

.msg-status.failed {
    color: var(--danger);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 900px;
    margin: 8px auto 0;
    padding-left: 46px;
    font-size: 12px;
    color: var(--text-secondary);
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #9a9a9a;
    animation: blink 1.2s infinite;
}

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

.typing-dots i:nth-child(3) {
    animation-delay: .36s;
}

@keyframes blink {
    0%, 60%, 100% { opacity: .25; }
    30% { opacity: 1; }
}

/* ------------------------------- 输入区 ------------------------------- */
.composer {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 24px 18px;
    background: var(--panel);
    border-top: 1px solid var(--border);
}

.composer-tools {
    display: flex;
    align-items: center;
    padding-bottom: 6px;
}

#btn-emoji {
    font-size: 20px;
    line-height: 1;
}

.composer textarea {
    flex: 1;
    max-height: 140px;
    min-height: 40px;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    outline: none;
    resize: none;
    font-size: 14.5px;
    line-height: 1.5;
}

.send-btn {
    flex: none;
    height: 38px;
    padding: 0 22px;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: background .16s;
}

.send-btn:hover {
    background: var(--green-dark);
}

.emoji-panel {
    position: absolute;
    left: 20px;
    bottom: 74px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    width: 372px;
    max-height: 210px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
    z-index: 30;
}

.emoji-panel button {
    height: 32px;
    border-radius: 6px;
    font-size: 19px;
    line-height: 1;
}

.emoji-panel button:hover {
    background: #f0f0f0;
}

/* ------------------------------- 提示 / 连接状态 ------------------------------- */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(28, 28, 28, .92);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.conn-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    background: #fff3cd;
    color: #8a6100;
    font-size: 12.5px;
    z-index: 90;
}

.conn-banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e0a800;
    animation: blink 1s infinite;
}

/* =============================================================================
   群聊 / 好友 / 弹窗
   ============================================================================= */
.avatar .group-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    height: 14px;
    padding: 0 4px;
    border-radius: 7px;
    border: 1px solid var(--sidebar-bg);
    background: #e8f7ee;
    color: var(--green-dark);
    font-size: 9px;
    line-height: 12px;
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-action {
    padding: 3px 7px;
    border-radius: 5px;
    color: var(--green-dark);
    font-size: 11.5px;
    letter-spacing: 0;
}

.section-action:hover {
    background: #e8f7ee;
}

.entry-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    background: #e8f7ee;
    font-size: 20px;
}

.system-msg {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}

.system-msg span {
    max-width: 80%;
    padding: 4px 10px;
    border-radius: 10px;
    background: #e2e2e2;
    color: #8a8a8a;
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
}

.msg-name {
    padding-left: 2px;
    color: #9a9a9a;
    font-size: 11.5px;
}

.msg-avatar-spacer {
    flex: none;
    width: 36px;
}

/* ------------------------------- 弹窗 ------------------------------- */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 32px));
    max-height: min(78vh, 720px);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--border);
}

.modal-field {
    display: grid;
    gap: 6px;
}

.modal-field > span {
    color: var(--text-secondary);
    font-size: 12px;
}

.modal-input,
.modal-textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    outline: none;
}

.modal-textarea {
    height: auto;
    min-height: 76px;
    padding: 10px 12px;
    resize: vertical;
}

.modal-input:focus,
.modal-textarea:focus {
    border-color: var(--green);
    background: #fff;
}

.btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    font-size: 13px;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--green-dark);
}

.btn-ghost {
    background: #f0f0f0;
    color: #444;
}

.btn-ghost:hover {
    background: #e6e6e6;
}

.btn-danger {
    background: #fff1f0;
    color: var(--danger);
}

.btn-danger:hover {
    background: #ffe3e1;
}

.btn-small {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
}

.list-row:last-child {
    border-bottom: none;
}

.row-main {
    display: grid;
    flex: 1;
    gap: 3px;
    min-width: 0;
}

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

.row-sub {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker {
    display: grid;
    gap: 4px;
    max-height: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-y: auto;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.picker-item:hover {
    background: #f5f5f5;
}

.picker-item input {
    accent-color: var(--green);
}

.picker-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12.5px;
}

/* =============================================================================
   响应式：窄屏变成「列表 / 聊天」两页
   ============================================================================= */
@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .app {
        grid-template-columns: 1fr;
    }

    .rail {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: row;
        justify-content: space-around;
        height: 58px;
        padding: 6px 12px;
        z-index: 40;
    }

    .rail-avatar {
        margin: 0;
    }

    .rail-btn {
        width: 48px;
        height: 44px;
    }

    .rail-spacer {
        display: none;
    }

    .sidebar {
        height: calc(100vh - 58px);
        border-right: none;
    }

    .chat {
        position: fixed;
        inset: 0;
        bottom: 58px;
        z-index: 50;
        display: none;
    }

    .chat.mobile-open {
        display: flex;
    }

    .back-btn {
        display: grid;
    }

    .messages {
        padding: 14px 14px 6px;
    }

    .composer {
        padding: 10px 12px 14px;
    }

    .emoji-panel {
        left: 8px;
        right: 8px;
        width: auto;
        grid-template-columns: repeat(8, 1fr);
    }

    .msg-row {
        max-width: 86%;
    }
}
