* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #1a1a1a; }

.topbar { height: 56px; background: linear-gradient(90deg, #ff7b00, #ff9a3d); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: #fff; }
.brand { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.5px; }
.nav-login { display: inline-flex; align-items: center; }
.nav-login-link { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 6px 12px; border-radius: 4px; transition: all .3s ease; }
.nav-login-link:hover { color: #fff; background-color: rgba(255,255,255,0.22); }
.nav-login .uname { color: #fff; font-size: 0.95rem; margin-right: 8px; }

.chat-app { display: flex; height: calc(100vh - 56px); }

.sidebar { width: 280px; background: #fff; border-right: 1px solid #eee; display: flex; flex-direction: column; }
.side-tabs { display: flex; }
.side-tab { flex: 1; padding: 12px 0; background: #fafafa; border: none; border-bottom: 2px solid transparent; font-size: 1rem; font-weight: 600; color: #888; cursor: pointer; }
.side-tab.active { color: #ff7b00; border-bottom-color: #ff7b00; background: #fff; }
.side-actions { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.mini-btn { width: 100%; padding: 8px; background: #fff; border: 1px solid #ff7b00; color: #ff7b00; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: all .2s; }
.mini-btn:hover { background: #ff7b00; color: #fff; }
.list { flex: 1; overflow-y: auto; }
.list-item { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.list-item:hover { background: #fafafa; }
.list-item.active { background: #fff4ea; }
.list-name { font-size: 0.98rem; font-weight: 500; }
.list-sub { font-size: 0.8rem; color: #999; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.badge { background: #ff3b30; color: #fff; font-size: 0.72rem; border-radius: 10px; padding: 1px 7px; min-width: 18px; text-align: center; }
.list-item .row { overflow: hidden; }

.chat-main { flex: 1; display: flex; flex-direction: column; background: #f0f2f5; }
.conv-header { height: 54px; line-height: 54px; padding: 0 18px; background: #fff; border-bottom: 1px solid #eee; font-weight: 600; }
.msg-area { flex: 1; overflow-y: auto; padding: 16px 18px; }
.msg { display: flex; margin-bottom: 14px; }
.msg.me { flex-direction: row-reverse; }
.msg .bubble { max-width: 60%; padding: 9px 13px; border-radius: 10px; background: #fff; font-size: 0.95rem; line-height: 1.5; word-break: break-word; }
.msg.me .bubble { background: #ff7b00; color: #fff; }
.msg .who { font-size: 0.72rem; color: #999; margin-bottom: 3px; }
.composer { display: flex; padding: 12px 16px; background: #fff; border-top: 1px solid #eee; }
.msg-input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem; outline: none; }
.msg-input:focus { border-color: #ff7b00; }
.send-btn { margin-left: 10px; padding: 0 22px; background: #ff7b00; color: #fff; border: none; border-radius: 6px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.send-btn:disabled { background: #ffc699; cursor: not-allowed; }

.auth-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.auth-modal.show { display: flex; }
.auth-box { background: #fff; width: 320px; max-width: 90%; border-radius: 10px; padding: 28px 24px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.auth-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.5rem; color: #999; cursor: pointer; line-height: 1; }
.auth-tabs { display: flex; margin-bottom: 18px; border-radius: 6px; overflow: hidden; border: 1px solid #eee; }
.auth-tab { flex: 1; padding: 10px 0; background: #f5f5f5; border: none; font-size: 1rem; font-weight: 600; color: #888; cursor: pointer; transition: all .25s; }
.auth-tab.active { background: #ff7b00; color: #fff; }
.auth-input { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; outline: none; box-sizing: border-box; }
.auth-input:focus { border-color: #ff7b00; }
.auth-submit { width: 100%; padding: 10px; background: #ff7b00; color: #fff; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .3s; }
.auth-submit:hover { background: #e56d00; }
.auth-msg { color: #e53935; text-align: center; margin-top: 10px; font-size: 0.9rem; min-height: 1em; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(0,0,0,0.82); color: #fff; padding: 10px 18px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 2100; font-size: 0.95rem; }
.toast.show { opacity: 1; }
.auth-title { color: #ff7b00; text-align: center; margin: 0 0 16px; font-size: 1.25rem; }
.group-members { max-height: 200px; overflow-y: auto; margin-bottom: 14px; }
.group-member { display: flex; align-items: center; padding: 6px 4px; font-size: 0.92rem; }
.group-member input { margin-right: 8px; }

.ban-banner { display: none; background: #3a1c1c; color: #ff9a9a; border-bottom: 1px solid #5a2a2a; padding: 10px 14px; font-size: 0.9rem; }
