* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #222; font-size: 14px; }
#app { display: flex; flex-direction: column; height: 100vh; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #1a73e8; color: #fff; }
.brand { font-size: 17px; font-weight: 700; }
.header-right { font-size: 12px; opacity: .95; }
.layout { display: flex; flex: 1; overflow: hidden; }
aside { width: 240px; background: #fff; border-right: 1px solid #e3e6ea; display: flex; flex-direction: column; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef0f3; font-weight: 600; }
.side-tip { padding: 10px 12px; font-size: 12px; color: #888; border-top: 1px solid #eef0f3; }
#group-list { flex: 1; overflow-y: auto; padding: 8px; }
.group-item { margin-bottom: 8px; }
.group-title { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-weight: 600; color: #444; }
.group-title:hover { background: #f2f5f9; }
.group-title .btns { margin-left: auto; display: none; gap: 4px; }
.group-item:hover .btns { display: flex; }
.account-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 22px; border-radius: 6px; cursor: pointer; color: #333; }
.account-item:hover { background: #f2f5f9; }
.account-item.selected { background: #e8f0fe; color: #1a73e8; }
.account-item .btns { margin-left: auto; display: none; gap: 4px; }
.account-item:hover .btns { display: flex; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.online { background: #2ecc71; }
.dot.qr { background: #f1c40f; }
.dot.connecting, .dot.reconnecting { background: #f39c12; animation: blink 1s infinite; }
.dot.offline { background: #bbb; }
.dot.logged_out, .dot.bad_session { background: #e74c3c; }
@keyframes blink { 50% { opacity: .3; } }
main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: #f0f2f5; }
.tabs button { border: none; background: transparent; padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; color: #555; }
.tabs button.active { background: #fff; color: #1a73e8; font-weight: 600; }
.tab-page { display: none; flex: 1; overflow-y: auto; padding: 16px; background: #fff; }
.tab-page.active { display: block; }
.card { border: 1px solid #e3e6ea; border-radius: 10px; padding: 16px; margin-bottom: 16px; background: #fff; }
.card h3 { margin-bottom: 12px; font-size: 15px; }
.form-row { margin-bottom: 10px; }
.form-row.inline { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
label { display: inline-flex; align-items: center; gap: 6px; }
input[type=text], input[type=password], input[type=number], select { padding: 6px 8px; border: 1px solid #ccd3dc; border-radius: 6px; font-size: 13px; }
textarea { width: 100%; padding: 8px; border: 1px solid #ccd3dc; border-radius: 6px; font-size: 13px; font-family: inherit; resize: vertical; }
.small-input { width: 70px; }
.mid-input { width: 160px; }
.long-input { width: 320px; }
button { padding: 7px 14px; border: 1px solid #ccd3dc; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
button:hover { background: #f5f7fa; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
button.primary:hover { background: #1765cc; }
button.danger { color: #d93025; }
.mini-btn { padding: 3px 8px; font-size: 12px; }
.hint { color: #777; font-size: 12px; margin-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.data-table th, .data-table td { border: 1px solid #e3e6ea; padding: 7px 9px; text-align: left; font-size: 13px; vertical-align: top; }
.data-table th { background: #f7f9fb; font-weight: 600; }
.chat-layout { display: flex; height: 100%; }
.chat-list-pane { width: 260px; border-right: 1px solid #e3e6ea; display: flex; flex-direction: column; overflow: hidden; }
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef0f3; font-weight: 600; min-height: 41px; }
#chat-list { flex: 1; overflow-y: auto; }
.chat-item { padding: 10px 12px; border-bottom: 1px solid #f2f4f6; cursor: pointer; }
.chat-item:hover { background: #f7f9fb; }
.chat-item.selected { background: #e8f0fe; }
.chat-item .name { font-weight: 600; }
.chat-item .meta { color: #888; font-size: 12px; margin-top: 2px; }
.unread-badge { display: inline-block; background: #e74c3c; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }
#messages { flex: 1; overflow-y: auto; padding: 16px; }
.msg { margin-bottom: 12px; display: flex; }
.msg.in { justify-content: flex-start; }
.msg.out { justify-content: flex-end; }
.bubble { max-width: 72%; padding: 9px 12px; border-radius: 12px; background: #fff; border: 1px solid #e3e6ea; }
.msg.out .bubble { background: #d7e7ff; border-color: #c9ddfb; }
.bubble .sender { font-size: 12px; color: #1a73e8; margin-bottom: 3px; font-weight: 600; }
.bubble .text { white-space: pre-wrap; word-break: break-word; }
.bubble .trans { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d0d6de; color: #555; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.bubble .meta { margin-top: 5px; font-size: 11px; color: #999; }
.auto-tag { display: inline-block; background: #f1c40f; color: #5c4a00; font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.reply-box { border-top: 1px solid #e3e6ea; padding: 10px 12px; }
.reply-box textarea { min-height: 60px; }
.reply-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.preview { background: #f7f9fb; border: 1px dashed #ccd3dc; border-radius: 6px; padding: 8px; margin-bottom: 8px; color: #555; }
.hidden { display: none; }
.log-list { font-family: Consolas, monospace; font-size: 12px; line-height: 1.8; color: #444; }
.log-list .entry { border-bottom: 1px solid #f2f4f6; padding: 4px 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 12px; min-width: 360px; max-width: 520px; max-height: 86vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eef0f3; font-weight: 600; }
#modal-body { padding: 16px; }
.modal-box .form-row { margin-bottom: 12px; }
.modal-box label { display: block; margin-bottom: 5px; }
.modal-box input[type=text], .modal-box select { width: 100%; }
.qr-wrap { text-align: center; }
.qr-wrap img { width: 260px; height: 260px; border: 1px solid #e3e6ea; border-radius: 8px; }
.qr-hint { margin-top: 10px; color: #555; font-size: 13px; }
.scope-picker { display: flex; gap: 8px; }
.status-msg { font-size: 12px; }
.msg-sel-count { margin-left: 6px; color: #888; }

/* ===== WhatsApp 风格聊天界面 ===== */
#tab-chat.active { padding: 0; overflow: hidden; }
.chat-layout { display: flex; height: 100%; }
.chat-list-pane { width: 310px; border-right: 1px solid #e9edef; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.chat-list-head { min-height: 59px; padding: 8px 12px; gap: 8px; }
.label-filter { width: 110px; padding: 4px 6px; font-size: 12px; }
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #efeae2; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #f0f2f5; border-bottom: 1px solid #e9edef; min-height: 59px; gap: 10px; }
.chat-head-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-head-text { min-width: 0; }
#chat-title { font-size: 16px; font-weight: 600; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-sub { font-size: 12px; color: #667781; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: #dfe5e7; color: #54656f; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; font-size: 15px; }
.avatar-lg { width: 42px; height: 42px; font-size: 18px; }

#chat-list { flex: 1; overflow-y: auto; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.chat-item:hover { background: #f5f6f6; }
.chat-item.selected { background: #f0f2f5; }
.chat-item .chat-item-main { flex: 1; min-width: 0; }
.chat-item .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-item .name { font-size: 15px; font-weight: 600; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { font-size: 11px; color: #667781; flex: none; }
.chat-item .row2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.chat-item .meta { color: #667781; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chat-item .label-dots { display: flex; gap: 3px; flex: none; }
.label-dot { width: 9px; height: 9px; border-radius: 50%; }
.unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; background: #25d366; color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 700; flex: none; }

#messages { flex: 1; overflow-y: auto; padding: 20px 55px 10px; background-color: #efeae2; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.025) 0 2px, transparent 2px 14px); }
.msg { display: flex; margin-bottom: 4px; align-items: flex-end; gap: 8px; }
.msg.in { justify-content: flex-start; }
.msg.out { justify-content: flex-end; }
.msg .bubble { max-width: 65%; padding: 6px 9px 5px; border-radius: 8px; background: #fff; box-shadow: 0 1px 0.5px rgba(11,20,26,.13); }
.msg.out .bubble { background: #d9fdd3; }
.bubble .sender { font-size: 12.5px; font-weight: 600; color: #008069; margin-bottom: 2px; }
.bubble .text { white-space: pre-wrap; word-break: break-word; font-size: 14.2px; color: #111b21; line-height: 1.35; }
.bubble .trans { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(134,150,160,.35); color: #54656f; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.bubble .meta { margin-top: 3px; font-size: 11px; color: #667781; text-align: right; }
.bubble .meta .ticks { color: #8696a0; font-weight: 700; letter-spacing: -2px; margin-left: 3px; }
.bubble .meta .ticks-read { color: #53bdeb; }
.auto-tag { display: inline-block; background: #f1c40f; color: #5c4a00; font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }

.reply-box { border-top: 1px solid #e9edef; padding: 8px 12px; background: #f0f2f5; }
.reply-row { display: flex; align-items: flex-end; gap: 8px; }
.reply-input-wrap { position: relative; flex: 1; min-width: 0; }
.reply-box textarea { display: block; width: 100%; box-sizing: border-box; min-height: 42px; max-height: 180px; border-radius: 8px; background: #fff; border: none; padding: 10px 12px; resize: none; font-size: 14px; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-y: hidden; }
.reply-box textarea:focus { outline: 2px solid #25d366; outline-offset: -1px; }
.reply-input-handle { position: absolute; top: -8px; left: 0; right: 0; height: 9px; cursor: ns-resize; z-index: 5; color: #b3bcc2; font-size: 10px; line-height: 9px; text-align: center; opacity: 0; }
.reply-input-wrap:hover .reply-input-handle { opacity: 1; }
.reply-input-handle:hover { color: #54656f; }
.reply-row .primary { background: #008069; border: none; border-radius: 50%; width: 42px; height: 42px; padding: 0; font-size: 12px; flex: none; }
.reply-row .primary:hover { background: #017561; }
.preview { background: #fff; border: 1px dashed #b5c2c8; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; color: #54656f; font-size: 13px; }

.label-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.label-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; font-size: 12px; color: #fff; white-space: nowrap; }
.label-chip .x { cursor: pointer; opacity: .8; font-weight: 700; }
.label-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid #f2f4f6; }
.label-row input[type=checkbox] { width: 16px; height: 16px; }
.label-swatch { width: 14px; height: 14px; border-radius: 50%; }
.label-name-input { flex: 1; min-width: 80px; padding: 4px 6px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.label-name-input[readonly] { background: #f4f5f7; color: #667; }
.label-color-input { width: 70px; padding: 3px; font-size: 12px; }
.label-phone-state { font-size: 11px; white-space: nowrap; }
.label-phone-state.ok { color: #2e7d32; }
.label-phone-state.warn { color: #c62828; }
.label-sys-badge { display: inline-block; padding: 1px 7px; border-radius: 9px; background: #e8eaf0; color: #555f70; font-size: 11px; white-space: nowrap; }
.chat-item .phone { display: none; }

.msg-media { max-width: 260px; max-height: 320px; border-radius: 6px; display: block; margin: 2px 0 4px; background: #e9edef; }
.msg-audio { width: 240px; }
.msg-doc { display: inline-block; color: #008069; font-size: 13.5px; margin: 2px 0 4px; }
.msg-media-fail { color: #667781; font-size: 12.5px; padding: 4px 0; }
.msg-media-fail { display: flex; align-items: center; gap: 8px; }
.media-retry { border: 1px solid #00a884; color: #00a884; background: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.media-retry:disabled { opacity: 0.6; cursor: default; }
.load-more { display: block; margin: 8px auto; padding: 6px 14px; background: #fff; border: 1px solid #d1d7db; border-radius: 16px; color: #008069; font-size: 12.5px; cursor: pointer; }
.load-more:hover { background: #f5f6f6; }
.label-pills { display: flex; gap: 4px; flex: none; max-width: 45%; overflow: hidden; }
.label-pill { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

.chat-search { width: calc(100% - 24px); margin: 8px 12px; padding: 7px 10px; border: 1px solid #d1d7db; border-radius: 8px; font-size: 13px; background: #f0f2f5; }
.chat-search:focus { outline: 2px solid #25d366; outline-offset: -1px; background: #fff; }
.quote-bar { display: flex; align-items: center; gap: 8px; background: #e7f8ef; border-left: 4px solid #25d366; border-radius: 6px; padding: 6px 10px; margin-bottom: 6px; font-size: 13px; color: #111b21; }
.quote-bar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble .quote { background: #f0f2f5; border-left: 3px solid #25d366; border-radius: 4px; padding: 4px 8px; margin-bottom: 4px; font-size: 12.5px; color: #54656f; white-space: pre-wrap; word-break: break-word; }
.msg.out .bubble .quote { background: #e3f5e6; border-left-color: #53bdeb; }
.quote-btn { border: none; background: transparent; color: #8696a0; cursor: pointer; font-size: 13px; padding: 0 4px; margin-left: 4px; opacity: 0; vertical-align: middle; }
.msg:hover .quote-btn { opacity: 1; }

.match-card { margin-top: 6px; padding: 8px; border: 1px solid #cfe3d4; border-radius: 8px; background: #f4fbf6; font-size: 13px; }
.match-card.match-pending { color: #7a5a00; background: #fff9e6; border-color: #f0d98c; }
.match-card.match-error { color: #a52a2a; background: #fdecec; border-color: #f2c4c4; }
.match-card.match-none { color: #666; background: #f4f6f8; border-color: #dfe4e9; }
.match-group-label { font-weight: 600; color: #1a7a4a; margin-bottom: 4px; }
.match-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: 6px; background: #fff; border: 1px solid #e4ece6; }
.match-row.match-chosen { border-color: #1a7a4a; box-shadow: 0 0 0 2px rgba(26,122,74,.18); }
.match-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: #eee; flex: none; }
.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 600; color: #111b21; word-break: break-word; }
.match-sub { color: #54656f; margin-top: 1px; word-break: break-word; }
.match-price { color: #b45309; font-weight: 600; margin-top: 3px; }
.match-badge { flex: none; font-size: 11px; padding: 2px 6px; border-radius: 10px; color: #fff; }
.match-badge-high { background: #1a7a4a; }
.match-badge-medium { background: #b7791f; }
.match-badge-low { background: #7a828a; }
.match-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.match-confirmed { color: #1a7a4a; font-weight: 600; font-size: 12px; }
.match-cands { margin-top: 6px; color: #54656f; font-size: 12.5px; line-height: 1.9; }
.match-cand { margin: 2px 6px 2px 0; padding: 3px 8px; border: 1px solid #d6e2da; border-radius: 12px; background: #fff; color: #1a7a4a; cursor: pointer; font-size: 12.5px; }
.match-cand:hover { background: #eaf5ee; }
.match-brand-src { color: #1a7a4a; font-weight: 600; }
.paste-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; padding: 8px; border: 1px solid #dfe4e9; border-radius: 8px; background: #f7f9fb; }
.paste-item { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e4ece6; border-radius: 6px; padding: 4px 6px; font-size: 12px; max-width: 240px; }
.paste-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; display: block; }
.paste-file-icon { font-size: 20px; line-height: 40px; }
.paste-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-remove { border: none; background: none; cursor: pointer; color: #a52a2a; font-weight: 700; font-size: 14px; }
.brand-hit { color: #1a7a4a; font-weight: 600; }
.brand-lookup-btn { margin-left: 2px; padding: 0 5px; font-size: 11px; border: 1px solid #1a7a4a; color: #1a7a4a; background: #fff; border-radius: 4px; cursor: pointer; vertical-align: middle; }
.brand-lookup-btn:hover { background: #eaf5ee; }
.brand-panel .match-row { margin-bottom: 6px; }
.msg-media, .match-img { cursor: zoom-in; }
.img-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 60; overflow: auto; padding: 24px; }
.img-viewer.hidden { display: none; }
.img-viewer img { display: block; margin: auto; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); object-fit: contain; cursor: zoom-in; background: rgba(255,255,255,.04); }
.img-viewer img.zoom100 { max-width: none; max-height: none; width: auto; height: auto; cursor: zoom-out; }
.img-viewer-close { position: fixed; top: 14px; right: 18px; z-index: 61; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; cursor: pointer; }
.img-viewer-close:hover { background: rgba(255,255,255,.32); }
.quote-btn:hover { color: #00a884; }
.attach-btn { background: transparent; border: none; font-size: 22px; cursor: pointer; padding: 4px 6px; color: #54656f; }
.attach-btn:hover { color: #00a884; }
.search-results { max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.search-item { border: 1px solid #e3e6ea; border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer; }
.search-item:hover { background: #f5f9fe; }
.si-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: #54656f; }
.si-head b { color: #111b21; font-size: 14px; }
.si-body { margin-top: 4px; font-size: 13px; color: #111b21; white-space: pre-wrap; word-break: break-word; }
.si-trans { margin-top: 4px; font-size: 12.5px; color: #54656f; white-space: pre-wrap; word-break: break-word; }
.msg.flash { animation: msgflash 1.3s ease-in-out 2; border-radius: 8px; }
@keyframes msgflash { 50% { background: rgba(37, 211, 102, .18); } }

.user-info { font-size: 13px; margin-right: 10px; }
.op-tag { display: inline-block; background: #eef2f7; color: #54656f; font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.auth-overlay { position: fixed; inset: 0; background: rgba(15, 18, 25, .72); display: flex; align-items: center; justify-content: center; z-index: 200; }
.auth-overlay.hidden { display: none; }
.auth-box { background: #fff; border-radius: 12px; padding: 26px 30px; width: 380px; max-width: calc(100vw - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.auth-box h2 { margin: 0 0 6px; font-size: 20px; color: #111b21; }
.auth-box .hint { margin: 0 0 8px; }
.auth-box .form-row { margin: 14px 0; }
.auth-box label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.auth-box input { width: 100%; box-sizing: border-box; }
.auth-error { color: #c62828; font-size: 13px; }

/* ===== 快捷回复 ===== */
.quick-panel { background: #fff; border: 1px solid #d8dee4; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.quick-panel-head { display: flex; gap: 6px; margin-bottom: 8px; }
.quick-panel-head input { flex: 1; min-width: 0; border: 1px solid #d8dee4; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
#quick-list { max-height: 200px; overflow-y: auto; }
.quick-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.quick-item:hover { background: #f0f2f5; }
.q-shortcut { font-weight: 600; color: #008069; white-space: nowrap; }
.q-msg { color: #555; font-size: 13px; flex: 1; word-break: break-word; }
.quick-empty { color: #999; padding: 10px; text-align: center; font-size: 13px; }
#qr-manage-list { max-height: 280px; overflow-y: auto; }
#qr-manage-list .label-row { gap: 8px; }
.modal-box textarea { width: 100%; }

.msg { position: relative; }
.msg-menu-btn { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(11,20,26,.35); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; opacity: 0; z-index: 3; }
.msg:hover .msg-menu-btn { opacity: 1; }
.msg-menu-btn:hover { background: rgba(11,20,26,.55); }
#msg-menu { position: fixed; z-index: 120; min-width: 158px; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(11,20,26,.28); padding: 6px 0; display: none; }
#msg-menu .msg-menu-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 9px 16px; font-size: 13.5px; color: #111b21; cursor: pointer; }
#msg-menu .msg-menu-item:hover { background: #f0f2f5; }
#msg-menu .msg-menu-sep { height: 1px; background: #e9edef; margin: 5px 10px; }

.task-filters { flex-wrap: wrap; gap: 6px; }
.task-pri { display: inline-block; padding: 0 6px; border-radius: 8px; background: #e74c3c; color: #fff; font-size: 11px; margin-right: 2px; }
.task-status { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
.task-pending { background: #fff3cd; color: #8a6d1a; }
.task-claimed { background: #d6e9ff; color: #1c5fa8; }
.task-done { background: #d9f2e3; color: #1a7a4a; }
.task-ignored { background: #e8eaf0; color: #7a828a; }
.task-suggest { max-width: 340px; }
.task-suggest-text { background: #f7f9fb; border: 1px solid #e3e6ea; border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; font-size: 12px; color: #444; white-space: pre-wrap; word-break: break-word; max-height: 84px; overflow-y: auto; }
.task-group-head td { background: #eef3ef; font-weight: 600; color: #1f3b2c; font-size: 12px; padding: 5px 9px; }
.blast-tpl-item { border: 1px solid #e4ece6; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.blast-tpl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.blast-tpl-body { font-size: 13px; color: #444; white-space: pre-wrap; word-break: break-word; }
.blast-filter-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.blast-label-wrap { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid #e1e8e4; border-radius: 8px; background: #fafcfb; }
.blast-label-picker { display: flex; flex-wrap: wrap; gap: 6px 12px; max-height: 138px; overflow-y: auto; padding: 2px 0 6px; }
.blast-label-option { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #dbe5df; border-radius: 999px; background: #fff; font-size: 12px; color: #2f4b3b; }
.blast-label-option input { margin: 0; }
.blast-label-option small { color: #7b8790; }
.blast-row-ex { opacity: .55; }
.blast-st-pending td { color: #777; }
.blast-st-sent td { color: #1a7a4a; }
.blast-st-failed td { color: #c0392b; }
.blast-st-skipped td { color: #b7791f; }
.lbl-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; margin: 1px 2px; border: 1px solid #dde5df; }

.us-clock { font-size: 12px; color: #4a7fb5; margin-right: 12px; white-space: nowrap; }
.time-us { color: #8a97a5; font-size: 11px; margin-left: 6px; }
.msg .meta .time-us { margin-left: 5px; }

.match-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.match-summary-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1f3b2c; }
.match-summary .match-badge { vertical-align: middle; }
.match-summary .mini-btn { flex: none; }
.match-x { border: none; background: transparent; color: #8696a0; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 4px; flex: none; }
.match-x:hover { color: #a52a2a; background: #fdecec; }
.match-x-row { align-self: center; margin-left: 4px; }
.match-cand-wrap { display: inline-flex; align-items: center; gap: 2px; margin: 2px 6px 2px 0; vertical-align: middle; }
.match-cand-wrap .match-cand { margin: 0; }
.match-cand-wrap .match-x { font-size: 12px; padding: 1px 4px; }
.match-collapse-row { margin-top: 6px; text-align: right; }
.match-hidden-all { color: #8a5a2b; background: #fdf6ec; border-color: #ecd9bd; }

.ops-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.ops-card { flex: 1 1 130px; min-width: 120px; background: #fff; border: 1px solid #e4ece6; border-radius: 10px; padding: 12px 14px; text-align: center; }
.ops-num { font-size: 24px; font-weight: 700; color: #1a7a4a; }
.ops-label { font-size: 12px; color: #54656f; margin-top: 4px; }
.ops-chart { min-width: 0; margin-top: 12px; }
.ops-chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; width: 100%; max-width: 620px; margin: 0 0 8px; color: #54656f; font-size: 12px; }
.ops-chart-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ops-chart-legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.ops-chart-scroll { width: 100%; max-width: 620px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-gutter: stable; }
.ops-chart-svg { display: block; width: 100%; max-width: 620px; height: auto; }
.ops-chart-plot-bg { fill: #fbfcfd; }
.ops-chart-grid { stroke: #e5eaee; stroke-width: 1; shape-rendering: crispEdges; }
.ops-chart-axis { stroke: #94a3ad; stroke-width: 1; shape-rendering: crispEdges; }
.ops-chart-tick { fill: #667781; font-size: 11px; }
.ops-chart-bar { transition: opacity .15s; }
.ops-chart-bar:hover { opacity: .82; }
.ops-chart-value { fill: #44535c; font-size: 10px; font-weight: 600; pointer-events: none; }
.ops-chart-label { fill: #54656f; font-size: 11px; }
.ops-chart-axis-title { fill: #3b4a54; font-size: 11px; font-weight: 600; }
.ops-chart-empty { padding: 28px 12px; text-align: center; border: 1px dashed #dbe2e7; border-radius: 8px; background: #fafbfc; color: #7b8790; font-size: 13px; }
.blast-progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.blast-progress-label { flex: none; color: #3b4a54; font-size: 12px; font-weight: 600; }
.blast-progress-track { flex: 1 1 240px; min-width: 160px; height: 10px; overflow: hidden; border-radius: 999px; background: #e7ecef; }
.blast-progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #17795e, #3e9f82); transition: width .25s; }
.blast-progress-text { color: #54656f; font-size: 12px; white-space: nowrap; }
.blast-send-summary { margin: 10px 0 12px; padding: 10px 12px; border: 1px solid #dce6ea; border-radius: 8px; background: #f7f9fa; }
.blast-send-preview { color: #263942; font-size: 13px; font-weight: 600; }
.blast-tpl-preview { margin-top: 5px; line-height: 1.45; }
.badge-new { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #1a7a4a; color: #fff; font-size: 12px; }
.badge-old { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #4a7fb5; color: #fff; font-size: 12px; }
.deal-history { margin-top: 14px; border-top: 1px dashed #dfe4e9; padding-top: 10px; }
.deal-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid #f0f2f5; }
.faq-tab-btn.active { background: #1a7a4a; color: #fff; border-color: #1a7a4a; }
.ops-subtabs { display: flex; gap: 8px; }
.ops-sub-btn.active { background: #1a7a4a; color: #fff; border-color: #1a7a4a; }
.faq-card { background: #fff; border: 1px solid #e4ece6; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.faq-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.faq-src { font-size: 12px; font-weight: 600; color: #b45309; background: #fdf6ec; border: 1px solid #ecd9bd; padding: 1px 8px; border-radius: 10px; }
.faq-label { display: block; font-size: 12px; color: #54656f; margin-bottom: 8px; }
.faq-label input, .faq-label textarea { display: block; width: 100%; margin-top: 4px; box-sizing: border-box; font-size: 13px; }
.faq-label textarea { resize: vertical; }
.faq-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.faq-approve { background: #1a7a4a; color: #fff; border: 1px solid #1a7a4a; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.faq-reject { background: #fff; color: #a52a2a; border: 1px solid #d9a5a5; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.faq-entry-del { background: #fff; color: #a52a2a; border: 1px solid #d9a5a5; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px; }

.deal-section { margin-bottom: 12px; }
.deal-sec-title { font-size: 12px; font-weight: 700; color: #54656f; margin-bottom: 6px; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.deal-grid label { display: flex; flex-direction: column; font-size: 12px; color: #54656f; gap: 4px; }
.deal-grid input, .deal-grid select { box-sizing: border-box; width: 100%; font-size: 13px; }
.deal-grid-wide { grid-column: 1 / -1; }
.deal-preview-box { background: #f7f9fb; border: 1px solid #e4ece6; border-radius: 10px; padding: 12px; margin: 10px 0; }
.deal-pv-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: #3b4a54; }
.deal-pv-total { border-top: 1px dashed #cfd8dd; margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.deal-pv-pos { color: #1a7a4a; }
.deal-pv-neg { color: #a52a2a; }
.deal-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.deal-row-main { flex: 1; min-width: 0; word-break: break-word; }
.deal-row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.deal-chan { display: inline-block; font-size: 11px; background: #eaf5ee; color: #1a7a4a; border: 1px solid #cfe3d4; border-radius: 10px; padding: 1px 8px; margin-right: 4px; }
.deal-profit { font-weight: 600; color: #b45309; white-space: nowrap; }

@media (max-width: 760px) {
  .ops-chart-legend { gap: 6px 12px; }
  .ops-chart-scroll { margin-right: -4px; padding-bottom: 8px; }
  .blast-progress-track { flex-basis: 100%; order: 3; }
  .blast-progress-text { margin-left: auto; }
}

