﻿:root {
  --brand: #1a73e8;
  --brand-dark: #0b57d0;
  --brand-soft: #e8f1ff;
  --bg: #eaf0f7;
  --panel: #ffffff;
  --sidebar: #f7f9fc;
  --ink: #1f2329;
  --muted: #8a9099;
  --line: #e6ebf2;
  --soft: #f2f5f9;
  --green: #22c55e;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(900px 600px at 12% 0%, #dbeafe 0%, transparent 55%),
    radial-gradient(800px 600px at 100% 100%, #dff5ef 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------- 应用外框 -------------------------------- */

.app {
  position: relative;
  display: flex;
  width: min(1180px, 100%);
  height: calc(100vh - 40px);
  height: min(820px, calc(100vh - 40px));
  height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  background: var(--panel);
  border-radius: 22px;
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.35), 0 2px 8px rgba(15, 23, 42, 0.04);
}

.workspace {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

/* --------------------------------- 侧边栏 -------------------------------- */

.sidebar {
  width: 312px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #1a73e8, #4d9bff);
  box-shadow: 0 8px 18px -8px rgba(26, 115, 232, 0.8);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

.icon-btn.muted {
  opacity: 0.5;
}

.search-box {
  padding: 0 12px 8px;
}

.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #edf2f8;
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  background: #fff;
  border-color: #bcd7ff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.08);
}

.contact-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: #cdd6e2 transparent;
}

.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.contact:hover {
  background: #edf4ff;
}

.contact.active {
  background: #e3efff;
}

.contact-main {
  flex: 1;
  min-width: 0;
}

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

.contact-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}

.contact-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}

.contact-preview {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.contact-empty {
  padding: 36px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.contact-empty strong {
  display: block;
  margin-bottom: 6px;
  color: #5b6472;
  font-size: 14px;
}

.avatar-wrap {
  position: relative;
  flex: none;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
  background: linear-gradient(135deg, #1a73e8, #4d9bff);
}

.presence-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--sidebar);
  border-radius: 50%;
  background: #c3cad6;
}

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

.sidebar-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--sidebar);
}

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.me .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.me-info {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.me-info strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conn-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #f59e0b;
}

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

.conn-dot.offline {
  background: var(--red);
}

.footer-actions {
  display: flex;
  gap: 2px;
}

.text-btn {
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-btn:hover {
  background: #eaf1fb;
  color: var(--brand);
}

/* --------------------------------- 聊天区 -------------------------------- */

.chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f0f4f9;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-icon {
  margin-bottom: 6px;
  font-size: 54px;
  line-height: 1;
}

.chat-empty h2 {
  margin: 0;
  color: #4b5563;
  font-size: 18px;
  font-weight: 600;
}

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

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.back-btn {
  display: none;
  width: 34px;
  height: 38px;
  font-size: 28px;
  line-height: 1;
  color: #5b6472;
}

.peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.peer .avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.peer-info {
  min-width: 0;
}

.peer-info h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.peer-info p.online {
  color: var(--green);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px 6px;
  background: #f0f4f9;
  scrollbar-width: thin;
  scrollbar-color: #c9d3e0 transparent;
}

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

.messages::-webkit-scrollbar-thumb {
  background: #c9d3e0;
  border-radius: 999px;
}

.day {
  align-self: center;
  margin: 12px 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.06);
  color: #8a9099;
  font-size: 11px;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 6px;
  max-width: 100%;
  animation: rise 0.16s ease-out;
}

.msg.grouped {
  margin-top: 2px;
}

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

.msg .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.msg.grouped .avatar {
  visibility: hidden;
}

.msg .body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(70%, 520px);
  min-width: 0;
}

.msg.mine .body {
  align-items: flex-end;
}

.meta {
  padding: 0 4px;
  color: #98a1ae;
  font-size: 11px;
  line-height: 1.2;
}

.msg.grouped .meta {
  display: none;
}

.bubble {
  padding: 9px 13px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: #fff;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.msg.mine .bubble {
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1a73e8, #3f8cff);
  box-shadow: 0 4px 12px -6px rgba(26, 115, 232, 0.65);
}

.chat-tip {
  align-self: center;
  margin: 20px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.05);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* --------------------------------- 图片消息 -------------------------------- */

.image-bubble {
  max-width: min(280px, 100%);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  line-height: 0;
  cursor: zoom-in;
}

.image-bubble img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
}

.msg.mine .image-bubble {
  box-shadow: 0 4px 12px -6px rgba(26, 115, 232, 0.55);
}

/* --------------------------------- 语音消息 -------------------------------- */

.audio-bubble {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 140px;
  max-width: 230px;
  padding: 7px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  user-select: none;
}

.msg.mine .audio-bubble {
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1a73e8, #3f8cff);
}

.audio-play {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}

.msg.mine .audio-play {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.audio-bars {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}

.audio-bars span {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: #c3cedd;
}

.msg.mine .audio-bars span {
  background: rgba(255, 255, 255, 0.6);
}

.audio-bubble.playing .audio-bars span {
  background: var(--brand);
}

.msg.mine .audio-bubble.playing .audio-bars span {
  background: #fff;
}

.audio-dur {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.msg.mine .audio-dur {
  color: rgba(255, 255, 255, 0.85);
}

/* -------------------------------- 输入区 -------------------------------- */

.typing {
  height: 20px;
  flex: none;
  padding: 0 22px 2px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.typing.show {
  opacity: 1;
}

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

.tool-btn {
  width: 36px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.tool-btn:hover {
  background: var(--soft);
}

#input {
  flex: 1;
  min-height: 38px;
  max-height: 120px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--soft);
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

#input::placeholder {
  color: #a3a8b8;
}

#input:focus {
  background: #fff;
  border-color: #bcd7ff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.send-btn {
  height: 38px;
  flex: none;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

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

.record-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

.rec-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.1s ease-in-out infinite;
}

.rec-label {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.rec-time {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rec-btn {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
}

.rec-cancel {
  background: var(--soft);
  color: var(--ink);
}

.rec-send {
  background: var(--brand);
  color: #fff;
}

/* --------------------------------- 表情面板 -------------------------------- */

.emoji-panel {
  position: absolute;
  left: 328px;
  bottom: 70px;
  z-index: 30;
  width: min(340px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.35);
  animation: rise 0.14s ease-out;
}

.emoji-panel button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.emoji-panel button:hover {
  background: var(--soft);
}

/* --------------------------------- 登录页 -------------------------------- */

.login {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(600px 400px at 12% 10%, rgba(96, 165, 250, 0.35), transparent 60%),
    radial-gradient(500px 400px at 90% 90%, rgba(45, 212, 191, 0.3), transparent 60%),
    linear-gradient(135deg, #eff6ff, #f7fbff 50%, #ecfdf7);
}

.login::before,
.login::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.login::before {
  top: -80px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: rgba(26, 115, 232, 0.12);
}

.login::after {
  bottom: -100px;
  left: -70px;
  width: 280px;
  height: 280px;
  background: rgba(20, 184, 166, 0.12);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 32px 28px 24px;
  text-align: center;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.35);
  animation: pop 0.28s ease-out;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #1a73e8, #4d9bff);
  box-shadow: 0 14px 30px -10px rgba(26, 115, 232, 0.7);
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 1px;
}

.login-sub {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#authForm input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e1e7f0;
  border-radius: 12px;
  background: #fafcff;
  font-size: 15px;
  text-align: center;
  outline: none;
}

#authForm input:focus {
  background: #fff;
  border-color: #bcd7ff;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.login-btn {
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 10px 22px -10px rgba(26, 115, 232, 0.9);
}

.login-btn:hover {
  background: var(--brand-dark);
}

.login-hint {
  margin: 16px 0 0;
  color: #a3a8b8;
  font-size: 12px;
}

.login-download {
  margin-top: 8px;
}

.login-download a {
  color: var(--brand);
  text-decoration: none;
}

.login-download a:hover {
  text-decoration: underline;
}

/* -------------------------------- 提示组件 -------------------------------- */

.banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 40px);
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.93);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(15, 23, 42, 0.5);
  transform: translateX(-50%);
  cursor: pointer;
  animation: drop 0.2s ease-out;
}

.banner strong {
  color: #a8ccff;
  font-weight: 600;
}

.banner .banner-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  z-index: 95;
  max-width: calc(100% - 40px);
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.93);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
}

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

.lightbox {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.86);
}

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

/* --------------------------------- 动画 --------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

/* --------------------------------- 移动端 -------------------------------- */

@media (max-width: 780px) {
  body {
    display: block;
  }

  .app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
  }

  .chat {
    display: none;
  }

  .app.chat-open .sidebar {
    display: none;
  }

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

  .back-btn {
    display: grid;
  }

  .chat-empty {
    display: none;
  }

  .messages {
    padding: 12px 12px 4px;
  }

  .msg .body {
    max-width: 78%;
  }

  .image-bubble {
    max-width: min(230px, 100%);
  }

  .composer {
    gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .tool-btn {
    width: 32px;
    font-size: 17px;
  }

  .send-btn {
    padding: 0 12px;
  }

  .emoji-panel {
    left: 10px;
    bottom: 66px;
    width: calc(100% - 20px);
  }

  .sidebar-header {
    padding: 14px 12px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------- v3：账号 / 通讯录 / 视频 / 私密通知 ---------------- */

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  background: #eef3f8;
  border-radius: 12px;
}

.login-tab {
  border: 0;
  background: transparent;
  color: #5b6b7c;
  border-radius: 9px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-tab.active {
  background: #fff;
  color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}

.login-error {
  margin: 0 0 10px;
  color: #d93025;
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px 8px;
  flex: 0 0 auto;
}

.side-tab {
  flex: 1;
  border: 0;
  border-radius: 9px;
  padding: 8px 4px;
  background: transparent;
  color: #5b6b7c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.side-tab.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.tab-badge {
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 2px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.chats-panel,
.contacts-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.chats-panel[hidden],
.contacts-panel[hidden] {
  display: none;
}

.add-friend-form {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  flex: 0 0 auto;
}

.add-friend-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe4ee;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
  background: #f8fafc;
}

.add-friend-form button {
  border: 0;
  border-radius: 9px;
  padding: 0 13px;
  background: #1a73e8;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.contacts-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.contacts-section {
  margin-top: 10px;
}

.contacts-section h3 {
  margin: 0 0 6px;
  color: #6b7c8f;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-count {
  color: #9aa9b8;
  font-weight: 500;
}

.friend-row,
.request-row,
.outgoing-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}

.friend-row:hover,
.request-row:hover {
  background: #f3f7fc;
}

.friend-row .avatar,
.request-row .avatar,
.outgoing-row .avatar {
  width: 34px;
  height: 34px;
  font-size: 14px;
  flex: 0 0 auto;
}

.friend-main,
.request-main {
  flex: 1;
  min-width: 0;
}

.friend-name,
.request-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1d2b3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-sub,
.request-sub {
  display: block;
  color: #8a99a9;
  font-size: 12px;
  margin-top: 2px;
}

.request-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.request-actions button {
  border: 0;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.request-actions .accept {
  background: #1a73e8;
  color: #fff;
}

.request-actions .decline {
  background: #eef3f8;
  color: #5b6b7c;
}

.contacts-empty {
  padding: 18px 8px;
  text-align: center;
  color: #8a99a9;
  font-size: 13px;
  line-height: 1.6;
}

.private-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6b7c8f;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.private-toggle input {
  accent-color: #1a73e8;
  margin: 0;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.video-bubble {
  display: inline-block;
  max-width: min(280px, 72vw);
  border-radius: 12px;
  overflow: hidden;
  background: #0d1522;
  line-height: 0;
}

.video-bubble video {
  display: block;
  width: 100%;
  max-height: 320px;
  background: #0d1522;
}

.msg .body .video-bubble {
  box-shadow: 0 2px 8px rgba(15, 35, 60, 0.12);
}

.empty-action {
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 780px) {
  .sidebar-tabs {
    padding-bottom: 6px;
  }

  .private-toggle span {
    display: none;
  }

  .video-bubble {
    max-width: min(230px, 68vw);
  }
}


/* ---------------- v4：个人中心 / 左滑删除 ---------------- */

.me {
  cursor: pointer;
}

.contact-row {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.contact-row .contact {
  position: relative;
  z-index: 1;
  background: #fff;
  transition: transform 0.2s ease;
}

.contact-row.swiped .contact {
  transform: translateX(-78px);
}

.swipe-delete {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 78px;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: #e5484d;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 30, 50, 0.4);
}

.modal-card {
  width: min(380px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 35, 60, 0.25);
}

.modal-card h2 {
  margin: 0 0 16px;
  font-size: 19px;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  color: #5b6b7c;
  font-size: 12px;
  font-weight: 600;
}

.modal-card input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #fafcff;
  font-size: 14px;
  outline: none;
}

.modal-card input:focus {
  border-color: #bcd7ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.field-hint {
  margin: 10px 0 0;
  color: #8a99a9;
  font-size: 12px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-btn {
  min-width: 78px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn.primary {
  background: #1a73e8;
  color: #fff;
}

.modal-btn.ghost {
  background: #eef3f8;
  color: #5b6b7c;
}
