/* mtyim-light2 (layout/hit-target fix on top of light1): familiar chat light layout + readable type, owl teal accent.
   Loaded after mtyim-dark.css so structural patches remain; this file overrides
   navy/teal-on-navy colors and adds global information architecture.
   Does not copy WeChat marks. Does not change chat protocol, auth, or APIs. */

:root {
  --mtyim-bg: #EDEDED;
  --mtyim-bg-chat: #EDEDED;
  --mtyim-surface: #FFFFFF;
  --mtyim-surface-alt: #F7F7F7;
  --mtyim-text: #1A1A1A;
  --mtyim-text-secondary: #888888;
  --mtyim-text-tertiary: #B0B0B0;
  --mtyim-line: #E5E5E5;
  --mtyim-accent: #00BFA6;
  --mtyim-accent-hover: #00A894;
  --mtyim-accent-soft: #D4F4EF;
  --mtyim-bubble-self: #CFF3EE;
  --mtyim-bubble-peer: #FFFFFF;
  --mtyim-danger: #FA5151;
  --mtyim-overlay: rgba(0, 0, 0, 0.45);
  --wk-color-theme: #00BFA6;
  --wk-color-secondary: #F7F7F7;
  --wk-color-secondary-2: #FFFFFF;
  --wk-color-item: #FFFFFF;
  --wk-text-item: #1A1A1A;
  --wk-message-item: #FFFFFF;
  --wk-message-color: #1A1A1A;
  --wk-color-font-tip: #888888;
  --wk-color-hover: #F0F0F0;
  --wk-line: 1px solid #E5E5E5;
  --wk-line-color: #E5E5E5;
  --semi-color-primary: #00BFA6;
  --semi-color-primary-hover: #00A894;
  --semi-color-text-0: #1A1A1A;
  --semi-color-text-1: #1A1A1A;
  --semi-color-text-2: #888888;
  --semi-color-text-3: #B0B0B0;
  --semi-color-bg-0: #EDEDED;
  --semi-color-bg-1: #FFFFFF;
  --semi-color-bg-2: #F7F7F7;
  --semi-color-bg-3: #F0F0F0;
  --semi-color-bg-4: #E5E5E5;
  --semi-color-fill-0: #F7F7F7;
  --semi-color-fill-1: #F0F0F0;
  --semi-color-fill-2: #E5E5E5;
  --semi-color-border: #E5E5E5;
  --semi-color-danger: #FA5151;
  --semi-color-warning: #FA9D3B;
  --semi-color-success: #00BFA6;
  --semi-color-white: #FFFFFF;
  --semi-color-black: #1A1A1A;
  --semi-color-disabled-text: #B0B0B0;
  --semi-color-disabled-bg: #F0F0F0;
  --semi-color-disabled-border: #E5E5E5;
  --semi-color-link: #00A894;
  --mtyim-navy: #EDEDED;
  --mtyim-blue: #00BFA6;
  --mtyim-teal: #00BFA6;
  --mtyim-text-muted: #888888;
  --mtyim-panel: #FFFFFF;
  --mtyim-panel-strong: #F7F7F7;
}

html, body, #root {
  background-color: #EDEDED !important;
  color: #1A1A1A !important;
  min-height: 100%;
}

::selection {
  background: rgba(0, 191, 166, 0.28);
  color: #1A1A1A;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: #EDEDED;
}
*::-webkit-scrollbar-thumb {
  background: #C8C8C8;
  border-radius: 8px;
}

/* -------- Login -------- */
.wk-login {
  background-color: #EDEDED !important;
  color: #1A1A1A !important;
  min-height: 100%;
  padding: 16px 16px 50px;
  box-sizing: border-box;
}
.wk-login-content-slogan {
  color: #1A1A1A !important;
}
.wk-login-content-form input,
.wk-login-content-form-buttons input,
.wk-login input[type="text"],
.wk-login input[type="password"],
.wk-login input[type="tel"] {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  border: 1px solid #E5E5E5 !important;
  caret-color: #1A1A1A;
}
.wk-login-content-form input::placeholder,
.wk-login input::placeholder {
  color: #B0B0B0 !important;
  opacity: 1;
}
.wk-login-content-form input:focus,
.wk-login input:focus {
  outline: 2px solid #00BFA6 !important;
  border-color: #00BFA6 !important;
}
.wk-login-content-form input:-webkit-autofill,
.wk-login input:-webkit-autofill {
  -webkit-text-fill-color: #1A1A1A;
  caret-color: #1A1A1A;
  box-shadow: 0 0 0 1000px #FFFFFF inset;
}
.wk-login-content-form-ok,
.wk-login button,
.wk-login .wk-login-content-form-ok {
  background-color: #00BFA6 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 8px !important;
}
.wk-login-content-form-scanlogin,
.wk-login-footer,
.wk-login-footer ul li,
.wk-login-content-scanlogin-qrcode-title,
.wk-login-content-scanlogin-qrcode-desc li {
  color: #888888 !important;
}
.wk-login-content-logo img {
  filter: none !important;
  object-fit: contain !important;
}

/* -------- App shell: light surfaces, clear type -------- */
.wk-layout,
.wk-layout-tab,
.wk-layout-content,
.wk-layout-content-left,
.wk-conversation,
.wk-conversation-content,
.wk-conversationlist,
.wk-navheader,
.wk-conversation-topview,
.wk-chat,
.wk-contacts,
.wk-main {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  box-sizing: border-box;
}
.wk-layout {
  overflow: hidden;
}
.wk-layout-content-left,
.wk-chat-content-left {
  min-width: 0;
  background-color: #FFFFFF !important;
  border-right: 1px solid #E5E5E5 !important;
}
.wk-layout-content-right,
.wk-chat-content-right,
.wk-conversation-content,
.wk-conversation {
  background-color: #EDEDED !important;
}
.wk-navheader,
.wk-conversation-topview,
.wk-chat-search {
  background-color: #EDEDED !important;
  box-shadow: none !important;
  color: #1A1A1A !important;
  border-bottom: 1px solid #E5E5E5;
  min-width: 0;
}
.wk-navheader-content-left-title,
.wk-navheader-content,
.wk-conversationlist-item-name,
.wk-conversationlist-item-name h3,
.wk-conversationlist-item-right,
.wk-conversationlist-item-right-first-line {
  color: #1A1A1A !important;
  min-width: 0;
}
.wk-conversationlist-item-name,
.wk-conversationlist-item-name h3,
.wk-navheader-content-left-title,
.wk-conversation-header h3,
.wk-chat-conversation-header-channel-info-name,
.wk-chat-title,
.wk-viewqueueheader-content-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: #1A1A1A !important;
  font-weight: 600;
}
.wk-conversationlist-item-lastmsg,
.wk-conversationlist-item-time,
.wk-conversationlist-item-right-second-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #888888 !important;
  min-width: 0;
}
.wk-conversationlist {
  background-color: #FFFFFF !important;
}
.wk-conversationlist-item,
.wk-conversationlist-item-content {
  background-color: #FFFFFF !important;
  box-sizing: border-box;
  min-width: 0;
}
.wk-conversationlist-item {
  height: 68px;
  border-bottom: 1px solid #E5E5E5;
}
.wk-conversationlist-item:hover,
.wk-conversationlist-item-content:hover {
  background-color: #F7F7F7 !important;
}
.wk-conversationlist-item-selected,
.wk-conversationlist-item-content.wk-conversationlist-item-selected,
body[theme-mode=dark] .wk-conversationlist-item-selected {
  background-color: #EDEDED !important;
}
.wk-conversationlist-item-left,
.wk-conversationlist-item-avatar-box {
  flex-shrink: 0;
}
.wk-conversationlist-item-right {
  flex: 1 1 auto;
  min-width: 0;
}
.wk-conversationlist-item-avatar-box img,
.wk-conversationlist-item-left img,
.senderAvatar img {
  object-fit: cover;
  flex-shrink: 0;
  filter: none;
}

/* + entry: visible, existing click target only */
.wk-chat-search-add {
  color: #1A1A1A !important;
  font-size: 22px;
  line-height: 1;
  padding: 8px 10px !important;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.wk-chat-search-add:hover {
  color: #00A894 !important;
}

/* -------- Desktop sider: slim left rail + list + conversation -------- */
.wk-layout-tab,
.wk-main-sider {
  background-color: #F7F7F7 !important;
  border-right: 1px solid #E5E5E5;
  flex-shrink: 0;
  box-sizing: border-box;
}
.wk-main-sider-content {
  box-sizing: border-box;
}
.wk-main-sider-item,
.wk-main-sider-avatar,
.wk-main-sider-setting-box {
  color: #1A1A1A;
}
.wk-main-sider-setting .wk-icon-bar,
.wk-icon-bar {
  background-color: #1A1A1A !important;
}
.wk-main-sider-setting.collapsed .wk-icon-bar:nth-child(2) {
  background-color: transparent !important;
}
.wk-sider-setting-list {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid #E5E5E5;
  z-index: 40;
}
/* light2: closed scale(0) menu must not intercept clicks on the list */
.wk-sider-setting-list:not(.open) {
  pointer-events: none;
}
.wk-sider-setting-list.open {
  pointer-events: auto;
}
.wk-sider-setting-list li {
  color: #1A1A1A !important;
}
.wk-sider-setting-list li:hover {
  background-color: #F7F7F7 !important;
}

@media (min-width: 641px) {
  /* light2: official --sider-width is 60px and item boxes are 32x32 / avatar 50x50.
     light1 only widened .wk-layout-tab to 72px and appended labels inside those
     tiny boxes, so 会话/通讯录/我的/更多 were clipped and the visible label could
     sit outside the hit target. Keep label+icon inside one full-width click box. */
  :root,
  html,
  body,
  .wk-layout,
  .wk-layout-tab,
  .wk-main-sider {
    --sider-width: 80px;
    --wk-width-layout-tab: 80px;
  }
  .wk-layout-tab,
  .wk-main-sider {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    box-sizing: border-box !important;
    overflow: visible;
  }
  .wk-main-sider-content {
    width: 100%;
    overflow: visible;
  }
  .wk-main-sider-item,
  .wk-main-sider-avatar,
  .wk-main-sider-setting-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 80px !important;
    max-width: 80px !important;
    height: auto !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding: 6px 4px 4px !important;
  }
  .wk-main-sider-avatar {
    margin-top: 8px !important;
    min-height: 72px !important;
  }
  .wk-main-sider-avatar img {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
  }
  .wk-main-sider-item {
    margin-top: 8px !important;
    min-height: 64px !important;
  }
  .wk-main-sider-item img {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
  }
  .wk-main-sider-item::after,
  .wk-main-sider-avatar::after,
  .wk-main-sider-setting-box::after {
    font-size: 12px;
    line-height: 16px;
    color: #1A1A1A;
    margin-top: 4px;
    max-width: 72px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    text-align: center;
  }
  .wk-main-sider-item::after {
    content: attr(title);
  }
  .wk-main-sider-avatar::after {
    content: "我的";
  }
  .wk-main-sider-setting-box {
    position: absolute !important;
    bottom: 8px !important;
    left: 0 !important;
    right: 0 !important;
    min-height: 56px !important;
  }
  .wk-main-sider-setting-box::after {
    content: "更多";
  }
  .wk-chat-content-left,
  .wk-layout-content-left {
    width: var(--wk-width-layout-content-left, 300px);
    max-width: 40vw;
    min-width: 0;
  }
}

/* -------- Narrow: main channels as a bottom bar; chat covers it when open -------- */
@media (max-width: 640px) {
  .wk-layout {
    flex-direction: column-reverse !important;
    overflow: hidden !important;
  }
  .wk-layout-tab {
    width: 100% !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    flex-shrink: 0 !important;
    border-right: none !important;
    border-top: 1px solid #E5E5E5 !important;
    background-color: #F7F7F7 !important;
    z-index: 30;
  }
  .wk-main-sider,
  .wk-main-sider-content {
    width: 100% !important;
    height: 100% !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: stretch !important;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }
  .wk-main-sider-content > .wk-main-sider-item {
    order: 1;
  }
  .wk-main-sider-content > .wk-main-sider-avatar {
    order: 3;
  }
  .wk-main-sider-content > .wk-main-sider-setting-box {
    order: 4;
  }
  .wk-main-sider-avatar,
  .wk-main-sider-item,
  .wk-main-sider-setting-box {
    position: static !important;
    margin: 0 !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    flex: 1 1 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 2px 4px;
    box-sizing: border-box;
  }
  .wk-main-sider-avatar img,
  .wk-main-sider-item img {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
  }
  .wk-main-sider-item::after,
  .wk-main-sider-avatar::after,
  .wk-main-sider-setting-box::after {
    font-size: 12px;
    line-height: 16px;
    color: #1A1A1A;
    margin-top: 2px;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    text-align: center;
  }
  .wk-main-sider-item::after {
    content: attr(title);
  }
  .wk-main-sider-avatar::after {
    content: "我的";
  }
  .wk-main-sider-setting-box::after {
    content: "更多";
  }
  .wk-sider-setting-list {
    left: auto !important;
    right: 8px !important;
    bottom: calc(100% + 8px) !important;
    transform-origin: bottom right !important;
    z-index: 40 !important;
    width: min(160px, calc(100vw - 16px)) !important;
  }
  .wk-layout-content,
  .wk-layout-content-left,
  .wk-chat-content-left,
  .wk-conversationlist,
  .wk-contacts {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .wk-chat-content-right {
    /* official: fixed inset covers the bottom bar while a conversation is open */
    z-index: 35;
  }
  .wk-conversation-footer,
  .wk-conversation-footer-content,
  .wk-messageinput-box {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }
}

/* -------- Conversation: header / messages / input layers -------- */
.wk-chat-conversation-header,
.wk-chat-conversation-header-content,
.wk-chat-conversation-header-left,
.wk-chat-conversation-header-channel,
.wk-chat-conversation-header-right,
.wk-chat-conversation-header-setting,
.wk-viewqueueheader,
.wk-viewqueueheader-content {
  background: #EDEDED !important;
  background-color: #EDEDED !important;
  color: #1A1A1A !important;
  box-shadow: none !important;
  border-bottom: 1px solid #E5E5E5;
  min-width: 0;
}
.wk-chat-conversation-header-channel-info,
.wk-chat-conversation-header-right-item {
  color: #1A1A1A !important;
  min-width: 0;
}
.wk-chat-conversation-header-channel-info-tip {
  color: #888888 !important;
}
.wk-chat-conversation-header-back-icon,
.wk-chat-conversation-header-back-icon::before,
.wk-chat-conversation-header-back-icon::after {
  background-color: #1A1A1A !important;
}

/* Messages */
.wk-message-base-bubble {
  box-shadow: none !important;
  color: #1A1A1A !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}
.wk-message-text,
.wk-message-text pre {
  color: #1A1A1A !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}
.wk-message-text a,
.wk-message-text-richmention {
  color: #00A894 !important;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.wk-message-base-bubble-box.send .wk-message-base-bubble,
.send .wk-message-base-bubble {
  background-color: #CFF3EE !important;
  color: #1A1A1A !important;
  border: none;
}
.wk-message-base-bubble-box.recv .wk-message-base-bubble {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  border: 1px solid #E5E5E5;
}
.wk-message-video video,
.wk-message-video img,
.wk-message-base-content img,
.wk-imagedialog-content-preview img,
.wk-imagedialog-content-preview video,
.wk-login-content-logo img {
  filter: none !important;
  object-fit: contain;
}
.wk-message-time,
.wk-message-split-content {
  color: #888888 !important;
}

/* Input / toolbars */
.wk-conversation-footer,
.wk-conversation-footer-content,
.wk-messageinput-box,
.wk-messageinput-box-top,
.wk-messageinput-bar,
.wk-messageinput-inputbox,
.wk-messageinput-toolbar,
.wk-messageinput-actionbox,
.wk-messageinput-header,
.wk-emojitoolbar,
.wk-imagetoolbar,
.wk-voicetoolbar,
.wk-videotoolbar {
  background: #F7F7F7 !important;
  background-color: #F7F7F7 !important;
  color: #1A1A1A !important;
  box-shadow: none !important;
  box-sizing: border-box;
}
.wk-messageinput-input,
.wk-messageinput-input textarea,
.wk-messageinput-input input,
.wk-messageinput-input .mentions__control,
.wk-messageinput-input .mentions__input,
.wk-messageinput-input .mentions__highlighter,
.wk-conversation-footer textarea,
.wk-conversation-footer input {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  caret-color: #1A1A1A;
}
.wk-messageinput-input::placeholder,
.wk-messageinput-input textarea::placeholder {
  color: #B0B0B0 !important;
}
.wk-voicetoolbar,
.wk-videotoolbar,
.wk-voicetoolbar-content-icon,
.wk-videotoolbar-content-icon {
  color: #1A1A1A !important;
}
.wk-voicetoolbar svg,
.wk-videotoolbar svg,
.wk-voicetoolbar path,
.wk-videotoolbar path {
  fill: #1A1A1A !important;
  color: #1A1A1A !important;
}
.wk-emojitoolbar-content::after,
.wk-imagetoolbar-content-icon::after,
.wk-iconclick:has(> img[src*="func_mention_normal"])::after,
.wk-iconclick:has(> img[src*="func_screenshot"])::after {
  background-color: #1A1A1A !important;
}
.wk-voicetoolbar-content.is-recording {
  background: rgba(0, 191, 166, 0.18);
}
.wk-media-record-tip {
  background: rgba(26, 26, 26, 0.88);
  color: #FFFFFF;
  border: none;
}
.wk-media-record-tip.is-cancel {
  background: rgba(250, 81, 81, 0.92);
  color: #FFFFFF;
}
.wk-messageinput-sendbtn,
button.wk-messageinput-sendbtn {
  background: #00BFA6 !important;
  background-color: #00BFA6 !important;
  color: #FFFFFF !important;
  border: none !important;
}
.wk-conversationlist-item-reddot [class*="badge"],
.wk-main-sider-item-badge [class*="badge"] {
  background-color: #FA5151 !important;
  color: #FFFFFF !important;
}

/* Plus menu popover */
.wk-chatmenuspopover,
.wk-chatmenuspopover ul,
.wk-chatmenuspopover li,
.wk-chatmenuspopover-title {
  color: #1A1A1A !important;
}
.wk-chatmenuspopover li:hover {
  background-color: #F7F7F7;
}
.mtyim-placeholder-plus-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 10px;
}
.mtyim-wallet-entry {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 14px 16px !important;
  background: #FFFFFF !important;
  color: #1A1A1A !important;
  cursor: pointer;
  border-top: 1px solid #E5E5E5;
}
.mtyim-wallet-entry .wk-list-item-title {
  color: #1A1A1A !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mtyim-placeholder-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  margin-right: 10px;
}
.mtyim-wallet-entry .mtyim-placeholder-icon {
  margin-right: 0;
  margin-left: 8px;
}
.mtyim-icon-transfer {
  border-radius: 4px;
  background:
    linear-gradient(#00BFA6, #00BFA6) 3px 8px / 14px 2px no-repeat,
    linear-gradient(#00BFA6, #00BFA6) 13px 5px / 2px 8px no-repeat,
    linear-gradient(#00BFA6, #00BFA6) 3px 14px / 14px 2px no-repeat;
  border: 1px solid #00BFA6;
  box-sizing: border-box;
}
.mtyim-icon-wallet {
  border: 1.5px solid #00BFA6;
  border-radius: 3px;
  box-sizing: border-box;
  background:
    linear-gradient(#00BFA6, #00BFA6) 0 6px / 100% 1.5px no-repeat;
}

/* Coming-soon stub dialog: one sentence + close only */
.mtyim-coming-soon[hidden] {
  display: none !important;
}
.mtyim-coming-soon {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.mtyim-coming-soon-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.mtyim-coming-soon-panel {
  position: relative;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 12px;
  padding: 24px 20px 16px;
  width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.mtyim-coming-soon-text {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.5;
  color: #1A1A1A;
  overflow-wrap: anywhere;
}
.mtyim-coming-soon-close {
  min-height: 40px;
  min-width: 96px;
  padding: 8px 16px;
  background: #00BFA6;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

/* Dialogs / menus / inputs */
.wk-imagedialog-mask {
  background: rgba(0, 0, 0, 0.45);
}
.wk-imagedialog-content,
.semi-modal-content,
.semi-dropdown-content {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  box-sizing: border-box;
  max-width: min(92vw, 520px);
}
.wk-imagedialog-content-title,
.wk-imagedialog-content-body,
.wk-imagedialog-content-footer,
.wk-imagedialog-content-close {
  color: #1A1A1A !important;
}
.wk-imagedialog-content-footer button,
.wk-imagedialog-content button,
.semi-button-primary,
.semi-button-primary:hover {
  background-color: #00BFA6 !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: none !important;
}
.semi-input,
.semi-input-wrapper,
.semi-input-wrapper-focus {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  border-color: #E5E5E5 !important;
}

/* Contacts */
.wk-contacts,
.wk-contacts-content,
.wk-contacts-section-list,
.wk-contacts-content-header {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  min-width: 0;
}

/* -------- 我的 / personal center: light card, no horizontal overflow -------- */
.wk-main-sider-meinfo .semi-modal-content,
.wk-main-sider-meinfo .semi-modal-body,
.wk-main-sider-meinfo .semi-modal-body-wrapper,
.wk-main-sider-meinfo .wk-route,
.wk-main-sider-meinfo .wk-route-header,
.wk-main-sider-meinfo .wk-route-content,
.wk-main-sider-meinfo .wk-route-content-next,
.wk-meinfo,
.wk-meinfo-sections {
  background: #EDEDED !important;
  background-color: #EDEDED !important;
  color: #1A1A1A !important;
  box-shadow: none !important;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
.wk-main-sider-meinfo {
  margin: 12px auto !important;
  max-width: min(400px, calc(100vw - 24px));
  width: auto !important;
  box-sizing: border-box;
}
.wk-main-sider-meinfo .semi-modal-content {
  height: auto !important;
  border: 1px solid #E5E5E5 !important;
  border-radius: 12px !important;
  overflow: hidden;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.wk-main-sider-meinfo .semi-modal-body {
  height: min(500px, calc(100dvh - 26px)) !important;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.wk-main-sider-meinfo .wk-meinfo {
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  box-sizing: border-box;
  max-width: 100%;
}
.wk-main-sider-meinfo .wk-route-header {
  border-bottom: 1px solid #E5E5E5 !important;
  flex-shrink: 0;
  background: #FFFFFF !important;
}
.wk-main-sider-meinfo .wk-route-header-title,
.wk-main-sider-meinfo .wk-route-header-title-next,
.wk-main-sider-meinfo .wk-route-header-title-box {
  color: #1A1A1A !important;
}
.wk-main-sider-meinfo .wk-route-header-close-icon,
.wk-main-sider-meinfo .wk-route-header-close-icon::before,
.wk-main-sider-meinfo .wk-route-header-close-icon::after {
  background-color: #1A1A1A !important;
}
.wk-main-sider-meinfo .wk-route-header-close:hover {
  background-color: #F0F0F0 !important;
}
.wk-meinfo .wk-list-item,
.wk-meinfo .wk-section,
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(1) .wk-list-item,
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(2) .wk-list-item {
  background: #FFFFFF !important;
  color: #1A1A1A !important;
  box-shadow: none !important;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.wk-meinfo .wk-list-item-title,
.wk-meinfo .wk-list-item-subtitle {
  color: #1A1A1A !important;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(1) img {
  background: #F7F7F7;
  filter: none !important;
}
.wk-sex-select,
.wk-sex-select-item,
.wk-sex-select-item .sex {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
}

@media (max-width: 640px) {
  .wk-main-sider-meinfo {
    margin: 0 !important;
    max-width: 100vw !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
  }
  .wk-main-sider-meinfo .semi-modal-content {
    max-width: 100vw !important;
    width: 100% !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-sizing: border-box !important;
  }
  .wk-main-sider-meinfo .semi-modal-body {
    height: 100dvh !important;
    max-height: 100dvh !important;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .wk-meinfo .wk-section,
  .wk-meinfo .wk-list-item,
  .wk-meinfo .wk-sections,
  .wk-meinfo-sections {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* Friend apply / version / location: keep structure, light colors */
.wk-friendapply {
  background: #FFFFFF !important;
  color: #1A1A1A !important;
}
.wk-friendapply .mtyim-friendapply-actions {
  background: #F7F7F7;
  border-top: 1px solid #E5E5E5;
}
.wk-friendapply .mtyim-friendapply-actions button,
.mtyim-version-panel button {
  color: #FFFFFF;
  background: #00BFA6;
  border: none;
}
.mtyim-friendapply-status {
  color: #1A1A1A;
}
.mtyim-version-overlay {
  background: rgba(0, 0, 0, 0.45);
}
.mtyim-version-panel {
  background: #FFFFFF;
  color: #1A1A1A;
  border: 1px solid #E5E5E5;
  max-width: 100%;
  box-sizing: border-box;
}
.mtyim-version-panel h2 {
  color: #1A1A1A;
}
.wk-message-location .wk-message-location-content {
  background: #FFFFFF !important;
  border: 1px solid #E5E5E5;
  color: #1A1A1A;
  overflow-wrap: anywhere;
}
.wk-message-location .wk-message-location-content-title,
.wk-message-location .wk-message-location-content-address,
.mtyim-location-localnote {
  color: #1A1A1A;
}

/* Optional official dark mode: readable dark gray, not navy-on-teal */
body[theme-mode="dark"],
body[theme-mode=dark] {
  --wk-color-secondary: #1C1C1C;
  --wk-color-secondary-2: #111111;
  --wk-color-item: #1C1C1C;
  --wk-text-item: #F2F2F2;
  --wk-message-item: #2A2A2A;
  --wk-message-color: #F2F2F2;
  --wk-line: 1px solid #333333;
  --wk-line-color: #333333;
  --wk-color-theme: #00BFA6;
  --semi-color-primary: #00BFA6;
  --semi-color-text-0: #F2F2F2;
  --semi-color-bg-0: #111111;
  --semi-color-bg-1: #1C1C1C;
  color: #F2F2F2 !important;
  background-color: #111111 !important;
}
body[theme-mode="dark"] .wk-layout,
body[theme-mode=dark] .wk-layout-tab,
body[theme-mode=dark] .wk-layout-content,
body[theme-mode=dark] .wk-conversationlist,
body[theme-mode=dark] .wk-conversationlist-item,
body[theme-mode=dark] .wk-navheader,
body[theme-mode=dark] .wk-chat-search,
body[theme-mode=dark] .wk-chat-conversation-header,
body[theme-mode=dark] .wk-messageinput-box,
body[theme-mode=dark] .wk-conversation-footer,
body[theme-mode=dark] .wk-meinfo,
body[theme-mode=dark] .wk-login,
body[theme-mode=dark] .semi-modal-content {
  background-color: #1C1C1C !important;
  color: #F2F2F2 !important;
}
body[theme-mode="dark"] .wk-conversation,
body[theme-mode=dark] .wk-conversation-content,
body[theme-mode=dark] .wk-layout-content-right,
body[theme-mode=dark] html,
body[theme-mode=dark] body,
body[theme-mode=dark] #root {
  background-color: #111111 !important;
  color: #F2F2F2 !important;
}
body[theme-mode="dark"] .wk-message-base-bubble-box.send .wk-message-base-bubble,
body[theme-mode=dark] .send .wk-message-base-bubble {
  background-color: #0A6E62 !important;
  color: #F2F2F2 !important;
}
body[theme-mode="dark"] .wk-message-base-bubble-box.recv .wk-message-base-bubble,
body[theme-mode=dark] .wk-conversationlist-item-name,
body[theme-mode=dark] .wk-conversationlist-item-name h3,
body[theme-mode=dark] .wk-chat-conversation-header-channel-info-name,
body[theme-mode=dark] .wk-login-content-slogan,
body[theme-mode=dark] .wk-message-text {
  color: #F2F2F2 !important;
}
body[theme-mode="dark"] .wk-message-base-bubble-box.recv .wk-message-base-bubble {
  background-color: #2A2A2A !important;
  border-color: #333333;
}
body[theme-mode="dark"] .mtyim-coming-soon-panel {
  background: #1C1C1C;
  color: #F2F2F2;
}
body[theme-mode="dark"] .mtyim-coming-soon-text {
  color: #F2F2F2;
}


/* ===== light3: complete chat/input light overrides that dark.css still won
   (higher-specificity navy/teal !important), real sider labels, 390 bottom bar. ===== */

/* Input field leftovers from dark.css (exact selectors it used) */
.wk-messageinput-input__control,
.wk-messageinput-input__input,
.wk-conversation-footer [contenteditable],
.wk-messageinput-toolbar textarea,
.wk-messageinput-toolbar input,
.wk-messageinput-input textarea,
.wk-messageinput-input input {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  caret-color: #1A1A1A !important;
  border: 1px solid #E5E5E5 !important;
  box-shadow: none !important;
}
.wk-messageinput-input::placeholder,
.wk-messageinput-input textarea::placeholder,
.wk-messageinput-input input::placeholder,
.wk-conversation-footer [contenteditable]:empty {
  color: #B0B0B0 !important;
}
.mentions__suggestions__list,
.wk-messageinput-input__suggestions {
  background-color: #FFFFFF !important;
  color: #1A1A1A !important;
  border: 1px solid #E5E5E5 !important;
}
.mentions__suggestions__item--focused,
.mentions__suggestions .mentions__suggestions__item--focused {
  background-color: #F0F0F0 !important;
  color: #1A1A1A !important;
}
.wk-conversation-chattoolbars-item {
  color: #1A1A1A !important;
}
.wk-chat-content-chat,
.wk-chat-content-right,
.wk-chat-content-right .wk-conversation {
  background-color: #EDEDED !important;
  color: #1A1A1A !important;
}

/* MeInfo rows: dark.css used more specific selectors than light2 generic ones */
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(2) .wk-list-item-subtitle,
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(3) .wk-list-item-subtitle,
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(n+4) .wk-list-item,
.wk-meinfo .wk-section:not(:first-child) .wk-list-item,
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(3) .wk-list-item {
  background: #FFFFFF !important;
  color: #1A1A1A !important;
  box-shadow: none !important;
}
.wk-meinfo .wk-section:first-child .wk-section-row:nth-child(n+4) .wk-list-item,
.wk-meinfo .wk-section:not(:first-child) .wk-list-item {
  border-bottom: 1px solid #E5E5E5 !important;
}

/* Real text labels (script-injected) sit inside the same clickable li; hide ::after to avoid double text */
.mtyim-sider-label {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: #1A1A1A;
  margin-top: 4px;
  max-width: 72px;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
}
.wk-main-sider-avatar:has(> .mtyim-sider-label)::after,
.wk-main-sider-item:has(> .mtyim-sider-label)::after,
.wk-main-sider-setting-box:has(> .mtyim-sider-label)::after {
  content: none !important;
  display: none !important;
}

/* Search entry annotated by script: keep a clear, large hit target */
.wk-chat-search .mtyim-search-entry,
.mtyim-search-entry {
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  color: #1A1A1A !important;
}
.mtyim-search-entry .semi-icon,
.mtyim-search-entry .semi-icon-search,
.wk-chat-search .semi-icon-search {
  color: #1A1A1A !important;
  font-size: 22px;
}

/* 390px / narrow bottom channel bar: four real items must stay complete */
@media (max-width: 640px) {
  .wk-layout-tab {
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: visible !important;
  }
  .wk-main-sider-avatar,
  .wk-main-sider-item,
  .wk-main-sider-setting-box {
    min-height: 56px !important;
    overflow: visible !important;
  }
  .wk-main-sider-item::after,
  .wk-main-sider-avatar::after,
  .wk-main-sider-setting-box::after,
  .mtyim-sider-label {
    font-size: 12px !important;
    line-height: 16px !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    color: #1A1A1A !important;
  }
}
@media (max-width: 390px) {
  .wk-layout-tab {
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mtyim-sider-label,
  .wk-main-sider-item::after,
  .wk-main-sider-avatar::after,
  .wk-main-sider-setting-box::after {
    font-size: 11px !important;
    letter-spacing: 0;
    max-width: 100% !important;
    overflow: visible !important;
  }
}


/* ===== light4: t27u — WeChat-like IA on ALL viewports.
   Main channels are a bottom bar (not a left admin rail). Desktop keeps
   list | chat two columns ABOVE the bar so the input is not covered.
   Does not invent channels. Colors unchanged. ===== */

html, body, #root, .wk-main, .wk-layout {
  height: 100%;
  max-height: 100%;
}

.wk-layout {
  display: flex !important;
  flex-direction: column-reverse !important;
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
}

.wk-layout-content {
  flex: 1 1 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden;
}

.wk-layout-tab,
.wk-main-sider {
  --sider-width: 100%;
  --wk-width-layout-tab: 100%;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  flex: 0 0 calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  flex-shrink: 0 !important;
  border-right: none !important;
  border-top: 1px solid #E5E5E5 !important;
  background-color: #F7F7F7 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  z-index: 30;
}

.wk-main-sider,
.wk-main-sider-content {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: stretch !important;
  padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.wk-main-sider-content > .wk-main-sider-item { order: 1; }
.wk-main-sider-content > .wk-main-sider-avatar { order: 3; }
.wk-main-sider-content > .wk-main-sider-setting-box { order: 4; }

.wk-main-sider-avatar,
.wk-main-sider-item,
.wk-main-sider-setting-box {
  position: static !important;
  margin: 0 !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 56px !important;
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 4px 4px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.wk-main-sider-avatar img,
.wk-main-sider-item img {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0;
}

.wk-sider-setting-list {
  left: auto !important;
  right: 8px !important;
  bottom: calc(100% + 8px) !important;
  transform-origin: bottom right !important;
  z-index: 40 !important;
  width: min(200px, calc(100vw - 16px)) !important;
}

/* Content above the bar: lists and chat must scroll inside, not under the bar */
.wk-chat,
.wk-chat-content,
.wk-contacts,
.wk-layout-content-left,
.wk-layout-content-right {
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}
.wk-chat-content {
  display: flex;
  width: 100%;
  overflow: hidden;
}
.wk-conversationlist,
.wk-contacts-content,
.wk-chat-conversation-list,
.wk-conversation-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.wk-main-sider-meinfo,
.wk-main-sider-modal {
  z-index: 50;
}

/* Desktop: two-column chat above the same bottom bar; do not use a left rail */
@media (min-width: 641px) {
  :root,
  html,
  body,
  .wk-layout,
  .wk-layout-tab,
  .wk-main-sider {
    --sider-width: 100%;
    --wk-width-layout-tab: 100%;
  }
  .wk-layout-tab,
  .wk-main-sider {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .wk-main-sider-avatar,
  .wk-main-sider-item,
  .wk-main-sider-setting-box {
    width: auto !important;
    max-width: none !important;
    position: static !important;
    margin-top: 0 !important;
  }
  .wk-chat-content-left,
  .wk-layout-content-left {
    width: min(360px, 40vw) !important;
    max-width: 40vw !important;
    min-width: 0 !important;
    height: 100% !important;
    flex-shrink: 0;
  }
  .wk-chat-content-right,
  .wk-layout-content-right {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 100% !important;
    z-index: 1;
  }
  /* Input stays at the bottom of the chat column, already above the tab bar */
  .wk-conversation-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

@media (max-width: 640px) {
  .wk-chat-content-right {
    z-index: 35;
  }
}


/* ===== light5: t25/t27 定点 —— 390 底栏「更多」菜单在视口外。
   Official DOM (main.771b153a.js, do not change):
     div.wk-main-sider
       ul.wk-main-sider-content
         li.wk-main-sider-setting-box    // click toggles settingSelected
       ul.wk-sider-setting-list[.open]   // SIBLING of content, not a child of the box
   Official CSS: position:absolute; left: var(--sider-width); bottom: 0;
   transform-origin: left bottom; designed for a left rail, so the containing
   block can be the viewport (neither .wk-main-sider nor .wk-layout-tab is
   positioned). light4 used bottom: calc(100% + 8px) without giving the list
   a local containing block, so 100% = 100vh and the menu sat above the screen.
   Fix: position:relative on the bottom bar (the sider), keep upward open,
   clamp left/right to the viewport. No color/nav redo. ===== */

.wk-layout-tab,
.wk-main-sider {
  position: relative !important;
  overflow: visible !important;
}

.wk-sider-setting-list,
.wk-sider-setting-list.open {
  position: absolute !important;
  top: auto !important;
  left: auto !important;
  right: 8px !important;
  bottom: calc(100% + 8px) !important;
  transform-origin: bottom right !important;
  width: min(200px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px) - 16px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  z-index: 60 !important;
}

/* Closed official scale(0) must not intercept hits; already set, reaffirm. */
.wk-sider-setting-list:not(.open) {
  pointer-events: none;
}
