/* 美洽风格客服工作台 */
.mq-admin-shell { display: flex; height: 100vh; overflow: hidden; background: #eef0f3; }

/* 侧栏：管理页展开，工作台收起 */
.mq-icon-nav {
  width: 200px;
  background: #1f2329;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  flex-shrink: 0;
  z-index: 20;
  transition: width .22s ease;
  overflow: hidden;
}
body.mode-workbench .mq-icon-nav {
  width: 52px;
  align-items: center;
  padding-top: 12px;
}

.mq-icon-nav__brand {
  padding: 18px 16px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #15c292;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
body.mode-workbench .mq-icon-nav__brand {
  display: none;
}

.mq-icon-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 2px 8px;
  padding: 0 12px;
  border-radius: 8px;
  color: #8b9298;
  text-decoration: none;
  font-size: 14px;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}
body.mode-workbench .mq-icon-nav a {
  width: 40px;
  margin: 0 0 4px;
  padding: 0;
  justify-content: center;
  gap: 0;
}
.mq-icon-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mq-icon-nav a.active { background: #15c292; color: #fff; }
.mq-icon-nav a.admin-only { display: none; }
body.is-admin .mq-icon-nav a.admin-only { display: flex; }

.mq-icon-nav__icon {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}
.mq-icon-nav__label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .15s ease;
}
body.mode-workbench .mq-icon-nav__label { display: none; }

.mq-icon-nav__foot {
  margin-top: auto;
  padding: 8px 0 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
}
body.mode-workbench .mq-icon-nav__foot {
  align-items: center;
}
.mq-icon-nav__foot a {
  margin-top: 4px;
}

.mq-content { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mq-content--full { padding: 0 !important; }
.mq-content .main-inner { flex: 1; overflow: auto; padding: 24px; }
body.mode-workbench .main-inner { display: none; }

/* 工作台三栏 */
.wb-panel { display: none; flex: 1; min-height: 0; }
.wb-panel.active { display: flex; }
.wb-conv { width: 300px; background: #fff; border-right: 1px solid #e8eaed; display: flex; flex-direction: column; flex-shrink: 0; }
.wb-conv__head { padding: 14px 16px 10px; border-bottom: 1px solid #e8eaed; }
.wb-conv__head h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.wb-conv__queue {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 12px;
  font-weight: normal;
  color: #ff7875;
}
.wb-conv__empty {
  list-style: none;
  text-align: center;
  padding: 48px 20px;
  color: #bbb;
  cursor: default;
  border: none !important;
  background: transparent !important;
}
.wb-conv__empty-icon { font-size: 40px; opacity: .4; margin-bottom: 8px; }
.wb-conv__empty p { font-size: 14px; color: #999; margin-bottom: 4px; }
.wb-conv__empty span { font-size: 12px; color: #ccc; }
.wb-conv__tabs { display: flex; gap: 0; border-bottom: 1px solid #e8eaed; }
.wb-conv__tabs button {
  flex: 1; padding: 10px 4px; border: none; background: #fff; cursor: pointer; font-size: 13px; color: #666;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wb-conv__tabs button.active { color: #15c292; border-bottom-color: #15c292; font-weight: 500; }
.wb-conv__list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.wb-conv__item {
  padding: 12px 14px; border-bottom: 1px solid #f5f5f5; cursor: pointer; position: relative;
  border-left: 3px solid transparent;
}
.wb-conv__item:hover { background: #fafafa; }
.wb-conv__item.active { background: #f0faf7; border-left-color: #15c292; }
.wb-conv__row { display: flex; align-items: flex-start; gap: 10px; }
.wb-conv__av {
  width: 36px; height: 36px; border-radius: 50%; background: #e8f4ff; color: #1890ff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
  position: relative;
}
.wb-conv__online {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #15c292; border: 2px solid #fff;
  box-sizing: border-box;
}
.wb-conv__region {
  font-size: 11px; color: #8c8c8c; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-conv__note {
  font-size: 11px; color: #fa8c16; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-chat__head-main {
  display: flex; flex-direction: column; min-width: 0; gap: 4px;
}
.wb-chat__meta {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 520px;
}
.wb-chat__region {
  flex-shrink: 0; font-size: 12px; color: #15c292; background: #f0faf7;
  border: 1px solid #b7eb8f; border-radius: 4px; padding: 1px 8px; line-height: 1.6;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-chat__note-input {
  flex: 1; min-width: 140px; height: 26px; border: 1px solid #e8eaed; border-radius: 4px;
  padding: 0 8px; font-size: 12px; color: #333; background: #fff;
}
.wb-chat__note-input:focus {
  outline: none; border-color: #15c292; box-shadow: 0 0 0 2px rgba(21,194,146,.12);
}
.wb-chat__note-hint { font-size: 11px; color: #15c292; flex-shrink: 0; min-width: 3em; }
.wb-notes-card {
  margin: 0 0 16px; padding: 12px; background: #f7fffb; border: 1px dashed #15c292;
  border-radius: 10px;
}
.wb-notes-card__head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.wb-notes-card__title { font-size: 13px; font-weight: 600; color: #15c292; }
.wb-notes-card__hint { font-size: 11px; color: #15c292; }
.wb-notes-card__empty {
  min-height: 56px; display: flex; align-items: center; justify-content: center;
  color: #15c292; font-size: 13px; cursor: pointer; border-radius: 8px;
  background: rgba(21,194,146,.06);
}
.wb-notes-card__empty:hover { background: rgba(21,194,146,.12); }
.wb-notes-card__view {
  min-height: 56px; padding: 8px 10px; font-size: 13px; line-height: 1.5; color: #333;
  white-space: pre-wrap; word-break: break-word; cursor: pointer; border-radius: 8px;
  background: #fff; border: 1px solid #e8eaed;
}
.wb-notes-card__view:hover { border-color: #15c292; }
.wb-notes-card__input {
  width: 100%; box-sizing: border-box; min-height: 88px; resize: vertical;
  border: 1px solid #15c292; border-radius: 8px; padding: 8px 10px; font-size: 13px;
  font-family: inherit; color: #333; line-height: 1.5; background: #fff;
}
.wb-notes-card__input:focus { outline: none; box-shadow: 0 0 0 2px rgba(21,194,146,.15); }
.wb-conv__body { flex: 1; min-width: 0; }
.wb-conv__top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.wb-conv__name { font-size: 14px; color: #333; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-conv__time { font-size: 11px; color: #bbb; flex-shrink: 0; }
.wb-conv__preview { font-size: 12px; color: #999; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-conv__tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.wb-tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #f0f0f0; color: #888; }
.wb-tag--wait { background: #fff1f0; color: #ff4d4f; }
.wb-tag--vip { background: #fff7e6; color: #fa8c16; }
.wb-badge { background: #ff4d4f; color: #fff; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; }

.wb-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f5f6f8; }
.wb-chat__head {
  padding: 12px 20px; background: #fff; border-bottom: 1px solid #e8eaed;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.wb-chat__title { font-size: 15px; font-weight: 600; color: #333; }
.wb-chat__actions { display: flex; gap: 8px; }
.wb-chat__actions button {
  padding: 6px 14px; border-radius: 6px; border: 1px solid #e8eaed; background: #fff;
  cursor: pointer; font-size: 13px; color: #333;
}
.wb-chat__actions button:hover { border-color: #15c292; color: #15c292; }
.wb-chat__actions .wb-btn-danger { color: #ff4d4f; border-color: #ffccc7; }
.wb-chat__actions .wb-btn-danger:hover { background: #fff1f0; }
.wb-chat__typing { padding: 6px 20px; font-size: 12px; color: #999; background: #fff; border-bottom: 1px solid #f0f0f0; }
.wb-chat__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.wb-chat__body .mq-messages { list-style: none; margin: 0; padding: 0; }
.mq-msg__read {
  display: inline-block; font-size: 11px; color: #bbb; margin-top: 0; text-align: right;
  line-height: 1.2;
}
.mq-msg__read.is-read { color: #15c292; }
.wb-chat__body .mq-msg__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0 2px;
}
.wb-chat__body .mq-msg__meta .mq-msg__time { margin-top: 0; }
.wb-chat__body .mq-msg--out .mq-msg__meta { justify-content: flex-end; }
.wb-chat__body .mq-msg--out .mq-msg__read {
  display: inline-block;
  min-width: 2em;
}
/* 工作台视角：访客左白泡，客服右黄泡（美洽风格） */
.wb-chat__body .mq-msg--in .mq-msg__bubble {
  background: #fff; border: 1px solid #e8eaed; color: #333;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.wb-chat__body .mq-msg--out .mq-msg__bubble {
  background: #fff9e6; color: #333; border: 1px solid #ffe58f;
  box-shadow: none;
}
.wb-chat__body .mq-msg--system .mq-msg__bubble {
  background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f;
}

.wb-compose-wrap { background: #fff; border-top: 1px solid #e8eaed; flex-shrink: 0; }
.wb-compose-tabs { display: flex; padding: 0 16px; border-bottom: 1px solid #f0f0f0; }
.wb-compose-tabs button {
  padding: 10px 16px; border: none; background: none; cursor: pointer; font-size: 13px; color: #666;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wb-compose-tabs button.active { color: #15c292; border-bottom-color: #15c292; }
.wb-compose { padding: 8px 12px 12px; }
.wb-compose .mq-footer-compose { margin: 0; }
.wb-compose .mq-toolbar { padding: 0 4px 6px; }
.wb-compose .mq-compose {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  background: #f7f8fa;
  border-radius: 10px;
  padding: 8px 10px 8px 14px;
  border: 1px solid #e8eaed;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wb-compose .mq-compose:focus-within {
  border-color: rgba(21, 194, 146, 0.45);
  box-shadow: 0 0 0 2px rgba(21, 194, 146, 0.12);
  background: #fff;
}
.wb-compose .mq-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.45;
  padding: 8px 4px;
}
.wb-compose .mq-send--wb {
  flex-shrink: 0;
  margin-left: auto;
  min-width: 76px;
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #1ad4a8 0%, #15c292 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(21, 194, 146, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s;
}
.wb-compose .mq-send--wb:hover:not(:disabled) {
  background: linear-gradient(135deg, #2ee0b5 0%, #12b886 100%);
  box-shadow: 0 4px 14px rgba(21, 194, 146, 0.42);
}
.wb-compose .mq-send--wb:active:not(:disabled) { transform: scale(0.96); }
.wb-compose .mq-send--wb:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.wb-side { width: 300px; background: #fff; border-left: 1px solid #e8eaed; display: flex; flex-direction: column; flex-shrink: 0; }
.wb-side__tabs { display: flex; border-bottom: 1px solid #e8eaed; }
.wb-side__tabs button {
  flex: 1; padding: 12px 8px; border: none; background: #fff; cursor: pointer; font-size: 13px; color: #666;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wb-side__tabs button.active { color: #15c292; border-bottom-color: #15c292; font-weight: 500; }
.wb-side__body { flex: 1; overflow-y: auto; padding: 16px; font-size: 13px; }
.wb-side__section { display: none; }
.wb-side__section.active { display: block; }
.wb-side dl { margin-bottom: 14px; }
.wb-side dt { color: #999; font-size: 12px; margin-bottom: 4px; }
.wb-side dd { color: #333; word-break: break-all; line-height: 1.5; }
.wb-online-label { color: #15c292; font-weight: 600; }
.wb-offline-label { color: #bbb; }
.wb-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wb-notes { margin-top: 8px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.wb-notes__label { display: block; color: #999; font-size: 12px; margin-bottom: 6px; }
.wb-notes__input {
  width: 100%; box-sizing: border-box; min-height: 88px; resize: vertical;
  border: 1px solid #e8eaed; border-radius: 8px; padding: 8px 10px; font-size: 13px;
  font-family: inherit; color: #333; line-height: 1.5;
}
.wb-notes__input:focus { outline: none; border-color: #15c292; box-shadow: 0 0 0 2px rgba(21,194,146,.15); }
.wb-notes__save {
  margin-top: 8px; padding: 6px 14px; border-radius: 6px; border: none;
  background: #15c292; color: #fff; font-size: 13px; cursor: pointer;
}
.wb-notes__save:hover:not(:disabled) { background: #12b886; }
.wb-notes__save:disabled { opacity: .55; cursor: not-allowed; }
.wb-notes__hint { display: inline-block; margin-left: 8px; font-size: 12px; color: #15c292; }
.wb-quick-list { list-style: none; margin: 0; padding: 0; }
.wb-quick-list li {
  padding: 10px 12px; border: 1px solid #e8eaed; border-radius: 8px; margin-bottom: 8px;
  cursor: pointer; font-size: 13px;
}
.wb-quick-list li:hover { border-color: #15c292; background: #f0faf7; }
.wb-quick-list strong { display: block; color: #333; margin-bottom: 4px; }
.wb-quick-list span { color: #999; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-empty { text-align: center; color: #bbb; padding: 48px 20px; font-size: 14px; }

@media (max-width: 1100px) { .wb-side { display: none; } }
@media (max-width: 768px) {
  .wb-conv { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; transform: none; box-shadow: none; width: 100%; }
  .wb-menu-btn { display: none !important; }
}
.wb-menu-btn { display: none; margin-right: 8px; padding: 4px 10px; border: 1px solid #e8eaed; background: #fff; border-radius: 6px; cursor: pointer; align-items: center; }

/* ===== WORKBENCH_RICH_MESSAGE_CSS_START ===== */

/* 富文本消息正文 */
.mq-msg__bubble--rich {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 可选的气泡上方说明 */
.mq-msg__header {
  display: block;
  margin: 0 0 5px;
  color: #888;
  font-size: 12px;
  line-height: 1.45;
}

/* 链接卡片 */
.mq-link-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.09);
}

.mq-link-row__label {
  margin-bottom: 8px;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
}

.mq-link-row__body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mq-link-row__url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #1890ff;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mq-link-row__url:hover {
  text-decoration: underline;
}

.mq-link-row__copy {
  flex: 0 0 auto;
  min-width: 54px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: #1890ff;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.mq-link-row__copy:active {
  transform: scale(.97);
}

.mq-link-row__copy.is-copied {
  background: #15c292;
}

/* FAQ 在客服端仅作查看 */
.mq-msg__bubble--faq {
  white-space: normal;
}

.mq-faq__title {
  margin: 0 0 8px;
  font-size: 13px;
}

.mq-faq-item--view {
  padding: 7px 0;
  border-top: 1px solid rgba(0,0,0,.08);
  color: #333;
  font-size: 13px;
  line-height: 1.45;
}

.mq-faq-item__num {
  color: #1890ff;
}

/* 手机端 */
@media (max-width: 768px) {
  .mq-msg__bubble--rich {
    max-width: 100%;
  }

  .mq-link-row__body {
    gap: 7px;
  }

  .mq-link-row__url {
    font-size: 12px;
  }

  .mq-link-row__copy {
    min-width: 48px;
    height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* ===== WORKBENCH_RICH_MESSAGE_CSS_END ===== */
