/* 美洽风格客服工作台 */
.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;
}
.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; }
/* 工作台视角：访客左白泡，客服右黄泡（美洽风格） */
.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-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; }
