/* 聊天：微信式布局，配色用我们自己的深蓝 + 琥珀（不用微信绿）。设计第十二轮的样稿出来后，按样稿改这里即可。 */
:root { --wx-bg: #edf1f6; --wx-own: #fbe3b5; --wx-own-ink: #3d2a0d; --wx-other: #ffffff; --wx-line: #dfe5ee; --wx-time: #8a97a8; }
.screen.is-night { --wx-bg: #0f1823; --wx-own: #5a4527; --wx-own-ink: #f6e6c9; --wx-other: #1d2a38; --wx-line: #283646; --wx-time: #8f9aa6; }

/* 会话列表 */
.chat-list { padding: 0 !important; background: var(--white); }
.wx-list-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--canvas); border-bottom: 1px solid var(--wx-line); }
.wx-search { flex: 1; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 8px; background: var(--white); color: var(--muted); }
.wx-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.wx-plus-top { width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--navy); color: #ffd68d; font-size: 22px; line-height: 1; }
.is-night .wx-plus-top { color: #152b46; }
.wx-new { margin: 8px 12px; padding: 6px 12px; }
.wx-new-title, .wx-new-note { padding: 6px 0; color: var(--muted); font-size: 12px; }
.wx-new-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--wx-line); color: var(--ink); text-decoration: none; }
.wx-new-row small { margin-left: auto; color: var(--muted); font-size: 11px; }
.wx-threads { display: block; }
.wx-thread { display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 0 14px; color: var(--ink); text-decoration: none; position: relative; }
.wx-thread + .wx-thread::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; border-top: 1px solid var(--wx-line); }
.wx-thread.is-pinned { background: var(--canvas); }
.wx-thread-avatar { position: relative; flex: none; }
.wx-thread-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.wx-thread-top { display: flex; align-items: baseline; gap: 8px; }
.wx-thread-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.wx-thread-top time { flex: none; color: var(--wx-time); font-size: 11px; }
.wx-thread-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wx-time); font-size: 13px; }
.wx-badge { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.wx-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

/* 头像：圆角方形，右下角小圆点表示状态 */
.wx-avatar { position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 7px; background: var(--avatar-bg, #e8edf5); color: var(--avatar-ink, #345273); font-size: 18px; font-weight: 700; }
.wx-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--white); background: var(--team-state, #9cabbc); }
.wx-group-avatar { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; background: #dde3ec; }
.wx-group-avatar b { display: grid; place-items: center; border-radius: 3px; background: var(--avatar-bg); color: var(--avatar-ink); font-size: 10px; width: 100%; height: 100%; }
.is-night .wx-group-avatar { background: #2a3746; }

/* 聊天窗口：顶部标题（替换顶部栏） */
.chat-top { display: flex; align-items: center; gap: 4px; width: 100%; }
.wx-back, .wx-more { display: grid; place-items: center; width: 38px; height: 38px; border: 0; background: none; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 700; }
.wx-title { flex: 1; min-width: 0; text-align: center; font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-title small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 500; }

.chat { display: flex; flex-direction: column; padding: 0 !important; background: var(--wx-bg); overflow: hidden !important; }
.wx-banner { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; background: #3a2c16; color: #ffd68d; font-size: 12px; font-weight: 650; }
.wx-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 14px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.wx-log::-webkit-scrollbar { display: none; }
.wx-time { align-self: center; padding: 2px 7px; border-radius: 4px; color: var(--wx-time); font-size: 11.5px; }
.wx-row { display: flex; align-items: flex-start; gap: 9px; }
.wx-row .wx-avatar { width: 40px; height: 40px; font-size: 15px; }
.wx-row.own { flex-direction: row-reverse; }
.wx-col { display: flex; flex-direction: column; align-items: flex-start; max-width: calc(100% - 100px); min-width: 0; }
.wx-row.own .wx-col { align-items: flex-end; }
.wx-name { margin: 0 0 3px 2px; color: var(--wx-time); font-size: 11.5px; }
.wx-bubble { position: relative; padding: 9px 11px; border-radius: 6px; background: var(--wx-other); color: var(--ink); font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; border: 0; text-align: left; }
.wx-bubble::before { content: ""; position: absolute; top: 13px; left: -5px; border: 5px solid transparent; border-left: 0; border-right-color: var(--wx-other); }
.own .wx-bubble { background: var(--wx-own); color: var(--wx-own-ink); }
.own .wx-bubble::before { left: auto; right: -5px; border-right: 0; border-left: 5px solid var(--wx-own); border-top-color: transparent; border-bottom-color: transparent; }
.wx-voice-wrap { display: flex; align-items: center; gap: 6px; width: 100%; }
.own .wx-voice-wrap { flex-direction: row-reverse; }
.wx-voice { display: flex; align-items: center; gap: 8px; width: var(--w); min-width: 78px; font: inherit; font-size: 14px; cursor: pointer; }
.own .wx-voice { flex-direction: row-reverse; justify-content: flex-start; }
.wx-voice-waves { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.wx-voice-waves i { width: 3px; border-radius: 2px; background: currentColor; opacity: .7; }
.wx-voice-waves i:nth-child(1) { height: 6px; } .wx-voice-waves i:nth-child(2) { height: 11px; } .wx-voice-waves i:nth-child(3) { height: 16px; }
.wx-voice.playing .wx-voice-waves i { animation: wx-wave .9s ease-in-out infinite; }
.wx-voice.playing .wx-voice-waves i:nth-child(2) { animation-delay: .15s; } .wx-voice.playing .wx-voice-waves i:nth-child(3) { animation-delay: .3s; }
@keyframes wx-wave { 50% { opacity: .2; } }
.wx-unheard { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; flex: none; }
.wx-photo { max-width: 180px; max-height: 220px; border-radius: 6px; display: block; }

/* 卡片消息（路况、位置、战报）：像微信的链接/位置卡片 */
.wx-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; width: 236px; max-width: 100%; padding: 10px 12px; border-radius: 6px; background: var(--wx-other); color: var(--ink); border: 0; text-align: left; font: inherit; }
.wx-card-main { display: grid; gap: 3px; min-width: 0; }
.wx-card-main b { font-size: 14.5px; line-height: 1.3; }
.wx-card-main small { color: var(--wx-time); font-size: 11.5px; }
.wx-card-icon { color: var(--gold); }
.wx-location { grid-template-columns: 1fr; padding: 0; overflow: hidden; cursor: pointer; }
.wx-location .wx-card-main { padding: 9px 11px 0; }
.wx-mini-map { width: 100%; height: 90px; display: block; }
.wx-hazard { border-left: 3px solid #e3a33c; }
.wx-hazard .wx-card-main b { display: flex; align-items: center; gap: 4px; }
.wx-hazard .icon { color: #d58b20; }
.wx-card-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid var(--wx-line); font-size: 12px; }
.wx-card-foot a { color: var(--gold); text-decoration: none; font-weight: 650; }
.wx-card-foot button, .wx-goal button { border: 1px solid var(--wx-line); border-radius: 12px; background: transparent; color: var(--ink); padding: 2px 9px; font-size: 12px; }
.wx-card-foot button[aria-pressed="true"], .wx-goal button[aria-pressed="true"] { border-color: #e1bb7d; color: #8c5613; background: #fdf0d8; }
.wx-report { background: linear-gradient(120deg, #1e3855, #132941); color: #fff; align-items: center; }
.wx-report .wx-card-main small { color: #c9d6e6; }
.wx-report .amount { font-size: 28px; color: #ffe0a6; --number-muted: #e6c992; }
.wx-ring { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(#f3bc66 var(--pct), #ffffff22 0); font-size: 11px; font-weight: 700; position: relative; }
.wx-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #17304a; }
.wx-ring { isolation: isolate; } .wx-ring::before { z-index: -1; }
/* 系统动态（正在去哪、达成目标、转单）：中间灰色小条 */
.wx-system { align-self: center; max-width: 92%; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 4px 10px; border: 0; border-radius: 4px; background: #00000010; color: var(--muted); font: inherit; font-size: 12px; text-decoration: none; text-align: center; }
.is-night .wx-system { background: #ffffff12; }
.wx-goal { color: #7a4c12; background: #fbecd2; }
.is-night .wx-goal { color: #f1cf98; background: #3b3124; }
/* SOS */
.wx-sos { align-self: stretch; overflow: hidden; border: 1.5px solid #c9545f; border-radius: 10px; background: #1d273b; color: #f8f0f2; }
.wx-sos header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: linear-gradient(110deg, #6a2430, #2a283b); font-size: 16px; }
.wx-sos time { color: #ffd0d0; font-size: 11px; }
.wx-sos-place { display: flex; align-items: center; gap: 4px; padding: 8px 12px 0; font-size: 12.5px; }
.wx-sos-place small { margin-left: auto; color: #bcc9da; font-size: 10.5px; }
.wx-sos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px 12px; }
.wx-sos-actions > * { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; border: 1px solid #536a83; border-radius: 8px; background: #263b53; color: #edf3fa; font: inherit; font-size: 14px; font-weight: 650; text-decoration: none; }
.wx-sos-call { background: #a83a48 !important; border-color: #d46b78 !important; }

/* 底部输入栏：语音/键盘 + 输入框/按住说话 + 表情 + 加号 */
.wx-composer { flex: none; background: var(--canvas); border-top: 1px solid var(--wx-line); padding-bottom: env(safe-area-inset-bottom); }
.wx-bar { display: flex; align-items: center; gap: 7px; padding: 7px 8px; }
.wx-icon-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font-size: 20px; line-height: 1; padding: 0; }
.wx-icon-btn .icon { color: var(--ink); }
.wx-input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.wx-hold { flex: 1; height: 40px; border: 0; border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; font-size: 15px; font-weight: 650; touch-action: none; user-select: none; -webkit-user-select: none; }
.wx-hold[data-holding] { background: #f2d49b; color: #3d2a0d; }
.wx-send { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--navy); color: #ffd68d; font: inherit; font-size: 14px; font-weight: 650; }
.is-night .wx-send { color: #152b46; }
.wx-panel { border-top: 1px solid var(--wx-line); }
.wx-emoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 10px; max-height: 190px; overflow-y: auto; }
.wx-emoji button { height: 40px; border: 0; background: none; font-size: 24px; }
.wx-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; padding: 16px 14px 18px; }
.wx-tool { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11.5px; touch-action: none; }
.wx-tool span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; background: var(--white); color: var(--navy); }
.is-night .wx-tool span { color: #e5bf83; }
.wx-tool-sos span { color: #c83c4a !important; border: 1.5px solid #e08a94; background: linear-gradient(90deg, #fbd5d6 var(--hold, 0%), var(--white) var(--hold, 0%)); }
.wx-list { display: grid; gap: 8px; padding: 12px 14px 14px; }
.wx-list p { color: var(--muted); font-size: 12px; }
.wx-list button { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1px solid var(--wx-line); border-radius: 10px; background: var(--white); color: var(--ink); font: inherit; font-size: 15px; font-weight: 650; text-align: left; }
.wx-list button .icon { color: var(--gold); }

/* 录音浮层：中间一块，上滑变红取消 */
.wx-rec { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
.wx-rec-box { display: grid; justify-items: center; gap: 12px; width: 170px; padding: 22px 12px 16px; border-radius: 14px; background: #152b46e6; color: #fff; }
.wx-rec-wave { display: flex; align-items: center; gap: 4px; height: 40px; }
.wx-rec-wave i { width: 5px; height: 12px; border-radius: 3px; background: #ffd68d; animation: wx-rec 1s ease-in-out infinite; }
.wx-rec-wave i:nth-child(2n) { animation-delay: .2s; } .wx-rec-wave i:nth-child(3n) { animation-delay: .4s; }
@keyframes wx-rec { 50% { height: 36px; } }
.wx-rec p { font-size: 13px; }
.wx-rec.is-cancel .wx-rec-box { background: #a83a48eb; }
.wx-rec.is-cancel .wx-rec-wave i { background: #fff; animation: none; }

/* 行驶中：只留一个大的「按住 说话」 */
.chat-driving .wx-bar { padding: 14px 12px; }
.chat-driving .wx-hold { height: 76px; border-radius: 38px; background: linear-gradient(#ffd98f, #eaa94a); color: #3a2604; font-size: 19px; box-shadow: 0 4px 0 #b97c2a, 0 6px 14px #00000033; }
.chat-driving .wx-hold[data-holding] { transform: translateY(3px); box-shadow: 0 1px 0 #b97c2a; }
.chat-driving .wx-row .wx-avatar { width: 46px; height: 46px; }
.chat-driving .wx-voice { min-height: 50px; font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .wx-voice-waves i, .wx-rec-wave i { animation: none !important; } }
