/* Frontend UI V2: visual layer only. Business DOM and event hooks stay unchanged. */
body.is-chat {
  --v2-navy: #142943;
  --v2-navy-soft: #1d3b5f;
  --v2-blue: #2f82e8;
  --v2-blue-deep: #2373d3;
  --v2-border: #dde4ea;
  --v2-text: #182a3a;
  --v2-muted: #81909c;
  --v2-panel: #ffffff;
  --v2-canvas: #eef3f7;
  --v2-danger: #e13d48;
}

@media (min-width: 821px) {
  body.is-chat { height: 100dvh; overflow: hidden; color: var(--v2-text); }
  body.is-chat .shell { width: 100%; height: 100dvh; min-height: 0; overflow: hidden; }
  body.is-chat .conversation,
  body.is-chat .chat-panel { overflow: clip; }
  body.is-chat .chat-panel { grid-template-columns: minmax(0, 1fr); }
  body.is-chat .chat-panel > :not(.gc-manage-panel) { min-width: 0; max-width: 100%; }
  body.is-chat .contacts,
  body.is-chat .messages { overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; }
  body.is-chat .chat-app {
    grid-template-columns: 96px clamp(320px, 24vw, 388px) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d7dee5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(28, 48, 66, .16);
  }

  /* Main rail */
  body.is-chat .app-rail {
    width: auto;
    min-width: 0;
    padding: 24px 10px 18px;
    border: 0;
    color: #d9e7f4;
    background: linear-gradient(180deg, var(--v2-navy) 0%, #10243a 100%);
    box-shadow: inset -1px 0 rgba(255,255,255,.04);
  }
  body.is-chat .rail-avatar {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255,255,255,.16);
    border-radius: 16px;
    box-shadow: 0 7px 18px rgba(0,0,0,.2);
  }
  body.is-chat .rail-user {
    max-width: 70px;
    margin-top: 7px;
    overflow: hidden;
    color: #e9f2fa;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.is-chat .rail-btn {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 5px auto;
    border-radius: 11px;
    color: #b7c8d8;
    transition: color .18s ease, background .18s ease, transform .18s ease;
  }
  body.is-chat .rail-btn:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateY(-1px); }
  body.is-chat .rail-btn.active { color: #67b5ff; background: rgba(57,139,224,.22); }
  body.is-chat .rail-btn.active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #49a7ff;
  }
  body.is-chat .rail-btn .ui-icon { width: 24px; height: 24px; }

  /* Conversation list */
  body.is-chat .sidebar {
    min-width: 0;
    border-right: 1px solid var(--v2-border);
    background: #f6f8fb;
  }
  body.is-chat .side-head {
    padding: 23px 18px 15px;
    border-bottom: 1px solid #edf1f4;
    background: #fbfcfe;
  }
  body.is-chat .side-title { min-height: 45px; align-items: center; }
  body.is-chat .h5-page-brand > img { display: none; }
  body.is-chat .h5-page-brand strong { color: #172738; font-size: 23px; font-weight: 760; letter-spacing: -.4px; }
  body.is-chat .h5-page-brand small { margin-top: 2px; color: #8795a0; font-size: 11px; }
  body.is-chat .add-contact {
    width: 38px;
    height: 38px;
    border: 1px solid #edf1f4;
    border-radius: 10px;
    color: #4f6070;
    background: #f3f5f7;
    box-shadow: none;
  }
  body.is-chat .add-contact:hover { color: var(--v2-blue); background: #eaf3fd; }
  body.is-chat .search {
    height: 46px;
    margin-top: 13px;
    padding: 0 14px;
    border: 1px solid #dce3e9;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(35,57,74,.035);
  }
  body.is-chat .search:focus-within { border-color: #91bce8; box-shadow: 0 0 0 3px rgba(47,130,232,.08); }
  body.is-chat .search input { color: #26394a; font-size: 14px; }
  body.is-chat .contacts { padding: 10px 9px 18px; background: #f6f8fb; }
  body.is-chat .contact {
    min-height: 82px;
    margin: 0 0 4px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
  }
  body.is-chat .contact:hover { border-color: #e6edf2; background: #f5f8fa; }
  body.is-chat .contact.active {
    border-color: #afd0f1;
    color: #17324a;
    background: linear-gradient(135deg, #edf6ff 0%, #e3f1ff 100%);
    box-shadow: 0 5px 15px rgba(38,102,164,.1), inset 3px 0 #2f82e8;
  }
  body.is-chat .contact .avatar { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; }
  body.is-chat .contact-copy { gap: 4px; }
  body.is-chat .contact-copy strong { color: #1c2c3b; font-size: 15px; font-weight: 720; }
  body.is-chat .contact-copy small { color: #7c8c99; font-size: 12px; }
  body.is-chat .contact.active .contact-copy strong,
  body.is-chat .contact.active .contact-copy small,
  body.is-chat .contact.active time { color: #315a7d; }
  body.is-chat .contact.active .contact-copy strong { color: #1766ad; }
  body.is-chat .contact time { color: #8b99a4; }
  body.is-chat .contact.active .pinned-label { color: #1766ad; background: rgba(47,130,232,.1); }
  body.is-chat .unread-badge { filter: drop-shadow(0 2px 4px rgba(120,0,9,.18)); }

  /* Chat canvas */
  body.is-chat .conversation { min-width: 0; background: #edf2f6; }
  body.is-chat .chat-panel {
    min-width: 0;
    background: #edf2f6;
    transition: padding-right .22s ease;
  }
  body.is-chat .chat-head {
    height: 92px;
    min-height: 92px;
    padding: 13px 24px;
    border-bottom: 1px solid var(--v2-border);
    background: rgba(255,255,255,.97);
    box-shadow: 0 5px 18px rgba(31,58,78,.07);
    backdrop-filter: blur(14px);
  }
  body.is-chat .chat-head .avatar { width: 52px; height: 52px; border-radius: 13px; }
  body.is-chat .peer-title-line {
    min-width: 0;
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    gap: 7px;
  }
  body.is-chat .peer-heading > .peer-title-line::before { display: none; }
  body.is-chat .peer-heading strong { color: #172737; font-size: 20px; font-weight: 760; }
  body.is-chat .peer-heading > span,
  body.is-chat .peer-heading .peer-account { color: #7d8d99; font-size: 12px; }
  body.is-chat .peer-heading #peerLocation { max-width: none; grid-column: 2; grid-row: 1; }
  body.is-chat .peer-heading #peerLastLogin { grid-column: 3; grid-row: 1; }
  body.is-chat .peer-heading #peerAccount { grid-column: 1; grid-row: 2; }
  body.is-chat .peer-heading #peerIp { width: max-content; max-width: none; grid-column: 2 / -1; grid-row: 2; }
  body.is-chat .peer-heading .peer-group-summary { grid-column: 1 / -1; grid-row: 2; color: #6e8497; }
  body.is-chat .peer-account:disabled { cursor: default; opacity: .55; }
  body.is-chat .peer-gender {
    width: 22px;
    height: 22px;
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
  }
  body.is-chat .peer-gender svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body.is-chat .peer-gender.male { color: #2584e8; background: #e7f3ff; box-shadow: 0 3px 8px rgba(37,132,232,.14); }
  body.is-chat .peer-gender.female { color: #ec5a9a; background: #fff0f6; box-shadow: 0 3px 8px rgba(236,90,154,.14); }
  body.is-chat .history-entry {
    min-width: 44px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid #dce5eb;
    border-radius: 10px;
    color: #47718f;
    background: #fff;
    box-shadow: none;
  }
  body.is-chat .history-entry:hover { color: var(--v2-blue); border-color: #a8c8e7; background: #f5faff; }
  body.is-chat .gc-announcement-bar {
    border-bottom: 1px solid #e4e8ec;
    background: #fff;
    box-shadow: 0 3px 9px rgba(28,55,77,.035);
  }
  body.is-chat .messages {
    padding: 28px 30px 34px;
    background:
      radial-gradient(circle at 78% 18%, rgba(71,137,205,.055), transparent 31%),
      linear-gradient(180deg, #f3f6f9 0%, #edf2f6 100%);
  }
  body.is-chat .message-row { max-width: 100%; margin: 15px 0; gap: 10px; }
  body.is-chat .msg-avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  body.is-chat .bubble {
    max-width: min(66%, 680px);
    border: 1px solid #d6dfe7;
    border-radius: 11px;
    color: #253542;
    background: #fff;
    box-shadow: 0 5px 15px rgba(32,55,72,.09);
  }
  body.is-chat .message-row.mine .bubble {
    border-color: #a9cdec;
    background: linear-gradient(145deg, #e1f0ff 0%, #d3e8fb 100%);
  }
  body.is-chat .bubble time { color: #80909c; }
  body.is-chat .gc-sender-name { color: #788995; font-size: 11px; }
  body.is-chat .compose-area {
    border-top: 1px solid var(--v2-border);
    background: #fff;
    box-shadow: 0 -7px 22px rgba(33,56,74,.075);
  }
  body.is-chat #messageForm { padding: 0 20px 18px; }
  body.is-chat #messageInput {
    min-height: 94px;
    padding: 14px;
    border: 1px solid #dce3e8;
    border-radius: 11px;
    color: #263947;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(36,58,74,.025);
  }
  body.is-chat #messageInput:focus { border-color: #8cb8e5; box-shadow: 0 0 0 3px rgba(47,130,232,.07); }
  body.is-chat .tool-btn { color: #445d70; }
  body.is-chat .send {
    min-width: 86px;
    height: 39px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--v2-blue) 0%, var(--v2-blue-deep) 100%);
    box-shadow: 0 6px 14px rgba(38,113,204,.2);
  }
  body.is-chat .send:hover { filter: brightness(1.04); }

  /* Context surfaces */
  body.is-chat .gc-group-menu,
  body.is-chat .gc-member-menu,
  body.is-chat .message-menu,
  body.is-chat .contact-menu {
    border: 1px solid #dbe3e9;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(24,46,62,.2);
  }
  body.is-chat .gc-dialog-card,
  body.is-chat .gc-info-card,
  body.is-chat .gc-action-card {
    border-color: #dce4ea;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(25,45,59,.24);
  }
}

/* Persistent group details on wide desktop. */
@media (min-width: 1180px) {
  body.is-chat .group-chat-mode .chat-panel.gc-details-open { padding-right: 370px; }
  body.is-chat .gc-manage-panel {
    width: 370px;
    border-left: 1px solid var(--v2-border);
    background: #fff;
    box-shadow: none;
  }
  body.is-chat .gc-manage-panel > header {
    flex-basis: 92px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--v2-border);
  }
  body.is-chat .gc-manage-panel > header strong { color: #172737; font-size: 20px; }
  body.is-chat .gc-manage-panel > header small { margin-top: 4px; color: #86939e; }
  body.is-chat .gc-announcement-card {
    margin: 16px 16px 12px;
    padding: 16px;
    border: 1px solid #e1e6ea;
    border-radius: 11px;
    background: #fff;
    box-shadow: none;
  }
  body.is-chat .gc-member-search { margin: 0 16px 11px; background: #fff; }
  body.is-chat .gc-member-groups { padding: 0 9px 14px; }
  body.is-chat .gc-manage-member { min-height: 62px; border-radius: 9px; }
  body.is-chat .gc-manage-member:hover { background: #f2f6f9; }
  body.is-chat .gc-manage-panel > footer {
    gap: 9px;
    padding: 15px 16px;
    border-top: 1px solid var(--v2-border);
  }
  body.is-chat .gc-manage-panel > footer button {
    min-height: 42px;
    border-radius: 8px;
    background: #fff;
  }
}

@media (min-width: 1500px) {
  body.is-chat .chat-app { grid-template-columns: 106px 390px minmax(0, 1fr); }
  body.is-chat .group-chat-mode .chat-panel.gc-details-open { padding-right: 410px; }
  body.is-chat .gc-manage-panel { width: 410px; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-chat .chat-panel,
  body.is-chat .gc-manage-panel,
  body.is-chat .contact,
  body.is-chat .rail-btn { transition: none !important; }
}
.copy-toast{position:fixed;z-index:1900;left:50%;bottom:28px;max-width:calc(100vw - 32px);padding:9px 14px;border-radius:999px;pointer-events:none;opacity:0;color:#fff;background:rgba(26,41,55,.92);box-shadow:0 10px 28px rgba(20,37,52,.2);transform:translate(-50%,12px);transition:opacity .18s ease,transform .18s ease;font-size:13px}.copy-toast.show{opacity:1;transform:translate(-50%,0)}
body.is-chat .gc-member-search{height:42px;box-sizing:border-box;border-radius:999px!important;background:#fff}body.is-chat .gc-member-search:focus-within{border-color:#75afe0;box-shadow:0 0 0 3px rgba(52,135,212,.12)}body.is-chat .gc-member-search input{width:100%!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;outline:0!important;box-shadow:none!important;color:#334a5f!important;background:transparent!important;font:inherit!important}@media(max-width:820px){.copy-toast{bottom:calc(76px + env(safe-area-inset-bottom))}}

/* Feixiang Pegasus composer */
body.is-chat .compose-area{border-top:1px solid #e5eaf0;background:#fff;box-shadow:0 -3px 12px rgba(35,62,83,.035)}
body.is-chat #messageForm.composer{min-height:0;display:block;padding:0 14px 14px;background:#fff}
body.is-chat .compose-toolbar{height:52px;display:flex;align-items:center;justify-content:space-between;gap:16px}
body.is-chat .compose-tools{display:flex;align-items:center;gap:17px;min-width:0;padding:0}
body.is-chat .tool-btn{width:auto;height:36px;display:inline-flex;align-items:center;gap:6px;padding:0;border:0;border-radius:8px;background:transparent;font-size:13px;line-height:1;white-space:nowrap;transition:background .15s,transform .12s,opacity .15s}
body.is-chat .tool-btn:hover{background:#f3f6fa}
body.is-chat .tool-btn .ui-icon{width:18px;height:18px;stroke-width:1.9}
body.is-chat .tool-btn span{color:#596a7d}
body.is-chat .tool-btn:disabled{cursor:not-allowed;opacity:.38}
body.is-chat .tool-emoji{color:#f2a520}
body.is-chat .tool-image{color:#2d82f7}
body.is-chat .tool-video{color:#ff5261}
body.is-chat .tool-audio{color:#965ce5}
body.is-chat .tool-file{color:#00aa9c}
body.is-chat .compose-shortcut{flex:0 0 auto;color:#9aa7b5;font-size:11px;white-space:nowrap}
body.is-chat .message-field{position:relative;height:134px;overflow:hidden;border:1px solid #dce4ed;border-radius:12px;background:#fbfcfe;box-shadow:inset 0 1px 2px rgba(33,57,77,.02);transition:border-color .15s,box-shadow .15s}
body.is-chat .message-field:focus-within{border-color:#9fc3e8;box-shadow:0 0 0 3px rgba(47,130,232,.07)}
body.is-chat #messageInput{width:100%;height:100%!important;min-height:0;max-height:none;padding:21px 130px 38px 24px;border:0!important;border-radius:0;color:#2c4052;background:transparent;box-shadow:none!important;font-size:14px;line-height:1.55}
body.is-chat #messageInput::placeholder{color:#aeb7c0}
body.is-chat .clear-message{top:10px;right:10px}
body.is-chat .paste-hint{position:absolute;left:14px;bottom:13px;color:#95a5b5;font-size:11px;line-height:1;pointer-events:none}
body.is-chat .send{position:absolute;right:10px;bottom:9px;width:88px;min-width:88px;height:40px;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:10px;color:#fff;background:linear-gradient(135deg,#ff536b 0%,#ff3155 100%);box-shadow:0 7px 18px rgba(255,49,85,.22);font-size:14px;font-weight:700;transition:filter .15s,transform .12s,opacity .15s}
body.is-chat .send .ui-icon{width:16px;height:16px;stroke-width:2}
body.is-chat .send:not(:disabled):hover{filter:brightness(1.04)}
body.is-chat .send:disabled{color:#fff;background:linear-gradient(135deg,#ff8b9b,#ff7890);box-shadow:none;opacity:.55}
body.is-chat .emoji-panel{left:14px}

@media(min-width:821px){
  body.is-chat .compose-toolbar{height:46px}
  body.is-chat #messageForm.composer{padding:0 14px 12px}
  body.is-chat .message-field{height:112px;border-color:#d3dde6;background:#fbfcfe;box-shadow:0 2px 9px rgba(31,56,76,.04)}
  body.is-chat #messageInput{min-height:0;padding:18px 124px 34px 18px}
  body.is-chat .paste-hint{left:14px;bottom:12px}
  body.is-chat .send{right:10px;bottom:9px}
  body.is-chat .peer-heading{grid-template-columns:max-content minmax(0,1fr) max-content;column-gap:16px!important}
  body.is-chat .peer-heading strong{font-size:19px}
  body.is-chat .peer-heading>span,body.is-chat .peer-heading>.peer-account{font-size:11px}
}

@media(max-width:860px){
  html,body{max-width:100%;overflow-x:hidden}
  body.is-chat .shell{right:auto;left:var(--h5-offset-left,0px);width:var(--h5-width,100%);max-width:none}
  body.is-chat .chat-app,body.is-chat .conversation,body.is-chat .chat-panel,body.is-chat .compose-area,body.is-chat #messageForm.composer,body.is-chat .message-field{width:100%;max-width:100%;min-width:0}
  /* Keep all five APP sections on the same white surface. */
  body.is-chat .chat-app,body.is-chat .sidebar,body.is-chat .contacts,body.is-chat .h5-new-friends{background:#fff}
  body.is-chat .side-head{border-bottom-color:#edf1f4;background:rgba(255,255,255,.98)}
  body.is-chat .peer-heading{display:flex!important;align-items:center;justify-content:center}
  body.is-chat .peer-heading>.peer-title-line{width:100%;height:56px;display:flex!important;align-items:center;justify-content:center;gap:6px;max-width:100%}
  body.is-chat .peer-title-line strong{min-width:0;max-width:100%;flex:0 1 auto;font-size:clamp(13px,4vw,16px);line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.is-chat .peer-gender{width:20px;height:20px;flex-basis:20px}
  body.is-chat .peer-gender svg{width:14px;height:14px}
}

@media(max-width:820px){
  body.is-chat #messageForm.composer{padding:0 8px max(8px,env(safe-area-inset-bottom))}
  body.is-chat.h5-keyboard-open #messageForm.composer{padding-bottom:7px}
  body.is-chat .compose-toolbar{height:46px;gap:4px}
  body.is-chat .compose-tools{width:100%;justify-content:space-between;gap:1px}
  body.is-chat .tool-btn{height:38px;gap:4px;padding:0 5px;font-size:11px}
  body.is-chat .tool-btn .ui-icon{width:17px;height:17px}
  body.is-chat .compose-shortcut{display:none}
  body.is-chat .message-field{height:104px;border-radius:14px}
  body.is-chat #messageInput{height:100%!important;min-height:0;max-height:none;padding:14px 82px 32px 13px;font-size:16px!important}
  body.is-chat .paste-hint{left:12px;bottom:11px;font-size:10px}
  body.is-chat .clear-message{top:7px;right:7px}
  body.is-chat .send{right:7px;bottom:7px;width:68px;min-width:68px;height:36px;border-radius:10px;font-size:13px}
  body.is-chat .send .ui-icon{width:14px;height:14px}
  body.is-chat .emoji-panel{bottom:calc(158px + env(safe-area-inset-bottom));left:8px}
}

@media(max-width:390px){
  body.is-chat .compose-tools{gap:0}
  body.is-chat .tool-btn{padding:0 3px}
  body.is-chat .tool-btn span{font-size:10px}
}

/* PC contact presence: session activity within the server's online window. */
@media(min-width:821px){
  body.is-chat .contact-avatar-shell{
    position:relative;
    width:46px;
    height:46px;
    display:block;
  }
  body.is-chat .contact-avatar-shell>.avatar{width:46px;height:46px}
  body.is-chat .contact-online-dot{
    position:absolute;
    z-index:3;
    right:-4px;
    bottom:-4px;
    width:13px;
    height:13px;
    border:2px solid #f7f7f7;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 1px 4px rgba(18,126,63,.35);
    pointer-events:none;
  }
  body.is-chat .contact.active .contact-online-dot,
  body.is-chat .contact.pinned.active .contact-online-dot{border-color:#07c160}
  body.is-chat .contact-copy strong{
    display:flex;
    min-width:0;
    align-items:center;
    gap:6px;
  }
  body.is-chat .contact-online-label{
    flex:0 0 auto;
    padding:2px 5px;
    border-radius:4px;
    color:#078f46;
    background:#def7e9;
    font-size:9px;
    font-weight:600;
    font-style:normal;
    line-height:1.2;
  }
  body.is-chat .contact.active .contact-online-label,
  body.is-chat .contact.pinned.active .contact-online-label{color:#078f46;background:#fff}
}

@media(max-width:820px){
  body.is-chat .contact-avatar-shell{display:contents}
  body.is-chat .contact-online-dot,
  body.is-chat .contact-online-label{display:none}
}

/* Group conversations remain visually distinct from one-to-one contacts. */
body.is-chat .gc-group-avatar-shell{
  position:relative;
  width:46px;
  height:46px;
  display:block;
  flex:0 0 46px;
}
body.is-chat .gc-group-avatar-shell>.avatar{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  object-fit:cover;
}
body.is-chat .gc-group-avatar-mark{
  position:absolute;
  z-index:4;
  right:-5px;
  bottom:-5px;
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  border:2px solid #f7f7f7;
  border-radius:50%;
  color:#fff;
  background:#1688e8;
  box-shadow:0 2px 6px rgba(22,105,180,.32);
  pointer-events:none;
}
body.is-chat .gc-group-avatar-mark svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
body.is-chat .contact.active .gc-group-avatar-mark{border-color:#07c160;background:#fff;color:#087f42}
body.is-chat .gc-conversation-type{
  flex:0 0 auto;
  padding:2px 5px;
  border-radius:4px;
  color:#176fac;
  background:#e4f2fc;
  font-size:9px;
  font-weight:600;
  font-style:normal;
  line-height:1.2;
}
body.is-chat .contact.active .gc-conversation-type{color:#087f42;background:#fff}

@media(max-width:820px){
  body.is-chat .gc-group-avatar-shell{width:52px;height:52px;flex-basis:52px}
  body.is-chat .gc-group-avatar-shell>.avatar{width:52px;height:52px}
  body.is-chat .gc-group-avatar-mark{right:-4px;bottom:-4px}
}

@media(max-width:340px){
  body.is-chat .peer-title-line strong{font-size:12px}
  body.is-chat .peer-heading>.peer-title-line{gap:4px}
  body.is-chat .peer-gender{width:18px;height:18px;flex-basis:18px}
}

/* WeChat-inspired application skin: compact, neutral and content-first. */
@media(min-width:821px){
  body.is-chat{
    --v2-blue:#07c160;
    --v2-blue-deep:#06ad56;
    --v2-border:#dedede;
    --v2-canvas:#f5f5f5;
    --bubble:#95ec69;
    background:#d8d8d8;
  }
  body.is-chat .shell{padding:0;background:#d8d8d8}
  body.is-chat .chat-app{
    grid-template-columns:68px clamp(260px,22vw,300px) minmax(0,1fr);
    border:0;
    border-radius:0;
    background:#f5f5f5;
    box-shadow:none;
  }

  body.is-chat .app-rail{
    padding:20px 8px 14px;
    gap:9px;
    border-right:1px solid #d8d8d8;
    color:#5e5e5e;
    background:#e8e8e8;
    box-shadow:none;
  }
  body.is-chat .rail-avatar{
    width:42px;
    height:42px;
    border:0;
    border-radius:5px;
    box-shadow:none;
  }
  body.is-chat .rail-user{display:none}
  body.is-chat .rail-btn{
    width:44px;
    height:44px;
    margin:2px auto;
    border-radius:5px;
    color:#666;
  }
  body.is-chat .rail-btn:hover{color:#343434;background:#dedede;transform:none}
  body.is-chat .rail-btn.active{color:#079447;background:#d9f1e3}
  body.is-chat .rail-btn.active::before{
    display:block;
    top:12px;
    bottom:12px;
    left:-8px;
    width:3px;
    border-radius:0 3px 3px 0;
    background:#07c160;
  }
  body.is-chat .rail-btn .ui-icon{width:23px;height:23px;stroke-width:1.7}
  body.is-chat .rail-btn.has-notice .ui-icon{color:inherit;filter:none}
  body.is-chat .rail-message-badge{
    top:1px;
    right:0;
    width:18px;
    height:18px;
  }
  body.is-chat .rail-message-badge svg{width:18px;height:18px}
  body.is-chat .rail-message-badge circle{stroke-width:2;filter:drop-shadow(0 1px 2px rgba(210,40,57,.26))}
  body.is-chat .rail-message-badge text{font-size:8px}
  body.is-chat #gcRailBadge{
    top:4px;
    right:3px;
    width:10px;
    height:10px;
  }
  body.is-chat #gcRailBadge svg{width:10px;height:10px}
  body.is-chat #gcRailBadge circle{stroke-width:3;filter:none}
  body.is-chat #gcRailBadge text{display:none}
  body.is-chat .rail-notice{
    top:4px;
    right:3px;
    width:9px;
    height:9px;
    border:2px solid #e8e8e8;
    box-shadow:none;
    animation:none;
  }
  body.is-chat .rail-notice::after{display:none}

  body.is-chat .sidebar{border-right:1px solid #dedede;background:#f7f7f7}
  body.is-chat .side-head{padding:17px 12px 12px;border-bottom:1px solid #e5e5e5;background:#f7f7f7}
  body.is-chat .side-title{min-height:36px;margin-bottom:10px}
  body.is-chat .h5-page-brand strong{color:#222;font-size:19px;font-weight:650;letter-spacing:0}
  body.is-chat .add-contact{
    width:32px;
    height:32px;
    border:0;
    border-radius:4px;
    color:#4d4d4d;
    background:#e5e5e5;
  }
  body.is-chat .add-contact:hover{color:#222;background:#dcdcdc}
  body.is-chat .search{
    height:34px;
    margin-top:0;
    padding:0 10px;
    border:1px solid transparent;
    border-radius:5px;
    color:#888;
    background:#e9e9e9;
    box-shadow:none;
  }
  body.is-chat .search:focus-within{border-color:#cfcfcf;background:#fff;box-shadow:none}
  body.is-chat .search input{font-size:12px}
  body.is-chat .contacts{padding:0;background:#f7f7f7;scrollbar-gutter:auto}
  body.is-chat .contact{
    min-height:68px;
    margin:0;
    padding:9px 12px;
    border:0;
    border-bottom:1px solid #ededed;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }
  body.is-chat .contact:hover{border-color:#ededed;background:#eaeaea}
  body.is-chat .contact.active,
  body.is-chat .contact.pinned.active{
    border-color:#07c160;
    color:#fff;
    background:#07c160;
    box-shadow:none;
  }
  body.is-chat .contact .avatar{width:46px;height:46px;border-radius:5px;box-shadow:none}
  body.is-chat .contact-copy{gap:5px}
  body.is-chat .contact-copy strong{color:#222;font-size:14px;font-weight:500}
  body.is-chat .contact-copy small{color:#999;font-size:12px}
  body.is-chat .contact time{color:#aaa;font-size:10px}
  body.is-chat .contact.active .contact-copy strong,
  body.is-chat .contact.active .contact-copy small,
  body.is-chat .contact.active time,
  body.is-chat .contact.pinned.active .contact-copy strong,
  body.is-chat .contact.pinned.active .contact-copy small,
  body.is-chat .contact.pinned.active time{color:#fff}

  body.is-chat .conversation,
  body.is-chat .chat-panel{background:#f5f5f5}
  body.is-chat .chat-head{
    height:92px;
    min-height:92px;
    padding:10px 22px;
    border-bottom:1px solid #dedede;
    background:#f5f5f5;
    box-shadow:none;
    backdrop-filter:none;
  }
  body.is-chat .chat-head .avatar{width:44px;height:44px;border-radius:5px;box-shadow:none}
  body.is-chat .peer-heading strong{color:#1f1f1f;font-weight:600}
  body.is-chat .peer-heading>span,
  body.is-chat .peer-heading>.peer-account{color:#777}
  body.is-chat .peer-account:hover{color:#07a84f}
  body.is-chat .history-entry{
    height:36px;
    border:1px solid #d7d7d7;
    border-radius:5px;
    color:#555;
    background:#fafafa;
    box-shadow:none;
  }
  body.is-chat .history-entry:hover{color:#07a84f;border-color:#bdbdbd;background:#fff;box-shadow:none}
  body.is-chat .messages{padding:22px 28px;background:#f5f5f5;scrollbar-gutter:auto}
  body.is-chat .message-row{margin:13px 0;gap:10px}
  body.is-chat .msg-avatar{width:40px;height:40px;flex-basis:40px;border-radius:5px;box-shadow:none}
  body.is-chat .bubble{
    min-height:38px;
    padding:9px 12px 7px;
    border:1px solid #e2e2e2;
    border-radius:5px;
    color:#222;
    background:#fff;
    box-shadow:none;
    line-height:1.55;
  }
  body.is-chat .bubble::before{background:#fff;filter:none}
  body.is-chat .message-row.mine .bubble{border-color:#86d75e;background:#95ec69;box-shadow:none}
  body.is-chat .message-row.mine .bubble::before{background:#95ec69;filter:none}
  body.is-chat .bubble time{color:#888}

  body.is-chat .compose-area{border-top:1px solid #dedede;background:#f7f7f7;box-shadow:none;backdrop-filter:none}
  body.is-chat #messageForm.composer{padding:0 14px 12px}
  body.is-chat .compose-toolbar{height:44px}
  body.is-chat .compose-tools{gap:12px}
  body.is-chat .tool-btn{height:34px;padding:0 2px;color:#515151;background:transparent}
  body.is-chat .tool-btn:hover{color:#111;background:transparent}
  body.is-chat .tool-btn span{color:#555}
  body.is-chat .message-field{height:112px;border:1px solid #dedede;border-radius:7px;background:#fff;box-shadow:none}
  body.is-chat .message-field:focus-within{border-color:#c8c8c8;box-shadow:none}
  body.is-chat #messageInput{color:#222;background:transparent;caret-color:#07c160}
  body.is-chat #messageInput::placeholder{color:#aaa}
  body.is-chat .paste-hint{color:#999}
  body.is-chat .send{border-radius:5px;background:#07c160;box-shadow:none}
  body.is-chat .send:not(:disabled):hover{background:#06ad56;filter:none}
  body.is-chat .send:disabled{color:#aaa;background:#e9e9e9;opacity:1}
}

/* WeChat-inspired dialogs and floating panels. */
body.is-chat .modal,
body.is-chat .confirm-layer,
body.is-chat .gc-dialog,
body.is-chat .gc-info-modal,
body.is-chat .gc-action-dialog{
  background:rgba(0,0,0,.38);
  backdrop-filter:none;
}
body.is-chat .modal-card,
body.is-chat .confirm-card,
body.is-chat .gc-dialog-card,
body.is-chat .gc-info-card,
body.is-chat .gc-action-card{
  border:1px solid #d9d9d9;
  border-radius:8px;
  color:#222;
  background:#fff;
  box-shadow:0 14px 42px rgba(0,0,0,.2);
}
body.is-chat .modal-card{padding:24px}
body.is-chat .modal-card h2,
body.is-chat .gc-dialog-card>header strong,
body.is-chat .gc-info-card>header strong,
body.is-chat .gc-action-card>strong{
  color:#222;
  font-size:18px;
  font-weight:600;
}
body.is-chat .modal-card h2{margin-bottom:20px}
body.is-chat .modal-close,
body.is-chat .gc-dialog-card>header button,
body.is-chat .gc-info-card>header button{
  border:0;
  border-radius:4px;
  color:#666;
  background:#ededed;
}
body.is-chat .modal-close:hover,
body.is-chat .gc-dialog-card>header button:hover,
body.is-chat .gc-info-card>header button:hover{color:#222;background:#dfdfdf}
body.is-chat .modal-card label{color:#555;font-weight:500}
body.is-chat .modal-card input,
body.is-chat .modal-card textarea,
body.is-chat .modal-card select,
body.is-chat .remark-card>input,
body.is-chat .security-form input,
body.is-chat .security-inline input,
body.is-chat .gc-dialog-card>label input,
body.is-chat .gc-action-card>textarea,
body.is-chat .gc-announcement-editor textarea{
  border:1px solid #d8d8d8;
  border-radius:5px;
  color:#222;
  background:#f7f7f7;
  box-shadow:none;
}
body.is-chat .modal-card input:focus,
body.is-chat .modal-card textarea:focus,
body.is-chat .modal-card select:focus,
body.is-chat .remark-card>input:focus,
body.is-chat .security-form input:focus,
body.is-chat .security-inline input:focus,
body.is-chat .gc-dialog-card>label input:focus,
body.is-chat .gc-action-card>textarea:focus,
body.is-chat .gc-announcement-editor textarea:focus{
  border-color:#07c160;
  background:#fff;
  box-shadow:0 0 0 2px rgba(7,193,96,.1);
}
body.is-chat .modal-card input:disabled{color:#999;background:#ededed}

body.is-chat .modal-card .primary,
body.is-chat .modal-search button,
body.is-chat .friend-add,
body.is-chat .friend-actions button:not(.ghost),
body.is-chat .remark-actions #remarkSave,
body.is-chat .security-form button:not(.danger),
body.is-chat .security-inline button,
body.is-chat .security-heading button,
body.is-chat .gc-dialog-actions .primary,
body.is-chat .gc-action-card button:last-child:not(.danger),
body.is-chat .gc-announcement-editor button.primary{
  border-color:#07c160;
  border-radius:5px;
  color:#fff;
  background:#07c160;
  box-shadow:none;
}
body.is-chat .modal-card .primary:hover,
body.is-chat .modal-search button:hover,
body.is-chat .friend-add:not(:disabled):hover,
body.is-chat .friend-actions button:not(.ghost):hover,
body.is-chat .remark-actions #remarkSave:hover,
body.is-chat .security-form button:not(.danger):hover,
body.is-chat .security-inline button:hover,
body.is-chat .security-heading button:hover,
body.is-chat .gc-dialog-actions .primary:hover,
body.is-chat .gc-action-card button:last-child:not(.danger):hover,
body.is-chat .gc-announcement-editor button.primary:hover{background:#06ad56}
body.is-chat .secondary-btn,
body.is-chat .friend-actions .ghost,
body.is-chat .remark-actions button,
body.is-chat .gc-dialog-actions button,
body.is-chat .gc-action-card button,
body.is-chat .gc-announcement-editor button{
  border:1px solid #dedede;
  border-radius:5px;
  color:#444;
  background:#ededed;
}
body.is-chat .secondary-btn:hover,
body.is-chat .friend-actions .ghost:hover,
body.is-chat .remark-actions button:hover,
body.is-chat .gc-dialog-actions button:hover,
body.is-chat .gc-action-card button:hover,
body.is-chat .gc-announcement-editor button:hover{background:#dfdfdf}

body.is-chat .profile-avatar,
body.is-chat .friend-avatar,
body.is-chat .profile-hero-avatar,
body.is-chat .gc-contact-avatar,
body.is-chat .gc-member-avatar{
  border-radius:6px;
  background:#07c160;
  box-shadow:none;
}
body.is-chat .friend-tabs{border-bottom-color:#e5e5e5}
body.is-chat .friend-tab.active{border-bottom-color:#07c160;color:#07a84f}
body.is-chat .friend-item{border-bottom-color:#ededed}
body.is-chat .friend-add:disabled{color:#999;background:#ededed}
body.is-chat .profile-details>div,
body.is-chat .profile-bio,
body.is-chat .session-item{
  border-color:#e2e2e2;
  border-radius:5px;
  background:#f7f7f7;
  box-shadow:none;
}
body.is-chat .profile-remark-friend,
body.is-chat .security-entry{
  border:1px solid #d8d8d8;
  border-radius:5px;
  color:#333;
  background:#f3f3f3;
}
body.is-chat .profile-remark-friend:hover,
body.is-chat .security-entry:hover{background:#e8e8e8}
body.is-chat .profile-delete-friend,
body.is-chat .danger-zone>button,
body.is-chat .security-form button.danger{
  border:1px solid #efcaca;
  border-radius:5px;
  color:#c84040;
  background:#fff3f3;
}
body.is-chat .security-section{border-top-color:#e5e5e5}
body.is-chat .security-section h3{color:#333}
body.is-chat .security-section p,
body.is-chat .session-item span,
body.is-chat .session-item small{color:#777}
body.is-chat .session-item strong{color:#333}
body.is-chat .session-item strong em{border-radius:4px;color:#078e47;background:#e5f7ec}
body.is-chat .session-item button{border-radius:5px;color:#333;background:#ededed}

body.is-chat .history-search{
  border:1px solid #d8d8d8;
  border-radius:5px;
  background:#f3f3f3;
}
body.is-chat .history-search .ui-icon{color:#888}
body.is-chat .history-results{
  border:1px solid #dedede;
  border-radius:5px;
  background:#f5f5f5;
}
body.is-chat .history-avatar{border-radius:5px;background:#07c160}
body.is-chat .history-bubble{border-color:#e2e2e2;border-radius:5px;color:#222;background:#fff;box-shadow:none}
body.is-chat .history-message-row.mine .history-bubble{border-color:#86d75e;background:#95ec69;box-shadow:none}
body.is-chat .history-bubble::before{background:#fff}
body.is-chat .history-message-row.mine .history-bubble::before{background:#95ec69}

body.is-chat .confirm-card{padding:23px 22px 20px}
body.is-chat .confirm-card h3{color:#222;font-weight:600}
body.is-chat .confirm-card p{color:#666}
body.is-chat .confirm-card button{border-radius:5px;color:#444;background:#ededed}
body.is-chat .confirm-card button:not(.danger):hover{background:#dfdfdf}
body.is-chat .confirm-card button.confirm-alternate{color:#078e47;background:#e5f7ec}
body.is-chat .confirm-card button.confirm-alternate:hover{background:#d7f0e1}
body.is-chat .confirm-card button.danger{background:#e64b4b}
body.is-chat .confirm-card button.danger:hover{background:#d83f3f}

body.is-chat .gc-dialog-card,
body.is-chat .gc-info-card{padding:22px}
body.is-chat .gc-dialog-card>header,
body.is-chat .gc-info-card>header,
body.is-chat .gc-info-name,
body.is-chat .gc-members>div{border-color:#e5e5e5}
body.is-chat .gc-contact-list{border-color:#dedede;border-radius:5px}
body.is-chat .gc-contact-list label{border-bottom-color:#ededed}
body.is-chat .gc-contact-list label:hover{background:#f3f3f3}
body.is-chat .gc-wide{border-radius:5px;color:#333;background:#ededed}
body.is-chat .gc-wide:hover{background:#dfdfdf}
body.is-chat .gc-wide.danger{color:#c84040;background:#fff3f3}
body.is-chat .gc-action-card>p{color:#666}
body.is-chat .gc-group-menu,
body.is-chat .gc-member-menu,
body.is-chat .message-menu,
body.is-chat .contact-menu{
  border:1px solid #d7d7d7;
  border-radius:6px;
  color:#333;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
body.is-chat .gc-group-menu button,
body.is-chat .gc-member-menu button,
body.is-chat .message-menu button,
body.is-chat .contact-menu button{border-radius:4px;color:#333}
body.is-chat .gc-group-menu button:hover,
body.is-chat .gc-member-menu button:hover,
body.is-chat .message-menu button:hover,
body.is-chat .contact-menu button:hover{background:#ededed}
body.is-chat .gc-group-menu{width:196px;min-width:196px;padding:6px}
body.is-chat .gc-group-menu button{width:100%;height:38px;gap:10px;padding:0 10px;font-size:12px}
body.is-chat .gc-group-menu button>span:first-child{width:24px;height:24px;display:grid;place-items:center;flex:0 0 24px;border-radius:7px;color:#2377c9;background:#eaf4ff}
body.is-chat .gc-group-menu button>span:first-child .ui-icon{width:14px;height:14px}
body.is-chat .gc-group-menu button.danger{color:#d64a45}
body.is-chat .gc-group-menu button.danger>span:first-child{color:#d64a45;background:#fff0ef}
body.is-chat .avatar-lightbox{background:rgba(0,0,0,.78);backdrop-filter:none}

@media(max-width:820px){
  body.is-chat .modal,
  body.is-chat .gc-dialog,
  body.is-chat .gc-info-modal,
  body.is-chat .gc-action-dialog{align-items:end;padding:0}
  body.is-chat .modal-card,
  body.is-chat .gc-dialog-card,
  body.is-chat .gc-info-card,
  body.is-chat .gc-action-card{
    width:100%!important;
    max-width:none;
    padding:20px 18px max(18px,env(safe-area-inset-bottom));
    border-width:1px 0 0;
    border-radius:12px 12px 0 0;
    box-shadow:0 -8px 28px rgba(0,0,0,.14);
  }
  body.is-chat .modal-card::before{background:#c8c8c8}
  body.is-chat .confirm-layer{align-items:end;padding:12px 12px max(12px,env(safe-area-inset-bottom))}
  body.is-chat .confirm-card{width:100%;border-radius:10px}
  body.is-chat .message-menu,
  body.is-chat .contact-menu{border-radius:10px}
}

/* Slim service-notice banner used by group announcements. */
body.is-chat .gc-announcement-bar{
  height:38px;
  gap:9px;
  padding:0 14px;
  border-top:1px solid #f0d9a2;
  border-bottom:1px solid #d9bd67;
  color:#76521f;
  background:linear-gradient(180deg,#fff0f0 0%,#fff8d8 54%,#fffceb 100%);
  box-shadow:none;
}
body.is-chat .gc-announcement-bar>strong{display:none}
body.is-chat .gc-announcement-bar .gc-announcement-icon{width:18px;height:18px;flex-basis:18px;color:inherit}
body.is-chat .gc-announcement-track{min-width:0;flex:1;overflow:hidden;white-space:nowrap}
body.is-chat .gc-announcement-track span{
  display:inline-block;
  width:max-content;
  min-width:0;
  padding-left:0;
  color:#76521f;
  font-size:13px;
  font-weight:400;
  line-height:36px;
  animation-name:gc-announcement-scroll;
  animation-duration:14s;
  animation-timing-function:linear;
  animation-iteration-count:infinite;
  will-change:transform;
}
@keyframes gc-announcement-scroll{
  from{transform:translate3d(var(--gc-announcement-start,100%),0,0)}
  to{transform:translate3d(var(--gc-announcement-end,-100%),0,0)}
}
@media(min-width:821px){
  body.is-chat .group-chat-mode .chat-panel.gc-has-announcement{grid-template-rows:92px 38px minmax(0,1fr) auto}
}
@media(max-width:820px){
  body.is-chat .group-chat-mode .chat-panel.gc-has-announcement{grid-template-rows:calc(56px + env(safe-area-inset-top)) 38px minmax(0,1fr) auto}
  body.is-chat .gc-announcement-bar{height:38px;padding:0 10px}
  body.is-chat .gc-announcement-track span{font-size:12px}
}

@media(max-width:820px){
  body.is-chat{--v2-blue:#07c160;--v2-blue-deep:#06ad56;--bubble:#95ec69}
  body.is-chat .h5-section,body.is-chat .h5-section-head{background:#fff}
  body.is-chat .contact.active,body.is-chat .contact.pinned.active{color:#162033;border-bottom-color:#ededed;background:#fff;box-shadow:none}
  body.is-chat .contact.active .contact-copy strong,body.is-chat .contact.pinned.active .contact-copy strong{color:#162033}
  body.is-chat .contact.active .contact-copy small,body.is-chat .contact.active time>span,body.is-chat .contact.pinned.active .contact-copy small,body.is-chat .contact.pinned.active time>span{color:#8290a5}
  body.is-chat .contact.active .pinned-label,body.is-chat .contact.pinned.active .pinned-label{color:#4d7398;background:#deedfb}
  body.is-chat .contact.active:active,body.is-chat .contact.pinned.active:active{background:#ededed}
  body.is-chat .h5-nav>button.active{color:#07c160;background:transparent}
  body.is-chat .chat-panel,body.is-chat .messages{background:#ededed}
  body.is-chat .chat-head{border-bottom-color:#dcdcdc;background:rgba(247,247,247,.98);box-shadow:none}
  body.is-chat .bubble{border-color:#ddd;border-radius:5px;background:#fff;box-shadow:none}
  body.is-chat .bubble::before{background:#fff;filter:none}
  body.is-chat .message-row.mine .bubble{border-color:#86d75e;background:#95ec69;box-shadow:none}
  body.is-chat .message-row.mine .bubble::before{background:#95ec69;filter:none}
  body.is-chat .compose-area{border-top-color:#ddd;background:#f7f7f7;box-shadow:none}
  body.is-chat .message-field{border-color:#ddd;background:#fff;box-shadow:none}
  body.is-chat .send{background:#07c160;box-shadow:none}
  body.is-chat .send:disabled{color:#aaa;background:#e9e9e9;opacity:1}
}

/* WeChat-inspired authentication screen. */
body.is-auth{
  --green:#07c160;
  --green-dark:#06ad56;
  position:relative;
  min-height:100dvh;
  overflow:auto;
  color:#222;
  background:linear-gradient(125deg,#e7f6ed 0%,#edf4f2 28%,#dff3ec 52%,#eef1f0 76%,#e2f5eb 100%);
  background-size:320% 320%;
  animation:auth-water-flow 16s ease-in-out infinite;
}
body.is-auth::before,
body.is-auth::after{
  content:"";
  position:fixed;
  z-index:0;
  width:62vw;
  height:62vw;
  min-width:520px;
  min-height:520px;
  border-radius:42% 58% 63% 37% / 46% 42% 58% 54%;
  pointer-events:none;
  filter:blur(54px);
  will-change:transform;
}
body.is-auth::before{
  top:-30vw;
  left:-18vw;
  background:radial-gradient(ellipse at 58% 55%,rgba(7,193,96,.18),rgba(85,210,182,.09) 42%,rgba(255,255,255,0) 72%);
  animation:auth-water-drift-one 13s ease-in-out infinite alternate;
}
body.is-auth::after{
  right:-22vw;
  bottom:-34vw;
  background:radial-gradient(ellipse at 42% 42%,rgba(62,181,205,.16),rgba(7,193,96,.08) 44%,rgba(255,255,255,0) 72%);
  animation:auth-water-drift-two 17s ease-in-out infinite alternate;
}
@keyframes auth-water-flow{
  0%,100%{background-position:0% 48%}
  50%{background-position:100% 52%}
}
@keyframes auth-water-drift-one{
  from{transform:translate3d(0,0,0) rotate(-6deg) scale(1)}
  to{transform:translate3d(13vw,10vh,0) rotate(8deg) scale(1.12)}
}
@keyframes auth-water-drift-two{
  from{transform:translate3d(0,0,0) rotate(7deg) scale(1.08)}
  to{transform:translate3d(-15vw,-9vh,0) rotate(-9deg) scale(.96)}
}
body.is-auth .shell{
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:24px;
}
body.is-auth .auth{
  width:min(400px,100%);
  display:block;
}
body.is-auth .auth-card{
  width:100%;
  grid-column:auto;
  padding:30px 32px 28px;
  border:1px solid #d8d8d8;
  border-radius:8px;
  background:#fff;
  box-shadow:0 12px 36px rgba(0,0,0,.12);
  backdrop-filter:none;
  animation:none;
}
body.is-auth .login-brand{
  justify-content:center;
  gap:10px;
  margin-bottom:24px;
}
body.is-auth .login-brand>img{
  width:48px;
  height:48px;
  border:0;
  border-radius:6px;
  box-shadow:none;
  mix-blend-mode:normal;
  filter:none;
}
body.is-auth .login-brand strong{
  color:#222;
  font-size:22px;
  font-weight:600;
  letter-spacing:0;
}
body.is-auth .tabs{
  margin-bottom:22px;
  padding:3px;
  border:1px solid #e5e5e5;
  border-radius:5px;
  background:#f2f2f2;
}
body.is-auth .tab{
  height:38px;
  border-radius:4px;
  color:#777;
}
body.is-auth .tab.active{
  color:#07a84f;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.08);
}
body.is-auth .auth-card label,
body.is-auth .auth-reset label{
  gap:7px;
  margin:15px 0;
  color:#555;
  font-size:13px;
  font-weight:500;
}
body.is-auth .auth-card input,
body.is-auth .auth-reset input{
  height:46px;
  padding:0 12px;
  border:1px solid #d8d8d8;
  border-radius:5px;
  color:#222;
  background:#f7f7f7;
  box-shadow:none;
}
body.is-auth .auth-card input:focus,
body.is-auth .auth-reset input:focus{
  border-color:#07c160;
  background:#fff;
  box-shadow:0 0 0 2px rgba(7,193,96,.1);
}
body.is-auth .remember-login{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:-1px 0 15px;
  color:#666;
}
body.is-auth .remember-login.hidden{display:none}
body.is-auth .remember-login label{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
  color:#444;
  font-size:13px;
  font-weight:400;
  cursor:pointer;
}
body.is-auth .remember-login input{
  width:16px;
  height:16px;
  padding:0;
  margin:0;
  accent-color:#07c160;
  box-shadow:none;
}
body.is-auth .remember-login small{color:#999;font-size:11px;white-space:nowrap}
body.is-auth .captcha-field{grid-template-columns:minmax(0,1fr) 118px;gap:9px}
body.is-auth .captcha-field img{
  width:118px;
  height:46px;
  border:1px solid #d5e1da;
  border-radius:5px;
  background:#f3f8f5;
  background:#f7f7f7;
}
body.is-auth .primary{
  height:46px;
  margin-top:8px;
  border-radius:5px;
  color:#fff;
  background:#07c160;
  box-shadow:none;
}
body.is-auth .primary:hover{background:#06ad56}
body.is-auth .auth-link,
body.is-auth .auth-back{color:#078e47}
body.is-auth .auth-reset h3,
body.is-auth .auth-result h3{color:#222;font-size:19px;font-weight:600}
body.is-auth .auth-result p{color:#666}
body.is-auth .recovery-code{
  border:1px dashed #78c99d;
  border-radius:5px;
  color:#078e47;
  background:#edf8f1;
}
body.is-auth button:focus-visible,
body.is-auth input:focus-visible{box-shadow:0 0 0 2px rgba(7,193,96,.13)}

@media(max-width:480px){
  body.is-auth{
    background:linear-gradient(145deg,#f2faf5 0%,#e5f5ed 45%,#f7faf8 100%);
    background-size:280% 280%;
  }
  body.is-auth::before,body.is-auth::after{min-width:380px;min-height:380px;filter:blur(46px);opacity:.72}
  body.is-auth .shell{align-items:start;padding:max(36px,env(safe-area-inset-top)) 18px 24px;overflow-y:auto}
  body.is-auth .auth{width:100%}
  body.is-auth .auth-card{
    width:100%;
    padding:24px 14px;
    border:1px solid rgba(255,255,255,.72);
    border-radius:8px;
    background:rgba(255,255,255,.9);
    box-shadow:0 8px 28px rgba(35,92,66,.08);
    backdrop-filter:blur(12px);
  }
  body.is-auth .login-brand{margin-bottom:26px}
  body.is-auth .captcha-field{grid-template-columns:minmax(0,1fr) 108px}
  body.is-auth .captcha-field img{width:108px}
}

@media(prefers-reduced-motion:reduce){
  body.is-auth,body.is-auth::before,body.is-auth::after{animation:none!important}
}

/* H5 WeChat-style compact composer. Desktop composer remains unchanged. */
body.is-chat .h5-more-tool{display:none}
@media(max-width:820px){
  body.is-chat .compose-area{
    border-top:1px solid #dedede;
    background:#f7f7f7;
    box-shadow:none;
  }
  body.is-chat #messageForm.composer{
    position:relative;
    display:grid;
    grid-template-columns:40px minmax(0,1fr) 40px 40px auto;
    grid-template-rows:auto;
    align-items:end;
    gap:7px;
    min-height:0;
    padding:8px 8px max(8px,env(safe-area-inset-bottom));
    background:#f7f7f7;
  }
  body.is-chat.h5-keyboard-open #messageForm.composer{padding-bottom:7px}
  body.is-chat .compose-toolbar,
  body.is-chat .compose-tools,
  body.is-chat .message-field{display:contents}
  body.is-chat .compose-shortcut,
  body.is-chat .paste-hint,
  body.is-chat .clear-message{display:none!important}
  body.is-chat .tool-btn{
    width:40px;
    height:40px;
    min-width:0;
    display:grid;
    place-items:center;
    gap:0;
    padding:0;
    border:0;
    border-radius:5px;
    color:#222;
    background:transparent;
  }
  body.is-chat .tool-btn:hover{color:#222;background:transparent}
  body.is-chat .tool-btn .ui-icon{width:28px;height:28px;stroke-width:1.65}
  body.is-chat .tool-btn>span{display:none}
  body.is-chat .tool-image{grid-column:1;grid-row:1;color:#222}
  body.is-chat #messageInput{
    grid-column:2;
    grid-row:1;
    align-self:end;
    width:100%;
    height:40px!important;
    min-height:40px;
    max-height:100px;
    overflow-y:auto;
    padding:9px 11px;
    border:0!important;
    border-radius:5px;
    color:#222;
    background:#fff;
    box-shadow:none!important;
    font-size:16px!important;
    line-height:22px;
  }
  body.is-chat #messageInput::placeholder{color:#b2b2b2}
  body.is-chat .tool-emoji{grid-column:3;grid-row:1;color:#222}
  body.is-chat .h5-more-tool{grid-column:4;grid-row:1;display:grid;color:#222}
  body.is-chat .send{
    grid-column:5;
    grid-row:1;
    position:static;
    align-self:end;
    width:auto;
    min-width:54px;
    height:40px;
    padding:0 13px;
    border-radius:5px;
    color:#fff;
    background:#07c160;
    box-shadow:none;
    font-size:14px;
    font-weight:500;
  }
  body.is-chat .send .ui-icon{display:none}
  body.is-chat .send:not(:disabled):hover{background:#06ad56;filter:none}
  body.is-chat .send:disabled{color:#aaa;background:#e5e5e5;opacity:1}
  body.is-chat .tool-video,
  body.is-chat .tool-audio,
  body.is-chat .tool-file{
    position:absolute;
    z-index:8;
    bottom:56px;
    display:none;
    width:64px;
    height:58px;
    padding:6px 4px 4px;
    border:1px solid #e4e4e4;
    border-radius:7px;
    background:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,.13);
  }
  body.is-chat .compose-tools.h5-more-open .tool-video,
  body.is-chat .compose-tools.h5-more-open .tool-audio,
  body.is-chat .compose-tools.h5-more-open .tool-file{display:flex;flex-direction:column}
  body.is-chat .compose-tools.h5-more-open .tool-video{right:142px}
  body.is-chat .compose-tools.h5-more-open .tool-audio{right:76px}
  body.is-chat .compose-tools.h5-more-open .tool-file{right:10px}
  body.is-chat .compose-tools.h5-more-open .tool-video>span,
  body.is-chat .compose-tools.h5-more-open .tool-audio>span,
  body.is-chat .compose-tools.h5-more-open .tool-file>span{display:block;color:#555;font-size:11px;line-height:1}
  body.is-chat .emoji-panel{
    right:8px;
    bottom:calc(64px + env(safe-area-inset-bottom));
    left:8px;
    width:auto;
  }
}

@media(max-width:390px){
  body.is-chat #messageForm.composer{
    grid-template-columns:36px minmax(0,1fr) 36px 36px auto;
    gap:4px;
    padding-right:6px;
    padding-left:6px;
  }
  body.is-chat .tool-btn{width:36px}
  body.is-chat .tool-btn .ui-icon{width:26px;height:26px}
  body.is-chat .send{min-width:50px;padding:0 10px}
  body.is-chat .compose-tools.h5-more-open .tool-video,
  body.is-chat .compose-tools.h5-more-open .tool-audio,
  body.is-chat .compose-tools.h5-more-open .tool-file{width:60px}
}

/* PC readability pass: final theme override, H5 remains unchanged. */
@media(min-width:821px){
  body.is-chat .search input{font-size:13px}
  body.is-chat .contact-copy strong{font-size:15px}
  body.is-chat .contact-copy small{font-size:13px;line-height:1.35}
  body.is-chat .contact time{font-size:11px}
  body.is-chat .gc-conversation-type,
  body.is-chat .contact-online-label,
  body.is-chat .pinned-label{font-size:10px}

  body.is-chat .peer-heading>span,
  body.is-chat .peer-heading>.peer-account,
  body.is-chat .peer-heading .peer-group-summary{font-size:13px}
  body.is-chat .history-entry{font-size:13px}
  body.is-chat .gc-announcement-track span{font-size:14px}

  body.is-chat .bubble{font-size:15px}
  body.is-chat .gc-sender-name{font-size:12px}
  body.is-chat .bubble time{font-size:12px}
  body.is-chat .quoted-message strong,
  body.is-chat .quoted-message span{font-size:12px}

  body.is-chat .tool-btn,
  body.is-chat .tool-btn span{font-size:14px}
  body.is-chat .compose-shortcut{font-size:12px}
  body.is-chat #messageInput{font-size:15px}
  body.is-chat .paste-hint{font-size:12px}
}

/* H5 "Me" page: WeChat-style personal center. */
@media(max-width:820px){
  body.is-chat .h5-nav{grid-template-columns:repeat(5,minmax(0,1fr));padding:5px 4px max(5px,env(safe-area-inset-bottom));border-top:1px solid #dedede;background:rgba(247,247,247,.97);box-shadow:none}
  body.is-chat .h5-nav>button{border-radius:0;color:#7d8890;background:transparent;font-size:11px}
  body.is-chat .h5-nav>button.active{color:#07c160;background:transparent}

  body.is-chat #h5MePage{background:#ededed}
  body.is-chat #h5MePage .h5-me-head{display:none}
  body.is-chat #h5MePage .h5-section-body{padding:0 0 calc(24px + env(safe-area-inset-bottom));background:#ededed}
  body.is-chat #h5MePage .h5-profile-hero{
    min-height:245px;
    gap:18px;
    padding:calc(54px + env(safe-area-inset-top)) 24px 38px;
    border-radius:0;
    background:#fff;
    box-shadow:none;
  }
  body.is-chat #h5MePage .h5-profile-avatar{
    width:72px;
    height:72px;
    flex-basis:72px;
    border-radius:7px;
    box-shadow:none;
    font-size:24px;
  }
  body.is-chat #h5MePage .h5-profile-copy{align-self:center;gap:8px}
  body.is-chat #h5MePage .h5-profile-copy strong{color:#111;font-size:22px;font-weight:600;line-height:1.2}
  body.is-chat #h5MePage .h5-profile-copy small{color:#737373;font-size:15px;line-height:1.25}
  body.is-chat #h5MePage .h5-profile-status{display:flex;align-items:center;gap:8px;margin-top:1px}
  body.is-chat #h5MePage .h5-profile-status i{height:27px;display:inline-flex;align-items:center;padding:0 9px;border:1px solid #dedede;border-radius:14px;color:#777;background:#fff;font-size:13px;font-style:normal;line-height:1}
  body.is-chat #h5MePage .h5-profile-status i:last-child{width:27px;justify-content:center;padding:0;font-size:16px}
  body.is-chat #h5MePage .h5-profile-actions{display:flex;align-items:center;gap:13px;flex:0 0 auto;color:#9b9b9b}
  body.is-chat #h5MePage .h5-profile-qr{width:21px;height:21px;fill:#687582}
  body.is-chat #h5MePage .h5-profile-actions .arrow{width:18px;height:18px;color:#aaa}

  body.is-chat #h5MePage .h5-menu-group{margin:10px 0 0;border-radius:0;background:#fff;box-shadow:none}
  body.is-chat #h5MePage .h5-menu-group>button{min-height:57px;gap:14px;padding:0 17px;border-bottom:1px solid #e5e5e5;background:#fff;font-size:16px}
  body.is-chat #h5MePage .h5-menu-group>button:last-child{border-bottom:0}
  body.is-chat #h5MePage .h5-menu-group>button:active{background:#e5e5e5}
  body.is-chat #h5MePage .h5-menu-group>button>span:nth-child(2){color:#171717;font-weight:400}
  body.is-chat #h5MePage .h5-menu-group .arrow{width:17px;height:17px;color:#aaa}
  body.is-chat #h5MePage .h5-menu-line-icon{width:27px;height:27px;display:grid;place-items:center;flex:0 0 27px;background:transparent}
  body.is-chat #h5MePage .h5-menu-line-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
  body.is-chat #h5MePage .h5-menu-line-icon.service{color:#10b981}
  body.is-chat #h5MePage .h5-menu-line-icon.favorite{color:#ffb529}
  body.is-chat #h5MePage .h5-menu-line-icon.moments{color:#169bd5}
  body.is-chat #h5MePage .h5-menu-line-icon.emoji{color:#ffc21a}
  body.is-chat #h5MePage .h5-menu-line-icon.files{color:#2f94dc}
  body.is-chat #h5MePage .h5-menu-line-icon.settings{color:#2397df}
  body.is-chat #h5MePage .h5-me-main-group,
  body.is-chat #h5MePage .h5-me-settings-group{margin-top:10px}
}

@media(max-width:360px){
  body.is-chat #h5MePage .h5-profile-hero{gap:13px;padding-right:16px;padding-left:16px}
  body.is-chat #h5MePage .h5-profile-avatar{width:66px;height:66px;flex-basis:66px}
  body.is-chat #h5MePage .h5-profile-copy strong{font-size:20px}
  body.is-chat #h5MePage .h5-profile-copy small{font-size:13px}
  body.is-chat #h5MePage .h5-profile-actions{gap:7px}
}
