/* ==========================================================
   themes/wechat.css — 界面风格「简约」：浅灰聊天底、亮绿自己气泡 + 侧边小三角、圆角方头像（每条都带头像）、
   浅灰顶栏、灰色输入栏（左语音 / 右表情 + 加号，有字时加号换成绿色发送）、默认不显示已读勾（设置里可开）
   只覆盖 token 与少量组件规则；对照与取色说明见 docs/skins.md
   ========================================================== */

/* —— 浅色 —— */
html[data-skin="wechat"] {
  --accent: #03893b;                 /* 按钮 / 文字用深一档绿（白字 4.5:1）；气泡保持亮绿 */
  --on-accent: #ffffff;
  --bubble-radius: 4px;
  --item-avatar: 48px;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --bg-hover: #f2f2f2;
  --chat-bg: #ededed;
  --text: #111111;
  --text-2: #7f7f7f;
  --text-3: #a3a3a3;
  --border: #e5e5e5;
  --border-strong: #d0d0d0;
  --bubble-in: #ffffff;
  --bubble-out: #95ec69;
  --bubble-out-text: #111111;
  --bubble-out-meta: rgba(0, 0, 0, .45);
  --bubble-out-quote: rgba(0, 0, 0, .06);
  --bubble-out-line: #2f7d1d;
  --sys-bg: rgba(0, 0, 0, .12);
  --head-bg: #ededed;
  --head-fg: #111111;
  --head-fg-2: #555555;
  --head-accent: #03893b;
  --head-border: #dcdcdc;
  --side-head-bg: #ededed;
  --list-sep: #e5e5e5;
  --item-active-bg: #dedede;
  --item-active-fg: #111111;
  --item-active-fg-2: #7f7f7f;
  --badge-bg: #d93c3c;               /* 角标红：白字 4.6:1 */
  --badge-fg: #ffffff;
  --composer-bg: #f7f7f7;
  --composer-input-bg: #ffffff;
  --composer-input-radius: 4px;
  --composer-btn-bg: transparent;
  --send-bg: #04a447;
  --send-fg: #ffffff;
  --tail-w: 6px; --tail-h: 12px; --tail-top: 12px;
  --tail-out: polygon(0 0, 100% 50%, 0 100%);
  --tail-in: polygon(100% 0, 0 50%, 100% 100%);
}

/* —— 深色（手动 / 跟随系统） —— */
html[data-skin="wechat"][data-theme="dark"] {
  --accent: #3eb575;
  --on-accent: #111111;
  --bg: #191919;
  --bg-soft: #1e1e1e;
  --bg-hover: #262626;
  --chat-bg: #111111;
  --text: #d5d5d5;
  --text-2: #8c8c8c;
  --text-3: #6b6b6b;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --bubble-in: #2c2c2c;
  --bubble-out: #3eb575;
  --bubble-out-text: #0d0d0d;
  --bubble-out-meta: rgba(0, 0, 0, .55);
  --bubble-out-quote: rgba(0, 0, 0, .12);
  --bubble-out-line: #0d3d1f;
  --sys-bg: rgba(255, 255, 255, .08);
  --head-bg: #111111;
  --head-fg: #d5d5d5;
  --head-fg-2: #8c8c8c;
  --head-accent: #3eb575;
  --head-border: #1f1f1f;
  --side-head-bg: #111111;
  --list-sep: #2a2a2a;
  --item-active-bg: #2c2c2c;
  --item-active-fg: #d5d5d5;
  --item-active-fg-2: #8c8c8c;
  --composer-bg: #1e1e1e;
  --composer-input-bg: #2c2c2c;
  --send-bg: #3eb575;
  --send-fg: #0d0d0d;
}
@media (prefers-color-scheme: dark) {
  html[data-skin="wechat"][data-theme="system"] {
    --accent: #3eb575;
    --on-accent: #111111;
    --bg: #191919;
    --bg-soft: #1e1e1e;
    --bg-hover: #262626;
    --chat-bg: #111111;
    --text: #d5d5d5;
    --text-2: #8c8c8c;
    --text-3: #6b6b6b;
    --border: #2a2a2a;
    --border-strong: #3a3a3a;
    --bubble-in: #2c2c2c;
    --bubble-out: #3eb575;
    --bubble-out-text: #0d0d0d;
    --bubble-out-meta: rgba(0, 0, 0, .55);
    --bubble-out-quote: rgba(0, 0, 0, .12);
    --bubble-out-line: #0d3d1f;
    --sys-bg: rgba(255, 255, 255, .08);
    --head-bg: #111111;
    --head-fg: #d5d5d5;
    --head-fg-2: #8c8c8c;
    --head-accent: #3eb575;
    --head-border: #1f1f1f;
    --side-head-bg: #111111;
    --list-sep: #2a2a2a;
    --item-active-bg: #2c2c2c;
    --item-active-fg: #d5d5d5;
    --item-active-fg-2: #8c8c8c;
    --composer-bg: #1e1e1e;
    --composer-input-bg: #2c2c2c;
    --send-bg: #3eb575;
    --send-fg: #0d0d0d;
  }
}

/* —— 组件 —— */
/* 圆角方头像：小圆角（用户在设置里选「圆形」则仍是圆形） */
html[data-skin="wechat"][data-avatar="rounded"] { --avatar-radius: 10%; }
/* 每条消息都带头像（自己的在右侧），气泡与头像顶端对齐、不按连续消息合并 */
html[data-skin="wechat"]:not([data-layout="list"]) .msg { align-items: flex-start; }
html[data-skin="wechat"]:not([data-layout="list"]) .msg > .avatar { visibility: visible !important; }   /* 盖过 ui-messages 里按 :has(+ .cont) 隐藏的规则 */
html[data-skin="wechat"]:not([data-layout="list"]) .msg.out > .avatar { display: inline-flex; order: 2; }
html[data-skin="wechat"]:not([data-layout="list"]) .msg.cont { margin-top: 4px; }
html[data-skin="wechat"] .msg .bubble { border-radius: var(--bubble-radius); }
/* 顶栏：标题居中、不放头像 */
html[data-skin="wechat"] .chat-title { justify-content: center; }
html[data-skin="wechat"] .chat-title > .avatar { display: none; }
html[data-skin="wechat"] .ct-text { align-items: center; }
/* 系统提示 / 时间：无底色的灰字 */
html[data-skin="wechat"] :is(.date-sep, .sys-msg) span { background: none; color: var(--text-2); font-weight: 400; }
/* 输入栏：整条灰底 + 上边线；左侧语音常驻，回形针换成加号放右边；有字时加号让位给绿色发送 */
html[data-skin="wechat"] .composer { padding-top: 8px; align-items: center; }
html[data-skin="wechat"] .composer-input { min-height: 40px; }
html[data-skin="wechat"] .composer-input textarea { height: 40px; padding: 9px 0; }
html[data-skin="wechat"] .composer-input .icon-btn { margin-bottom: 0; }
html[data-skin="wechat"] #micBtn { display: inline-flex; order: -1; width: 36px; height: 36px; background: none; color: var(--text); border: 1.5px solid currentColor; }
html[data-skin="wechat"] #attachBtn { order: 3; width: 40px; height: 40px; }
html[data-skin="wechat"] #attachBtn .ti::before { content: "\eb0b"; }          /* 加号（ti-plus） */
html[data-skin="wechat"] .composer-wrap.has-text #attachBtn { display: none; }
html[data-skin="wechat"] #sendBtn { order: 4; width: 52px; height: 36px; border-radius: var(--radius-sm); }
html[data-skin="wechat"] .composer > .rec-bar { order: 1; }

/* 设置页缩略 */
.skin-sw[data-sw="wechat"] { --sw-bg: #ededed; --sw-in: #ffffff; --sw-out: #95ec69; --sw-r: 2px; }
