/* 客服聊天组件 · Customer Service Widget */
.ar-cs-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  background: var(--navy, #1a2b4a);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  z-index: 9998;
  transition: transform .15s ease;
}
.ar-cs-fab:hover { transform: scale(1.06); }
.ar-cs-fab .ar-cs-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e5484d;
  border: 2px solid #fff;
  display: none;
}

.ar-cs-panel {
  position: fixed;
  right: 22px;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 44px);
  height: 480px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-size: 14px;
}
.ar-cs-panel.open { display: flex; }

.ar-cs-head {
  background: var(--navy, #1a2b4a);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ar-cs-head .t { font-weight: 700; }
.ar-cs-head .s { font-size: 12px; opacity: .75; margin-top: 2px; }
.ar-cs-close {
  background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; line-height: 1;
}

.ar-cs-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ar-cs-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  line-height: 1.55;
  word-break: break-word;
}
.ar-cs-msg a { color: #1a5fb4; }
.ar-cs-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e4e8ee;
  border-bottom-left-radius: 3px;
}
.ar-cs-msg.user {
  align-self: flex-end;
  background: var(--navy, #1a2b4a);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.ar-cs-msg .q {
  display: block;
  font-size: 12px;
  opacity: .7;
  margin-bottom: 4px;
}

.ar-cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #eef1f5;
}
.ar-cs-chip {
  border: 1px solid var(--navy, #1a2b4a);
  color: var(--navy, #1a2b4a);
  background: #fff;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.ar-cs-chip:hover { background: var(--navy, #1a2b4a); color: #fff; }

.ar-cs-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #eef1f5;
}
.ar-cs-inputbar input {
  flex: 1;
  border: 1px solid #dfe4ec;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
}
.ar-cs-inputbar button {
  border: none;
  background: var(--navy, #1a2b4a);
  color: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}

/* 离线留言表单 */
.ar-cs-form {
  padding: 12px;
  background: #fff;
  border-top: 1px solid #eef1f5;
  display: none;
  flex-direction: column;
  gap: 8px;
  max-height: 60%;
  overflow-y: auto;
}
.ar-cs-form.open { display: flex; }
.ar-cs-form input, .ar-cs-form textarea {
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.ar-cs-form textarea { resize: vertical; min-height: 64px; }
.ar-cs-form .row { display: flex; gap: 8px; }
.ar-cs-form .row button {
  flex: 1; border-radius: 8px; padding: 9px; cursor: pointer; font-size: 14px;
}
.ar-cs-submit { border: none; background: var(--navy, #1a2b4a); color: #fff; }
.ar-cs-cancel { border: 1px solid #dfe4ec; background: #fff; color: #555; }
.ar-cs-ok { color: #1a7f37; font-size: 13px; display: none; }

.ar-cs-foot {
  padding: 6px 12px;
  background: #fff;
  border-top: 1px solid #eef1f5;
  font-size: 11px;
  color: #9aa3b2;
  text-align: center;
}

@media (max-width: 480px) {
  .ar-cs-panel { right: 12px; bottom: 84px; width: calc(100vw - 24px); }
  .ar-cs-fab { right: 14px; bottom: 14px; }
}
