/* ==========================================================
   themes/whatsapp.css — 界面风格「清新」：浅米色带淡几何图案的聊天底、浅绿自己气泡 + 尾巴、白顶栏（深色近黑，按 2024 改版后的现行版）、
   白色胶囊输入框 + 右侧绿色圆形发送 / 麦克风、蓝色已读双勾。图案是自绘几何（assets/bg/geo-*.svg）
   只覆盖 token 与少量组件规则；对照与取色说明见 docs/skins.md
   ========================================================== */

/* —— 浅色 —— */
html[data-skin="whatsapp"] {
  --accent: #008069;                 /* 文字 / 按钮用的深一档绿（白字 4.9:1）；发送按钮另用亮绿 */
  --on-accent: #ffffff;
  --bubble-radius: 8px;
  --item-avatar: 48px;
  --bg: #ffffff;
  --bg-soft: #f0f2f5;
  --bg-hover: #f5f6f6;
  --chat-bg: #f5f1eb;
  --text: #111b21;
  --text-2: #667781;
  --text-3: #8696a0;
  --border: #e9edef;
  --border-strong: #d1d7db;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-out-text: #111b21;
  --bubble-out-meta: #667781;
  --bubble-out-quote: rgba(0, 0, 0, .05);
  --bubble-out-line: #008069;
  --receipt-read: #027eb5;           /* 亮蓝 #53bdeb 在浅绿气泡上只有 1.9:1，换深一档 */
  --sys-bg: rgba(225, 245, 254, .92);
  --head-bg: #ffffff;
  --head-fg: #111b21;
  --head-fg-2: #54656f;
  --head-accent: #008069;
  --head-border: #e9edef;
  --side-head-bg: #ffffff;
  --list-sep: #e9edef;
  --item-active-bg: #f0f2f5;
  --item-active-fg: #111b21;
  --item-active-fg-2: #667781;
  --badge-bg: #1daa61;               /* 现行版是白字，白字只有 2.9:1，用深字 */
  --badge-fg: #111b21;
  --composer-bg: transparent;
  --composer-input-bg: #ffffff;
  --composer-input-radius: 24px;
  --composer-btn-bg: transparent;
  --send-bg: #00a884;
  --send-fg: #ffffff;
  --tail-w: 8px; --tail-h: 13px; --tail-top: 0;
}
html[data-skin="whatsapp"][data-chat-bg="solid"] { --chat-pattern: url("../../assets/bg/geo-light.svg"); }

/* —— 深色（手动 / 跟随系统） —— */
html[data-skin="whatsapp"][data-theme="dark"] {
  --accent: #00a884;
  --on-accent: #111b21;
  --bg: #0b1014;
  --bg-soft: #22282b;
  --bg-hover: #1a2023;
  --chat-bg: #0b1014;
  --text: #e9edef;
  --text-2: #8696a0;
  --text-3: #667781;
  --border: #1f272a;
  --border-strong: #374248;
  --bubble-in: #1f272a;
  --bubble-out: #144d37;
  --bubble-out-text: #e9edef;
  --bubble-out-meta: rgba(233, 237, 239, .6);
  --bubble-out-quote: rgba(0, 0, 0, .18);
  --bubble-out-line: #06cf9c;
  --receipt-read: #53bdeb;
  --sys-bg: #1f272a;
  --head-bg: #0b1014;
  --head-fg: #e9edef;
  --head-fg-2: #8696a0;
  --head-accent: #00a884;
  --head-border: #1f272a;
  --side-head-bg: #0b1014;
  --list-sep: #1f272a;
  --item-active-bg: #22282b;
  --item-active-fg: #e9edef;
  --item-active-fg-2: #8696a0;
  --badge-bg: #21c063;
  --badge-fg: #111b21;
  --composer-input-bg: #1f272a;
  --send-bg: #00a884;
  --send-fg: #111b21;
}
html[data-skin="whatsapp"][data-theme="dark"][data-chat-bg="solid"] { --chat-pattern: url("../../assets/bg/geo-dark.svg"); }
@media (prefers-color-scheme: dark) {
  html[data-skin="whatsapp"][data-theme="system"] {
    --accent: #00a884;
    --on-accent: #111b21;
    --bg: #0b1014;
    --bg-soft: #22282b;
    --bg-hover: #1a2023;
    --chat-bg: #0b1014;
    --text: #e9edef;
    --text-2: #8696a0;
    --text-3: #667781;
    --border: #1f272a;
    --border-strong: #374248;
    --bubble-in: #1f272a;
    --bubble-out: #144d37;
    --bubble-out-text: #e9edef;
    --bubble-out-meta: rgba(233, 237, 239, .6);
    --bubble-out-quote: rgba(0, 0, 0, .18);
    --bubble-out-line: #06cf9c;
    --receipt-read: #53bdeb;
    --sys-bg: #1f272a;
    --head-bg: #0b1014;
    --head-fg: #e9edef;
    --head-fg-2: #8696a0;
    --head-accent: #00a884;
    --head-border: #1f272a;
    --side-head-bg: #0b1014;
    --list-sep: #1f272a;
    --item-active-bg: #22282b;
    --item-active-fg: #e9edef;
    --item-active-fg-2: #8696a0;
    --badge-bg: #21c063;
    --badge-fg: #111b21;
    --composer-input-bg: #1f272a;
    --send-bg: #00a884;
    --send-fg: #111b21;
  }
  html[data-skin="whatsapp"][data-theme="system"][data-chat-bg="solid"] { --chat-pattern: url("../../assets/bg/geo-dark.svg"); }
}

/* —— 组件 —— */
/* 系统提示 / 日期条：浅色是淡蓝底深字（深色走 token 的深底） */
html[data-skin="whatsapp"] :is(.date-sep, .sys-msg) span { color: var(--text-2); box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
/* 尾巴在上角：那个角做成直角 */
html[data-skin="whatsapp"]:not([data-layout="list"]) .msg.out:not(.cont) .bubble:not(.media) { border-top-right-radius: 0; }
html[data-skin="whatsapp"]:not([data-layout="list"]) .msg.in:not(.cont) .bubble:not(.media) { border-top-left-radius: 0; }
html[data-skin="whatsapp"] .msg .bubble { border-bottom-left-radius: var(--bubble-radius); border-bottom-right-radius: var(--bubble-radius); }
/* 左栏顶部：白底（深色近黑），搜索框是灰色胶囊 */
html[data-skin="whatsapp"] .side-head .icon-btn { color: var(--head-fg-2); }
html[data-skin="whatsapp"] .side-head .search { border-radius: 20px; }
/* 输入栏：图标按钮透明、发送 / 麦克风是实心绿圆 */
html[data-skin="whatsapp"] .composer > .icon-btn { color: var(--text-2); }

/* 设置页缩略 */
.skin-sw[data-sw="whatsapp"] { --sw-bg: #f5f1eb; --sw-in: #ffffff; --sw-out: #d9fdd3; --sw-r: 4px; }
