/* Semantic colors shared by working controls; each style owns its palette. */
:root[data-client-variant]{--ref-font-scale:1;--ref-message-size:16px;--ref-accent:#07c160;--ref-action:#078344;--ref-on-action:#fff;--ref-accent-ink:#08793e;--ref-bg:#ededed;--ref-panel:#fff;--ref-text:#181818;--ref-secondary:#666666;--ref-line:#e5e5e5;--ref-topbar:#ededed;--ref-input:#fff;--ref-field:#f5f5f5;--ref-hover:#f3f3f3;--ref-selected:#e4f2e8;--ref-incoming:#fff;--ref-outgoing:#95ec69;--ref-outgoing-text:#14220c;--ref-meta:#425137;--ref-quote:#0000000a;--ref-chat-bg:#ededed;--ref-menu:#4c4c4c;--ref-menu-text:#fff;--ref-danger:#c9363e;--ref-focus:#087c42;--ref-avatar:#e8f1f5;--ref-avatar-text:#34657e;--ref-shadow:0 12px 40px #0002;--ref-backdrop:#0005;--ink:var(--ref-text);--muted:var(--ref-secondary);--line:var(--ref-line);--surface:var(--ref-panel);--primary:var(--ref-action);color:var(--ref-text);background:var(--ref-bg);color-scheme:light}
:root[data-client-variant=telegram]{--ref-accent:#3390ec;--ref-action:#246fb6;--ref-on-action:#fff;--ref-accent-ink:#226ba8;--ref-bg:#eef1f5;--ref-panel:#fff;--ref-text:#17212b;--ref-secondary:#586775;--ref-line:#e7ebef;--ref-topbar:#fff;--ref-input:#fff;--ref-field:#f0f3f6;--ref-hover:#f2f6fa;--ref-selected:#e6f0fa;--ref-incoming:#fff;--ref-outgoing:#e2ffc7;--ref-outgoing-text:#15220f;--ref-meta:#526b40;--ref-chat-bg:#dce7df;--ref-menu:#fff;--ref-menu-text:#17212b;--ref-focus:#2577bf;--ref-avatar:#e1edf8;--ref-avatar-text:#316f9f}
:root[data-client-variant=wechat][data-theme=dark]{--ref-bg:#111;--ref-panel:#191919;--ref-text:#ededed;--ref-secondary:#b0b0b0;--ref-line:#303030;--ref-topbar:#191919;--ref-input:#292929;--ref-field:#242424;--ref-hover:#282828;--ref-selected:#23382b;--ref-incoming:#2c2c2c;--ref-outgoing:#3eb575;--ref-outgoing-text:#081b12;--ref-meta:#153b27;--ref-quote:#ffffff12;--ref-chat-bg:#111;--ref-menu:#383838;--ref-menu-text:#f5f5f5;--ref-action:#74d79b;--ref-on-action:#102819;--ref-accent-ink:#7edba3;--ref-danger:#ff9399;--ref-focus:#7edba3;--ref-avatar:#2d3e38;--ref-avatar-text:#a5d3bd;color-scheme:dark}
:root[data-client-variant=telegram][data-theme=dark]{--ref-bg:#0e1621;--ref-panel:#17212b;--ref-text:#e9eef4;--ref-secondary:#a5b3c2;--ref-line:#2b3a49;--ref-topbar:#17212b;--ref-input:#223142;--ref-field:#203040;--ref-hover:#233443;--ref-selected:#28435a;--ref-incoming:#223346;--ref-outgoing:#2b5278;--ref-outgoing-text:#f3f8fc;--ref-meta:#bfd8ee;--ref-quote:#ffffff12;--ref-chat-bg:#0e1621;--ref-menu:#223142;--ref-menu-text:#edf3f8;--ref-action:#8bc7fa;--ref-on-action:#102436;--ref-accent-ink:#8bc7fa;--ref-danger:#ff9a9e;--ref-focus:#8bc7fa;--ref-avatar:#264156;--ref-avatar-text:#b7ddfb;color-scheme:dark}
@media(prefers-color-scheme:dark){:root[data-client-variant]:not([data-theme]){--ref-bg:#111923;--ref-panel:#192532;--ref-text:#edf2f7;--ref-secondary:#b0bdca;--ref-field:#233344;--ref-input:#233344;--ref-line:#354455;--ref-topbar:#192532;color-scheme:dark}}
:root[data-client-variant] body{color:var(--ref-text);background:var(--ref-bg)}
:root[data-client-variant] .conversation-panel,:root[data-client-variant] .ref-screen,:root[data-client-variant] .ref-page-body{color:var(--ref-text);background:var(--ref-bg)}
:root[data-client-variant] .panel-heading,:root[data-client-variant] .chat-heading,:root[data-client-variant] .ref-page-head{background:var(--ref-topbar);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .panel-heading h1,:root[data-client-variant] .chat-title h2,:root[data-client-variant] .ref-page-head h1{color:var(--ref-text)}
:root[data-client-variant] .chat-title p,:root[data-client-variant] .conversation-preview,:root[data-client-variant] .conversation-time,:root[data-client-variant] .ref-info,:root[data-client-variant] .ref-row-label small{color:var(--ref-secondary)}
:root[data-client-variant] .ref-row,:root[data-client-variant] .ref-profile-card,:root[data-client-variant] .ref-folders,:root[data-client-variant] .conversation-tools{background:var(--ref-panel);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .ref-row:hover,:root[data-client-variant] .conversation-item:hover{background:var(--ref-hover)}
:root[data-client-variant] .ref-row>svg,:root[data-client-variant] .ref-row-after{color:var(--ref-secondary)}
:root[data-client-variant] .ref-row:disabled{opacity:.55;cursor:default}
:root[data-client-variant] .ref-tabs{background:var(--ref-topbar);border-color:var(--ref-line)}
:root[data-client-variant] .ref-tab{color:var(--ref-secondary)}
:root[data-client-variant] .ref-tab[aria-current=true],:root[data-client-variant] .ref-folder[aria-selected=true]{color:var(--ref-accent-ink)}
:root[data-client-variant] .conversation-item{background:var(--ref-panel);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .conversation-text{background:transparent;color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .conversation-item.active,:root[data-client-variant] .conversation-list-row[data-pinned=true] .conversation-item{background:var(--ref-selected)}
:root[data-client-variant] .conversation-item .avatar,:root[data-client-variant] .ref-avatar{background:var(--ref-avatar);color:var(--ref-avatar-text)}
:root[data-client-variant] .search-field,:root[data-client-variant] input,:root[data-client-variant] textarea,:root[data-client-variant] select{background:var(--ref-field)!important;color:var(--ref-text)!important;border-color:var(--ref-line)!important;caret-color:var(--ref-accent-ink)}
:root[data-client-variant] input::placeholder,:root[data-client-variant] textarea::placeholder{color:var(--ref-secondary);opacity:1}
:root[data-client-variant] input:focus-visible,:root[data-client-variant] textarea:focus-visible,:root[data-client-variant] button:focus-visible,:root[data-client-variant] select:focus-visible{outline:2px solid var(--ref-focus);outline-offset:2px}
:root[data-client-variant] .chat-panel,:root[data-client-variant] .message-view{background-color:var(--ref-chat-bg)}
:root[data-client-variant][data-theme=dark] .message-view,:root[data-client-variant][data-wallpaper=plain] .message-view{background-image:none}
:root[data-client-variant] .message-bubble{background:var(--ref-incoming);color:var(--ref-text)}
:root[data-client-variant] .message-bubble:before{border-right-color:var(--ref-incoming)}
:root[data-client-variant] .own .message-bubble{background:var(--ref-outgoing);color:var(--ref-outgoing-text)}
:root[data-client-variant] .own .message-bubble:before{border-left-color:var(--ref-outgoing)}
:root[data-client-variant] .message-body{color:inherit;font-size:var(--ref-message-size)}
:root[data-client-variant] .own .message-body{color:var(--ref-outgoing-text)}
:root[data-client-variant] .message-meta{color:var(--ref-secondary);opacity:1;font-size:11px}
:root[data-client-variant] .own .message-meta,:root[data-client-variant] .own .message-meta:after{color:var(--ref-meta)}
:root[data-client-variant] .sender-name{color:var(--ref-secondary)}
:root[data-client-variant] .message-quote{color:inherit;background:var(--ref-quote);border-left-color:var(--ref-accent-ink)}
:root[data-client-variant] .message-quote strong{color:inherit}
:root[data-client-variant] .composer{background:var(--ref-topbar);border-color:var(--ref-line)}
:root[data-client-variant] .composer textarea,:root[data-client-variant] .composer #referenceEmoji,:root[data-client-variant] .composer #referenceAttach{background:var(--ref-input)!important;color:var(--ref-text)!important}
:root[data-client-variant=wechat] .composer #referenceEmoji,:root[data-client-variant=wechat] .composer #referenceAttach{background:transparent!important}
:root[data-client-variant] .composer .reply-preview,:root[data-client-variant] .ref-voice-hold{background:var(--ref-input);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .ref-voice-hold.recording{background:var(--ref-selected)}
:root[data-client-variant] .ref-icon,:root[data-client-variant] .icon-button,:root[data-client-variant] .text-button{color:var(--ref-text)}
:root[data-client-variant] .ref-primary,:root[data-client-variant] .primary-button,:root[data-client-variant] .composer .send-button{background:var(--ref-action);color:var(--ref-on-action)}
:root[data-client-variant=telegram] #referenceVoice{background:var(--ref-action);color:var(--ref-on-action)}
:root[data-client-variant] .ref-sheet,:root[data-client-variant] .new-dialog,:root[data-client-variant] .member-dialog,:root[data-client-variant] .settings-dialog{background:var(--ref-panel);color:var(--ref-text);border-color:var(--ref-line);box-shadow:var(--ref-shadow)}
:root[data-client-variant] .ref-sheet-head,:root[data-client-variant] .dialog-header,:root[data-client-variant] .ref-pagination{background:var(--ref-panel);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] dialog::backdrop{background:var(--ref-backdrop);backdrop-filter:none}
:root[data-client-variant] .ref-message-menu{background:var(--ref-menu);color:var(--ref-menu-text)}
:root[data-client-variant] .ref-menu-item{color:var(--ref-menu-text);border-color:var(--ref-line)}
:root[data-client-variant] .ref-menu-item:hover{background:var(--ref-hover);color:var(--ref-text)}
:root[data-client-variant] .ref-menu-reactions{border-color:var(--ref-line)}
:root[data-client-variant] .ref-menu-reactions button{background:none}
:root[data-client-variant] .ref-form-error,:root[data-client-variant] .form-error{color:var(--ref-danger)}
:root[data-client-variant] .ref-danger{background:var(--ref-danger);color:var(--ref-panel)}
:root[data-client-variant] .ref-attachment svg{background:var(--ref-field);color:var(--ref-accent-ink)}
:root[data-client-variant] .directory-row,:root[data-client-variant] .directory-filters,:root[data-client-variant] .directory-navigation,:root[data-client-variant] #memberRows{background:var(--ref-panel);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .directory-filters label,:root[data-client-variant] .dialog-help{color:var(--ref-secondary)}
:root[data-client-variant] .reply-preview strong,:root[data-client-variant] .ref-small,:root[data-client-variant] .ref-pagination button,:root[data-client-variant] .ref-person-name,:root[data-client-variant] .ref-pin-bar{color:var(--ref-accent-ink)}
:root[data-client-variant] .ref-selection-bar{background:var(--ref-panel);color:var(--ref-text)}
:root[data-client-variant] .auth-dialog,:root[data-client-variant] .auth-content{background:var(--ref-panel);color:var(--ref-text)}
:root[data-client-variant] .auth-content h1,:root[data-client-variant] .auth-dialog label{color:var(--ref-text)}
:root[data-client-variant] .auth-subtitle,:root[data-client-variant] .auth-footnote{color:var(--ref-secondary)}
.auth-app-identity{display:flex;align-items:center;gap:12px;margin-bottom:24px}.auth-app-name{font-weight:600;font-size:21px;color:var(--ref-text)}.auth-app-symbol{display:flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:12px;background:var(--ref-action);color:var(--ref-on-action);font-size:28px}
:root[data-client-variant] .segmented-control{background:var(--ref-field);border-color:var(--ref-line)}
:root[data-client-variant] .segmented-control button{background:transparent;color:var(--ref-secondary)}
:root[data-client-variant] .segmented-control button[aria-selected=true]{background:var(--ref-panel);color:var(--ref-accent-ink);box-shadow:0 1px 5px #0001}
:root[data-client-variant] .ref-rich-message{color:inherit}
:root[data-client-variant] .ref-favorite,:root[data-client-variant] .ref-request{border-color:var(--ref-line)}
:root[data-client-variant] progress{accent-color:var(--ref-action)}
:root[data-client-variant] .plugin-reactions button{background:var(--ref-field);color:var(--ref-text);border-color:var(--ref-line)}
:root[data-client-variant] .plugin-reactions button[aria-pressed=true]{background:var(--ref-selected);color:var(--ref-accent-ink)}
:root[data-client-variant] .toast{background:var(--ref-menu);color:var(--ref-menu-text)}
:root[data-client-variant] .ref-form input:disabled,:root[data-client-variant] .ref-form textarea:disabled{opacity:.6}
:root[data-client-variant][data-compact=true] .conversation-item{height:64px;min-height:64px}
:root[data-client-variant][data-compact=true] .conversation-item .avatar{width:42px;height:42px}
:root[data-client-variant] .ref-power-saving *{animation:none!important;transition:none!important}
html[data-appearance-pending] .workspace{visibility:hidden}
html[data-appearance-pending]:not(:has(#authDialog[open])) body:after{content:'正在恢复显示设置…';position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#18222d;color:#e7edf3;font:15px system-ui,sans-serif;z-index:9000;pointer-events:none}
:root[data-client-variant] .ref-call,:root[data-client-variant] .ref-call .ref-sheet-head{background:#202c38;color:#f1f5f8}
:root[data-client-variant] .ref-call .ref-icon{color:#f1f5f8}

:root[data-client-variant] .day-separator{background:transparent;color:var(--ref-secondary)}
:root[data-client-variant=telegram] .day-separator{background:#536e60;color:#fff}
:root[data-client-variant=telegram][data-theme=dark] .day-separator{background:#2a4056;color:#e9f2fc}
:root[data-client-variant] .message-avatar{background:var(--ref-avatar);color:var(--ref-avatar-text)}

:root[data-client-variant].ref-power-saving *, :root[data-client-variant].ref-power-saving *::before, :root[data-client-variant].ref-power-saving *::after{animation:none!important;transition:none!important;backdrop-filter:none!important;scroll-behavior:auto!important}
:root[data-client-variant] #connectionStatus{display:flex;align-items:center;justify-content:center;min-height:28px;padding:5px 12px;font-size:12px;line-height:18px;color:var(--ref-secondary);background:var(--ref-field)}
:root[data-client-variant] #connectionStatus.connected{display:none!important}
:root[data-client-variant] #connectionStatus.offline{color:var(--ref-danger)}
:root[data-client-variant] .auth-dialog input{font-size:16px!important}
:root[data-client-variant=wechat] .auth-dialog label{font-size:15px!important}
:root[data-client-variant=telegram] .auth-dialog label{font-size:13px!important}

/* Disabled controls keep readable text and remain visibly unavailable in both client themes. */
:root[data-client-variant] :is(button.ref-row,button.ref-icon,button.icon-button,button.ref-primary,button.primary-button,button.send-button):disabled,
:root[data-client-variant][data-platform=desktop] .ref-icon:disabled,
:root[data-client-variant] .composer .send-button:disabled{opacity:1;color:var(--ref-secondary);cursor:not-allowed}
:root[data-client-variant] :is(button.ref-primary,button.primary-button,button.ref-danger,button.send-button):disabled,
:root[data-client-variant] .composer .send-button:disabled,
:root[data-client-variant] #referenceVoice:disabled{background:var(--ref-field);color:var(--ref-secondary);opacity:1}
:root[data-client-variant] .ref-form :is(input,textarea,select):disabled{opacity:1;background:var(--ref-field);color:var(--ref-secondary)}

:root[data-client-variant] .ref-pagination button:disabled,:root[data-client-variant] .settings-retry:disabled{opacity:1;color:var(--ref-secondary);background:var(--ref-field);cursor:not-allowed}

/* Own WeChat rich content inherits its green bubble; packet cards retain theirs. */
:root[data-client-variant=wechat] .own .ref-rich-message{background:transparent;color:var(--ref-outgoing-text)}
:root[data-client-variant=wechat] .own .message-quote{border-left-color:var(--ref-outgoing-text);background:rgba(0,0,0,.055);color:var(--ref-outgoing-text)}
:root[data-client-variant=wechat] .own .message-quote strong,:root[data-client-variant=wechat] .own .message-quote span,:root[data-client-variant=wechat] .own .ref-rich-message svg{color:var(--ref-outgoing-text)}
