:root {
  --im-font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --im-nav: 64px;
  --im-list: 300px;
  --im-header-h: 40px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: var(--im-font); }
button, input { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { display: block; }

/* ===== DingTalk (default) ===== */
html[data-skin="dingtalk"] {
  --im-blue: #1A87FF;
  --im-accent: #1A87FF;
  --im-accent-soft: #E8F3FF;
  --im-text: #1A1D24;
  --im-text-2: #4A4F5C;
  --im-text-3: #8A8F99;
  --im-bg: #fff;
  --im-chat-bg: #F5F7FB;
  --im-hover: #ECF0F7;
  --im-active: #E4EAF5;
  --im-border: #E6E8EB;
  --im-rail-bg: linear-gradient(180deg, #D5E0F8 0%, #DCE4F9 100%);
  --im-title-bg: linear-gradient(90deg, #D5E0F8 0%, #DCE4F9 100%);
  --im-list-bg: #F5F7FB;
  --im-nav: 64px;
  --im-list: 300px;
  --im-header-h: 40px;
  --im-rail-fg: #4A4F5C;
  --im-bubble: #fff;
  --im-bubble-sys: #fff;
  --radius: 8px;
}
html[data-skin="feishu"] {
  --im-blue: #3370FF;
  --im-accent: #3370FF;
  --im-accent-soft: #E8F0FF;
  --im-text: #1F2329;
  --im-text-2: #646A73;
  --im-text-3: #8F959E;
  --im-bg: #fff;
  --im-chat-bg: #F5F6F7;
  --im-hover: #F2F3F5;
  --im-active: #E8F0FF;
  --im-border: #DEE0E3;
  --im-rail-bg: #1F2329;
  --im-title-bg: #1F2329;
  --im-list-bg: #fff;
  --im-nav: 68px;
  --im-list: 320px;
  --im-header-h: 0px;
  --im-rail-fg: #C5C7CB;
  --im-bubble: #fff;
  --im-bubble-sys: #fff;
  --radius: 8px;
}
html[data-skin="wecom"] {
  --im-blue: #267EF0;
  --im-accent: #267EF0;
  --im-accent-soft: #E8F2FF;
  --im-text: #1A1A1A;
  --im-text-2: #4E5969;
  --im-text-3: #86909C;
  --im-bg: #fff;
  --im-chat-bg: #F5F6F7;
  --im-hover: #F2F3F5;
  --im-active: #E8F2FF;
  --im-border: #E5E6EB;
  --im-rail-bg: #EDEDED;
  --im-title-bg: #EDEDED;
  --im-list-bg: #F7F7F7;
  --im-nav: 160px;
  --im-list: 304px;
  --im-header-h: 0px;
  --im-rail-fg: #1A1A1A;
  --im-bubble: #fff;
  --im-bubble-sys: #fff;
  --radius: 6px;
}
html[data-skin="wechat"] {
  --im-blue: #07C160;
  --im-accent: #07C160;
  --im-accent-soft: #E8F8EF;
  --im-text: #111111;
  --im-text-2: #4C4C4C;
  --im-text-3: #888888;
  --im-bg: #fff;
  --im-chat-bg: #EDEDED;
  --im-hover: #E7E7E7;
  --im-active: #C6C6C6;
  --im-border: #D9D9D9;
  --im-rail-bg: #2E2E2E;
  --im-title-bg: #2E2E2E;
  --im-list-bg: #EDEDED;
  --im-nav: 56px;
  --im-list: 280px;
  --im-header-h: 0px;
  --im-rail-fg: #B5B5B5;
  --im-bubble: #fff;
  --im-bubble-sys: #fff;
  --radius: 4px;
}
html.im-dark {
  --im-text: #E8EAED;
  --im-text-2: #B0B4BE;
  --im-text-3: #8A8F99;
  --im-bg: #14161B;
  --im-chat-bg: #0F1115;
  --im-hover: #22262E;
  --im-active: #2A3140;
  --im-border: #2A2E36;
  --im-list-bg: #14161B;
  --im-accent-soft: #1A2F4D;
  --im-bubble: #1E222A;
  --im-bubble-sys: #1E222A;
}
html.im-dark[data-skin="dingtalk"] {
  --im-rail-bg: linear-gradient(180deg, #1A2233 0%, #1E2738 100%);
  --im-title-bg: linear-gradient(90deg, #1A2233 0%, #1E2738 100%);
}
html.im-dark[data-skin="feishu"] {
  --im-rail-bg: #0D0F12;
  --im-title-bg: #0D0F12;
}
html.im-dark[data-skin="wecom"] {
  --im-rail-bg: #1B1E24;
  --im-title-bg: #1B1E24;
}
html.im-dark[data-skin="wechat"] {
  --im-rail-bg: #1A1A1A;
  --im-title-bg: #1A1A1A;
  --im-list-bg: #191919;
  --im-chat-bg: #111111;
  --im-hover: #2A2A2A;
  --im-active: #333333;
  --im-border: #2A2A2A;
  --im-accent-soft: #16351F;
}

.im-titlebar {
  position: fixed; left: 0; right: 0; top: 0;
  height: var(--im-header-h);
  background: var(--im-title-bg);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px; z-index: 50; color: var(--im-text);
}
html[data-skin="feishu"] .im-titlebar,
html[data-skin="wecom"] .im-titlebar,
html[data-skin="wechat"] .im-titlebar { display: none; }

.me-chip {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--im-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.title-search {
  margin: 0 auto; width: min(420px, 36vw); height: 26px;
  border-radius: 13px; background: #EFF1FB; color: var(--im-text-3);
  display: flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 12px;
}
html.im-dark .title-search { background: #252B38; }
.title-actions { display: flex; gap: 4px; }
.t-btn {
  width: 28px; height: 28px; border-radius: 6px; color: var(--im-text-2);
  display: flex; align-items: center; justify-content: center;
}
.t-btn:hover { background: rgba(255,255,255,.45); }
html.im-dark .t-btn:hover { background: rgba(255,255,255,.08); }

.im-rail {
  position: fixed; left: 0; top: var(--im-header-h); bottom: 0;
  width: var(--im-nav); background: var(--im-rail-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; z-index: 40; color: var(--im-rail-fg);
}
.im-rail-org {
  width: calc(100% - 12px); margin: 4px 0 10px;
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
.im-rail-logo {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--im-blue); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.im-rail-org-name { display: none; font-size: 13px; font-weight: 600; }
html[data-skin="wecom"] .im-rail { align-items: stretch; padding: 12px 8px; }
html[data-skin="wecom"] .im-rail-org { justify-content: flex-start; padding: 0 8px 12px; }
html[data-skin="wecom"] .im-rail-org-name { display: block; color: var(--im-text); }
html[data-skin="wechat"] .im-rail { padding: 14px 0 10px; }
html[data-skin="wechat"] .im-rail-logo {
  width: 36px; height: 36px; border-radius: 4px; background: #07C160; font-size: 12px;
}
html[data-skin="wechat"] .im-rail-item span { display: none; }
html[data-skin="wechat"] .im-rail-item {
  width: 40px; min-height: 44px; border-radius: 0; gap: 0;
}
html[data-skin="wechat"] .im-rail-item:hover { background: transparent; color: #fff; }
html[data-skin="wechat"] .im-rail-item.active {
  background: transparent; color: #07C160; box-shadow: none;
}
html.im-dark[data-skin="wechat"] .im-rail-item.active { color: #07C160; }
.im-rail-items { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: auto; }
html[data-skin="wecom"] .im-rail-items { align-items: stretch; }
.im-rail-item {
  width: 52px; min-height: 52px; border-radius: 10px; color: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: relative; font-size: 11px;
}
html[data-skin="wecom"] .im-rail-item {
  width: auto; min-height: 40px; flex-direction: row; justify-content: flex-start;
  gap: 10px; padding: 0 10px; border-radius: 8px; font-size: 14px;
}
.im-rail-item:hover { background: rgba(255,255,255,.45); }
html[data-skin="feishu"] .im-rail-item:hover { background: rgba(255,255,255,.08); }
html.im-dark .im-rail-item:hover { background: rgba(255,255,255,.08); }
.im-rail-item.active {
  background: #fff; color: var(--im-accent); box-shadow: 0 1px 4px rgba(26,135,255,.12);
}
html[data-skin="feishu"] .im-rail-item.active { background: #3370FF; color: #fff; box-shadow: none; }
html[data-skin="wecom"] .im-rail-item.active { background: #fff; color: var(--im-accent); }
html.im-dark[data-skin="dingtalk"] .im-rail-item.active { background: #252B38; box-shadow: none; }
.im-rail-badge {
  position: absolute; top: 2px; right: 8px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: #F54A45; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}
html[data-skin="wecom"] .im-rail-badge { right: 10px; top: 12px; }
.im-rail-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; }
html[data-skin="wecom"] .im-rail-bottom { align-items: stretch; }

.im-list-panel {
  position: fixed; top: var(--im-header-h); bottom: 0;
  left: var(--im-nav); width: var(--im-list);
  background: var(--im-list-bg); border-right: 1px solid var(--im-border);
  display: flex; flex-direction: column; z-index: 20; color: var(--im-text);
}
.im-list-header {
  height: 48px; display: flex; align-items: center; gap: 6px;
  padding: 0 10px; flex-shrink: 0;
}
.im-list-chips { display: flex; gap: 2px; background: rgba(0,0,0,.04); border-radius: 8px; padding: 2px; }
html.im-dark .im-list-chips { background: #1E222A; }
.im-chip {
  height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12px; color: var(--im-text-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.im-chip.active { background: var(--im-bg); color: var(--im-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.im-chip .n { font-size: 11px; color: var(--im-text-3); }
.im-list-actions { margin-left: auto; display: flex; gap: 2px; }
.im-icon-btn {
  width: 28px; height: 28px; border-radius: 6px; color: var(--im-text-2);
  display: flex; align-items: center; justify-content: center;
}
.im-icon-btn:hover, .im-icon-btn.is-on { background: var(--im-hover); color: var(--im-accent); }
.im-list-search {
  margin: 0 10px 8px; height: 32px; border-radius: 8px;
  background: var(--im-bg); border: 1px solid var(--im-border);
  display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--im-text-3);
}
.im-list-search input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--im-text); font-size: 13px;
}
.im-list-body { flex: 1; overflow: auto; }
.im-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  width: 100%; text-align: left; color: inherit;
}
.im-avatar-group { font-size: 12px !important; background: #3370FF !important; }
.im-picker {
  position: fixed; inset: 0; z-index: 220; background: rgba(15,17,21,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.im-picker[hidden] { display: none; }
.im-picker-card {
  width: min(420px, 100%); max-height: 80vh; overflow: auto;
  background: var(--im-bg, #fff); color: var(--im-text, #111);
  border-radius: 12px; padding: 20px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.im-picker-card h2 { margin: 0 0 6px; font-size: 16px; }
.im-picker-card p { margin: 0 0 12px; font-size: 12px; color: var(--im-text-3, #888); }
.im-picker-card input[type=text] {
  width: 100%; height: 36px; border: 1px solid var(--im-border, #dee0e3);
  border-radius: 8px; padding: 0 10px; margin-bottom: 10px; font: inherit;
}
.im-picker-list { max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.im-pick-row {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 8px; font-size: 13px; cursor: pointer;
}
.im-pick-row:hover { background: var(--im-hover, #f2f3f5); }
.im-pick-row span { margin-left: auto; color: var(--im-text-3, #888); font-size: 12px; }
.im-picker-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.im-picker-actions button {
  height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px;
}
#pickerOk { background: #3370ff; color: #fff; }
.im-row:hover { background: var(--im-hover); }
.im-row.active { background: var(--im-active); }
.im-avatar {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
html[data-skin="wecom"] .im-avatar { border-radius: 6px; }
html[data-skin="wechat"] .im-avatar,
html[data-skin="wechat"] .im-msg .av { border-radius: 4px; }
html[data-skin="wechat"] .im-list-search {
  border: 0; background: #E2E2E2; border-radius: 4px;
}
html.im-dark[data-skin="wechat"] .im-list-search { background: #2A2A2A; }
html[data-skin="wechat"] .im-list-chips { background: transparent; padding: 0; gap: 6px; }
html[data-skin="wechat"] .im-chip {
  background: transparent; border-radius: 0; height: 24px; padding: 0 2px;
  box-shadow: none; font-weight: 400;
}
html[data-skin="wechat"] .im-chip.active {
  background: transparent; color: #07C160; box-shadow: none; font-weight: 600;
  border-bottom: 2px solid #07C160;
}
html[data-skin="wechat"] .im-chat-header { background: #F7F7F7; }
html.im-dark[data-skin="wechat"] .im-chat-header { background: #191919; }
html[data-skin="wechat"] .im-composer { background: #F7F7F7; }
html.im-dark[data-skin="wechat"] .im-composer { background: #191919; }
html[data-skin="wechat"] .im-composer-card { border-radius: 4px; }
html[data-skin="wechat"] .im-bubble { border-radius: 4px; box-shadow: none; }
html[data-skin="wechat"] .im-msg.me .im-bubble { background: #95EC69; color: #111; }
html[data-skin="wechat"].im-dark .im-msg.me .im-bubble { background: #3D8B40; color: #EAF7E8; }
html[data-skin="wechat"] .im-msg.me .im-bubble .who { color: #3D6B2A; }
html[data-skin="wechat"].im-dark .im-msg.me .im-bubble .who { color: rgba(255,255,255,.7); }
html[data-skin="wechat"] .im-kpi { border-radius: 4px; border: 0; }
.im-row-main { min-width: 0; flex: 1; }
.im-row-top { display: flex; align-items: baseline; gap: 8px; }
.im-row-title { font-size: 14px; font-weight: 600; color: var(--im-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-row-time { margin-left: auto; font-size: 11px; color: var(--im-text-3); flex-shrink: 0; }
.im-row-sub { font-size: 12px; color: var(--im-text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-tag {
  font-size: 10px; padding: 0 5px; height: 16px; line-height: 16px;
  border-radius: 4px; background: var(--im-accent-soft); color: var(--im-accent); flex-shrink: 0;
}
.im-tag.warn { background: #FFF1E8; color: #D9480F; }
.im-tag.danger { background: #FFECEC; color: #CF1322; }
html.im-dark .im-tag.warn { background: #3A2A1A; color: #FFB37A; }
html.im-dark .im-tag.danger { background: #3A1A1A; color: #FF8A8A; }

.im-chat-panel {
  position: fixed; top: var(--im-header-h); bottom: 0;
  left: calc(var(--im-nav) + var(--im-list)); right: 0;
  background: var(--im-chat-bg); display: flex; flex-direction: column;
  z-index: 30; color: var(--im-text);
}
.im-chat-header {
  height: 52px; flex-shrink: 0; background: var(--im-list-bg);
  border-bottom: 1px solid var(--im-border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
}
#backBtn { display: none; }
#chatHead { min-width: 0; flex: 1; }
.im-chat-title { font-size: 16px; font-weight: 600; }
.im-chat-sub { font-size: 12px; color: var(--im-text-3); margin-top: 2px; }
.im-chat-body { flex: 1; overflow: auto; padding: 16px 20px 24px; }
.im-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.im-kpi {
  background: var(--im-bubble); border: 1px solid var(--im-border); border-radius: 10px;
  padding: 12px 14px;
}
.im-kpi .l { font-size: 12px; color: var(--im-text-3); }
.im-kpi .v { font-size: 20px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
.im-kpi .h { font-size: 11px; color: var(--im-text-3); margin-top: 2px; }
.im-msg { display: flex; gap: 10px; margin: 12px 0; max-width: 720px; }
.im-msg.me { margin-left: auto; flex-direction: row-reverse; }
.im-msg .av {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.im-bubble {
  background: var(--im-bubble); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); max-width: 560px;
}
.im-msg.me .im-bubble { background: #D4E5FF; }
html.im-dark .im-msg.me .im-bubble { background: #1A3358; }
html[data-skin="feishu"] .im-msg.me .im-bubble { background: #3370FF; color: #fff; }
html[data-skin="feishu"].im-dark .im-msg.me .im-bubble { background: #2B5CE6; }
.im-bubble .who { font-size: 12px; color: var(--im-text-3); margin-bottom: 4px; }
html[data-skin="feishu"] .im-msg.me .im-bubble .who { color: rgba(255,255,255,.75); }
.im-bubble p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.im-bubble p:last-child { margin-bottom: 0; }
.im-md { font-size: 14px; line-height: 1.6; }
.im-md h3, .im-md h4, .im-md h5 { margin: 8px 0 6px; font-size: 14px; font-weight: 650; }
.im-md p { margin: 0 0 8px; }
.im-md ul, .im-md ol { margin: 0 0 8px; padding-left: 1.3em; }
.im-md li { margin: 2px 0; }
.im-md strong { font-weight: 650; }
.im-md code {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  background: rgba(0,0,0,.06); border-radius: 4px; padding: 0 4px;
}
html.im-dark .im-md code { background: rgba(255,255,255,.1); }
.im-md table { border-collapse: collapse; width: 100%; margin: 6px 0 10px; font-size: 13px; }
.im-md th, .im-md td { border: 1px solid var(--im-border); padding: 4px 8px; text-align: left; }
.im-md th { background: var(--im-hover); }
.im-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 8px; }
.im-fact .k { font-size: 11px; color: var(--im-text-3); }
.im-fact .v { font-size: 13px; font-weight: 600; }
.im-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.im-bar-row { display: grid; grid-template-columns: 88px 1fr 36px; gap: 8px; align-items: center; font-size: 12px; }
.im-bar { height: 8px; background: var(--im-hover); border-radius: 4px; overflow: hidden; }
.im-bar > i { display: block; height: 100%; background: var(--im-accent); border-radius: 4px; }
.im-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--im-text-3); gap: 8px;
}
.im-composer {
  flex-shrink: 0; padding: 10px 16px 14px; background: var(--im-list-bg);
}
.im-composer-card {
  border: 1px solid var(--im-border); border-radius: 12px; background: var(--im-bg);
  padding: 10px 14px; color: var(--im-text-3); font-size: 13px;
}
.im-composer-form {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px;
}
.im-composer-form textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent;
  color: var(--im-text); font-size: 14px; line-height: 1.45; min-height: 22px; max-height: 96px;
  font-family: inherit;
}
.im-composer-form button {
  height: 32px; padding: 0 14px; border-radius: 8px;
  background: var(--im-accent); color: #fff; font-size: 13px; flex-shrink: 0;
}
.im-composer-form button:disabled { opacity: .4; cursor: default; }
.im-gate {
  position: fixed; inset: 0; z-index: 200; background: rgba(15,17,21,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.im-gate[hidden] { display: none; }
.im-gate-card {
  width: min(720px, 100%); background: var(--im-bg, #fff); color: var(--im-text, #111);
  border-radius: 16px; padding: 24px; box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.im-gate-card h1 { margin: 0 0 8px; font-size: 20px; }
.im-gate-card p { margin: 0 0 16px; color: var(--im-text-3, #888); font-size: 13px; }
.im-gate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
#demoUsers[hidden] { display: none !important; }
.im-gate-user {
  text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--im-border, #e6e8eb);
  background: var(--im-list-bg, #f7f7f7); color: inherit;
}
.im-gate-user:hover { border-color: var(--im-accent, #1a87ff); }
.im-gate-user b { display: block; font-size: 14px; }
.im-gate-user span { display: block; margin-top: 4px; font-size: 12px; color: var(--im-text-3, #888); }
.im-qr { min-height: 280px; display: flex; justify-content: center; align-items: center; }
.im-qr-hint { text-align: center; font-size: 13px; color: var(--im-text-3, #888); }
.im-gate-err { color: #c0392b !important; }
.im-gate-link {
  display: block; margin: 12px auto 0; background: none; border: 0;
  color: var(--im-accent, #3370ff); font-size: 13px; cursor: pointer;
}
html.im-gated .im-titlebar,
html.im-gated .im-rail,
html.im-gated .im-list-panel,
html.im-gated .im-chat-panel { visibility: hidden; }

html.im-board-open .im-list-panel { display: none; }
html.im-board-open .im-chat-panel { left: var(--im-nav); }
html.im-board-open .im-composer { display: none; }
html.im-board-open .im-chat-header { display: none; }
html.im-board-open .im-chat-body { padding: 0; overflow: hidden; }
.im-board-frame { width: 100%; height: 100%; border: 0; background: #f5f6f7; display: block; }

.skin-menu {
  position: absolute; top: 36px; right: 0; z-index: 80;
  background: var(--im-bg); border: 1px solid var(--im-border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 140px; padding: 6px; color: var(--im-text);
}
.skin-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; color: inherit; text-align: left;
}
.skin-menu button:hover, .skin-menu button.active { background: var(--im-hover); }
.im-list-actions { position: relative; }

.footnote { font-size: 11px; color: var(--im-text-3); margin-top: 16px; line-height: 1.5; }

@media (max-width: 900px) {
  html.topic-open .im-list-panel { display: none; }
  html:not(.topic-open) .im-chat-panel { display: none; }
  html.topic-open #backBtn { display: flex; }
  .im-list-panel { width: calc(100% - var(--im-nav)); }
  .im-chat-panel { left: var(--im-nav); }
  .im-kpis { grid-template-columns: 1fr 1fr; }
}

/* ===== 2026-09-17 双端适配补齐（PRD FR-5）：雷达板窄屏可进可退 + 整页打开 ===== */
.im-board-link {
  display: none; align-items: center; gap: 4px; margin-left: auto;
  font-size: 12px; color: var(--im-accent); text-decoration: none;
  padding: 4px 8px; border: 1px solid var(--im-border); border-radius: 6px; white-space: nowrap;
}
.im-chat-header { align-items: center; }
@media (max-width: 900px) {
  /* 原断点规则把无会话时的 chat 面板整个隐藏，雷达板也住在里面——板模式必须放行 */
  html.im-board-open .im-chat-panel { display: flex; }
  html.im-board-open .im-chat-header { display: flex; }
  html.im-board-open #backBtn { display: flex; }
  .im-board-link { display: inline-flex; }
  .im-composer textarea { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
}
