/* V1.1.157 · 前端轻盈雾蓝 / 淡香芋玻璃主题
 * 只变更表现层；保留群/私聊业务 DOM、权限、消息发送及 WebView 安全区逻辑。
 * 仅覆盖浅色模式；用户主动选择暗色模式时沿用既有暗色主题。
 */
:root:not([data-chat-theme="dark"]){
  --canvas:#eef0ff;
  --ui-canvas:#eef0ff;
  --ui-surface:rgba(255,255,255,.74);
  --ui-ink:#303853;
  --ui-secondary:#74809e;
  --ui-primary:#647dc1;
  --ui-border:rgba(255,255,255,.64);
  --line:rgba(133,150,192,.16);
  --ink:#303853;
  --muted:#78839c;
  --blue:#647dc1;
  --glass-panel:rgba(255,255,255,.57);
  --glass-strong:rgba(255,255,255,.76);
  --glass-border:rgba(255,255,255,.69);
  --glass-shadow:0 8px 30px rgba(98,106,161,.075);
  --glass-backdrop:blur(18px) saturate(1.2);
  background:#e8f0ff;
}
:root:not([data-chat-theme="dark"]) body,
:root:not([data-chat-theme="dark"]) .splash,
:root:not([data-chat-theme="dark"]) .login-screen,
:root:not([data-chat-theme="dark"]) #member-app.app{
  background:radial-gradient(ellipse at 9% 8%,rgba(255,255,255,.73) 0%,rgba(255,255,255,0) 43%),
             radial-gradient(ellipse at 90% 72%,rgba(222,209,255,.42) 0%,rgba(222,209,255,0) 44%),
             linear-gradient(125deg,#e8f0ff 0%,#edf0ff 48%,#f3e8ff 100%);
}
:root:not([data-chat-theme="dark"]) .login-screen{background-attachment:fixed;}
:root:not([data-chat-theme="dark"]) .login-box,
:root:not([data-chat-theme="dark"]) .login-art span{
  background:var(--glass-strong);border:1px solid var(--glass-border);
  backdrop-filter:var(--glass-backdrop);-webkit-backdrop-filter:var(--glass-backdrop);
  box-shadow:var(--glass-shadow);border-radius:22px;
}
:root:not([data-chat-theme="dark"]) .login-field input{
  border:1px solid rgba(178,185,215,.35);border-radius:14px;background:rgba(255,255,255,.64);color:#34405c;
}
:root:not([data-chat-theme="dark"]) .login-box button[type="submit"]{
  background:#697eb9;color:#fff;border-radius:13px;
}
/* 桌面频道侧栏与群/会话列表各有轻透层；不使用厚重的分隔卡片。 */
:root:not([data-chat-theme="dark"]) #member-app .rail{
  background:rgba(255,255,255,.35);border-right:1px solid var(--glass-border);
  backdrop-filter:var(--glass-backdrop);-webkit-backdrop-filter:var(--glass-backdrop);
}
:root:not([data-chat-theme="dark"]) #member-app .list-pane,
:root:not([data-chat-theme="dark"]) #member-app .contacts-list-view{
  background:rgba(255,255,255,.45);border-right:1px solid rgba(255,255,255,.66);
  backdrop-filter:blur(16px) saturate(1.12);-webkit-backdrop-filter:blur(16px) saturate(1.12);
}
:root:not([data-chat-theme="dark"]) #member-app .list-top,
:root:not([data-chat-theme="dark"]) #member-app .search-wrap,
:root:not([data-chat-theme="dark"]) #member-app .contacts-search-row,
:root:not([data-chat-theme="dark"]) #member-app .contacts-results,
:root:not([data-chat-theme="dark"]) #member-app .member-foot{background:transparent;}
:root:not([data-chat-theme="dark"]) #member-app :is(.search-wrap input,.contacts-search input){
  border:1px solid rgba(255,255,255,.66);border-radius:14px;
  background:rgba(255,255,255,.57);box-shadow:0 2px 10px rgba(100,111,159,.025);
  color:#303b55;
}
:root:not([data-chat-theme="dark"]) #member-app :is(.search-wrap input,.contacts-search input):focus{
  background:rgba(255,255,255,.88);box-shadow:0 0 0 3px rgba(118,132,191,.12);
}
:root:not([data-chat-theme="dark"]) #member-app .rail-avatar,
:root:not([data-chat-theme="dark"]) #member-app .profile-avatar,
:root:not([data-chat-theme="dark"]) #member-app .chat-avatar,
:root:not([data-chat-theme="dark"]) #member-app .msg-avatar,
:root:not([data-chat-theme="dark"]) #member-app .group-icon,
:root:not([data-chat-theme="dark"]) #member-app .dm-inbox-avatar{
  border-radius:50%;border:1px solid rgba(255,255,255,.82);
  box-shadow:0 3px 11px rgba(88,104,151,.09);overflow:hidden;
}
:root:not([data-chat-theme="dark"]) #member-app .rail-btn{border-radius:16px;color:#7c87a3;}
:root:not([data-chat-theme="dark"]) #member-app .rail-btn.active,
:root:not([data-chat-theme="dark"]) #member-app .rail-btn:hover{
  background:rgba(228,228,253,.72);color:#6175b7;
}
:root:not([data-chat-theme="dark"]) #member-app .group-row,
:root:not([data-chat-theme="dark"]) #member-app .dm-inbox-item,
:root:not([data-chat-theme="dark"]) #member-app .dm-inbox-row{
  background:transparent;border-bottom-color:rgba(150,162,192,.12);
}
:root:not([data-chat-theme="dark"]) #member-app :is(.group-row:hover,.group-row.chosen,.dm-inbox-item.chosen,.dm-inbox-item.chosen .dm-inbox-row){
  background:rgba(255,255,255,.53);border-radius:12px;
}
:root:not([data-chat-theme="dark"]) #member-app :is(.group-row,.dm-inbox-row){transition:background-color .16s ease;}
:root:not([data-chat-theme="dark"]) #member-app .group-info strong{color:#35415a;}
/* 中部聊天画布不加卡片：渐变透过消息间的留白，保持阅读连续性。 */
:root:not([data-chat-theme="dark"]) #member-app .chat-pane,
:root:not([data-chat-theme="dark"]) #member-app .messages,
:root:not([data-chat-theme="dark"]) #member-app .profile-pane,
:root:not([data-chat-theme="dark"]) #member-app .dm-message-list{
  background:transparent;
}
:root:not([data-chat-theme="dark"]) #member-app .chat-header,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-head{
  border-bottom:1px solid rgba(255,255,255,.63);
  background:rgba(255,255,255,.34);
  backdrop-filter:blur(13px);-webkit-backdrop-filter:blur(13px);
}
:root:not([data-chat-theme="dark"]) #member-app .chat-heading h2{color:#303a58;}
:root:not([data-chat-theme="dark"]) #member-app .chat-header-more{color:#68779c;}
:root:not([data-chat-theme="dark"]) #member-app .msg-avatar{border-radius:50%!important;}
:root:not([data-chat-theme="dark"]) #member-app .msg-bubble,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-bubble{
  border:1px solid rgba(255,255,255,.78);
  border-radius:7px 18px 18px 18px;
  background:rgba(255,255,255,.65);
  box-shadow:0 3px 12px rgba(94,99,155,.055);
  backdrop-filter:blur(9px) saturate(1.15);-webkit-backdrop-filter:blur(9px) saturate(1.15);
  color:#303950;
}
:root:not([data-chat-theme="dark"]) #member-app .msg-row.mine .msg-bubble,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-message.mine .dm-bubble{
  border:1px solid rgba(243,240,255,.82);
  border-radius:18px 7px 18px 18px;
  background:linear-gradient(132deg,rgba(212,220,254,.76),rgba(225,207,249,.74));
  box-shadow:0 3px 13px rgba(98,101,162,.07);
  color:#303952;
}
:root:not([data-chat-theme="dark"]) #member-app .msg-alias,
:root:not([data-chat-theme="dark"]) #member-app .msg-status,
:root:not([data-chat-theme="dark"]) #member-app .dm-time{color:#8290a9;}
:root:not([data-chat-theme="dark"]) #member-app .chat-date{
  color:#6e7995;border:1px solid rgba(255,255,255,.66);background:rgba(255,255,255,.45);
  border-radius:20px;
}
/* 群聊和私聊共用输入区质感，沿用既有键盘、发送与附件按钮的响应逻辑。 */
:root:not([data-chat-theme="dark"]) #member-app .compose,
:root:not([data-chat-theme="dark"]) #member-app #chat-pane .group-dm-panel .dm-compose.compose{
  border-top:1px solid rgba(255,255,255,.7);
  background:rgba(255,255,255,.49);
  backdrop-filter:blur(17px) saturate(1.15);-webkit-backdrop-filter:blur(17px) saturate(1.15);
  box-shadow:0 -4px 20px rgba(104,110,158,.032);
}
:root:not([data-chat-theme="dark"]) #member-app .compose :is(textarea,input),
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-compose :is(textarea,input){
  color:#303b56;
}
:root:not([data-chat-theme="dark"]) #member-app :is(.compose-tool,.compose-mobile-tool){color:#6d7a9a;}
:root:not([data-chat-theme="dark"]) #member-app :is(#send-button,#dm-send,.group-empty-discover){
  border:1px solid rgba(255,255,255,.55);border-radius:13px;
  background:rgba(111,133,192,.88);color:#fff;box-shadow:0 3px 12px rgba(90,106,163,.105);
}
:root:not([data-chat-theme="dark"]) #member-app :is(#send-button,#dm-send):disabled{opacity:.43;}
:root:not([data-chat-theme="dark"]) #member-app .compose-panel,
:root:not([data-chat-theme="dark"]) #member-app .chat-info-panel,
:root:not([data-chat-theme="dark"]) #member-app .member-profile-edit,
:root:not([data-chat-theme="dark"]) #member-app .group-library-panel,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel.is-settings-overlay{
  background:rgba(248,249,255,.88);border:1px solid var(--glass-border);
  box-shadow:0 14px 36px rgba(81,88,136,.13);border-radius:20px;
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
}
:root:not([data-chat-theme="dark"]) #member-app .chat-info-row,
:root:not([data-chat-theme="dark"]) #member-app .profile-menu-row{border-bottom-color:rgba(132,151,188,.14);}
:root:not([data-chat-theme="dark"]) #member-app .profile-menu-card,
:root:not([data-chat-theme="dark"]) #member-app .profile-logout,
:root:not([data-chat-theme="dark"]) #member-app .group-library-footer,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-toolbar,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-thread-list{
  background:rgba(255,255,255,.45);
}
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel.is-conversation{
  background:transparent;
}
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-person,
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-grant-row{
  background:rgba(255,255,255,.45);border-bottom-color:rgba(144,154,190,.13);
}
:root:not([data-chat-theme="dark"]) #member-app .group-dm-panel .dm-unread{background:#7187c1;}
:root:not([data-chat-theme="dark"]) #member-app .mobile-tabs{
  background:rgba(246,246,255,.64);border-top:1px solid rgba(255,255,255,.65);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
}
:root:not([data-chat-theme="dark"]) #member-app .group-empty-discover{background:rgba(230,233,255,.74);color:#536ba3;}
:root:not([data-chat-theme="dark"]) #member-app .group-empty-discover:hover{background:rgba(218,225,254,.84);}
@media(max-width:760px){
  :root:not([data-chat-theme="dark"]) #member-app .rail{background:transparent;}
  :root:not([data-chat-theme="dark"]) #member-app .list-pane,
  :root:not([data-chat-theme="dark"]) #member-app .contacts-list-view{background:transparent;border-right:0;}
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .chat-pane,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .messages{background:transparent!important;}
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .chat-header{
    background:rgba(250,249,255,.49)!important;border-bottom-color:rgba(255,255,255,.7)!important;
    backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  }
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .compose,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app #chat-pane .group-dm-panel .dm-compose{
    background:rgba(250,249,255,.61)!important;border-top-color:rgba(255,255,255,.7)!important;
  }
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .compose-form #message-text,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .compose-form #message-text:focus,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app #chat-pane .group-dm-panel .dm-compose #dm-text{
    background:rgba(255,255,255,.72)!important;border:1px solid rgba(255,255,255,.85)!important;
    border-radius:15px!important;box-shadow:0 2px 8px rgba(108,118,161,.055)!important;
  }
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .msg-bubble,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .group-dm-panel .dm-bubble{
    border-radius:7px 17px 17px 17px!important;
    background:rgba(255,255,255,.66)!important;color:#303950!important;
    box-shadow:0 2px 9px rgba(90,96,153,.055)!important;
  }
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .msg-row.mine .msg-bubble,
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .group-dm-panel .dm-message.mine .dm-bubble{
    border-radius:17px 7px 17px 17px!important;
    background:linear-gradient(135deg,rgba(212,220,254,.82),rgba(227,209,250,.8))!important;
    color:#303952!important;
  }
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .msg-avatar{border-radius:50%!important;}
  :root:not([data-chat-theme="dark"]) body.in-chat #member-app .compose-form #send-button{
    background:#7488c0!important;color:#fff!important;border-radius:11px!important;
  }
  :root:not([data-chat-theme="dark"]) #member-app .group-dm-panel.is-conversation{
    background:transparent!important;
  }
}
/* 旧版为保证文字可读性曾在普通群消息上加 !important 白底；
 * 在新版主题内精准覆盖文字气泡，不触碰图片/语音/视频独立媒体容器。 */
:root:not([data-chat-theme="dark"]) #member-app .msg-row:not(.mine) .msg-bubble:not(.msg-image-bubble){
  border:1px solid rgba(255,255,255,.8)!important;
  border-radius:7px 18px 18px 18px!important;
  background:rgba(255,255,255,.66)!important;
  color:#303950!important;-webkit-text-fill-color:#303950!important;
  box-shadow:0 3px 12px rgba(94,99,155,.055)!important;
}
:root:not([data-chat-theme="dark"]) #member-app .msg-row.mine .msg-bubble:not(.msg-image-bubble){
  border:1px solid rgba(243,240,255,.82)!important;
  border-radius:18px 7px 18px 18px!important;
  background:linear-gradient(132deg,rgba(212,220,254,.76),rgba(225,207,249,.74))!important;
  color:#303952!important;-webkit-text-fill-color:#303952!important;
  box-shadow:0 3px 13px rgba(98,101,162,.07)!important;
}
/* 低性能WebView / 不支持 backdrop-filter：透明度略提高，确保文字与气泡对比度。 */
@supports not ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){
  :root:not([data-chat-theme="dark"]) #member-app :is(.rail,.list-pane,.compose,.chat-header,.mobile-tabs){background:rgba(250,250,255,.87)!important;}
  :root:not([data-chat-theme="dark"]) #member-app .msg-bubble{background:rgba(255,255,255,.93);}
}
@media (prefers-reduced-transparency:reduce){
  :root:not([data-chat-theme="dark"]) #member-app :is(.rail,.list-pane,.compose,.chat-header){background:rgba(251,251,255,.94)!important;backdrop-filter:none;-webkit-backdrop-filter:none;}
}
