.chat-dock {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(548px, calc(100% - 28px));
  transform: translateX(-50%);
  color: #526173;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.chat-dock__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 5px;
  font-size: 11px;
  letter-spacing: .025em;
}
.chat-dock__meta > span { display: inline-flex; align-items: center; gap: 7px; color: #33465b; font-weight: 650; }
.chat-dock__meta > span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3d9fc1; box-shadow: 0 0 0 3px #3d9fc125; }
.chat-dock__meta > div { display: flex; align-items: center; gap: 15px; }
.chat-dock__meta button { border: 0; padding: 2px 0; background: none; color: #697789; font-size: 11px; cursor: pointer; transition: color .2s ease; }
.chat-dock__meta button:hover { color: #173b85; }
.chat-dock__form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 7px 8px 7px 18px;
  border: 1px solid #d9dfe5;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 12px 32px #23384c12, 0 2px 7px #23384c08;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.chat-dock__form:focus-within { border-color: #8ba8ca; box-shadow: 0 12px 32px #23384c16, 0 0 0 3px #8ba8ca25; }
.chat-dock__form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #243449; font-size: 14px; }
.chat-dock__form input::placeholder { color: #9aa5b1; }
.chat-dock__form button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 11px; background: #173b85; color: #fff; font-size: 23px; line-height: 1; transition: background .2s ease, transform .2s ease; }
.chat-dock__form button:hover:not(:disabled) { background: #0c2a69; transform: translateX(2px); }
.chat-dock__form button:disabled { opacity: .45; cursor: default; }
.chat-dock__history { margin-bottom: 11px; padding: 14px; border: 1px solid #d9dfe5; border-radius: 16px; background: #fff; box-shadow: 0 14px 38px #23384c1c; }
.chat-dock__history[hidden] { display: none; }
.chat-dock__verification { margin-bottom: 11px; padding: 15px 17px; border: 1px solid #d9dfe5; border-radius: 16px; background: #fff; box-shadow: 0 14px 38px #23384c1c; }
.chat-dock__verification[hidden] { display: none; }
.chat-dock__verification-head { display: flex; align-items: center; justify-content: space-between; color: #243449; font-size: 13px; }
.chat-dock__verification-head button { border: 0; background: none; color: #697789; font-size: 22px; line-height: 1; cursor: pointer; }
.chat-dock__verification p { margin: 7px 0 12px; color: #697789; font-size: 11px; }
.chat-dock__verification form { display: flex; align-items: center; gap: 9px; }
.chat-dock__verification img { width: 180px; height: 54px; object-fit: contain; }
.chat-dock__verification input { min-width: 0; width: 80px; padding: 8px; border: 1px solid #d9dfe5; border-radius: 8px; font-size: 12px; }
.chat-dock__verification form button { padding: 8px 12px; border: 0; border-radius: 8px; background: #173b85; color: #fff; cursor: pointer; }
.chat-dock__history-head { display: flex; justify-content: space-between; gap: 12px; padding: 0 3px 10px; color: #34445a; font-size: 12px; }
.chat-dock__history-head span { color: #8894a0; font-size: 10px; }
.chat-dock__history-list { display: grid; gap: 8px; max-height: min(32vh, 270px); overflow: auto; }
.chat-dock__record { display: grid; gap: 4px; padding: 9px 11px; border: 1px solid #ebeff2; border-radius: 10px; background: #f8fafb; font-size: 12px; }
.chat-dock__record.is-user { border-color: #dfeaf4; background: #edf4fa; }
.chat-dock__record small { color: #789; font-size: 10px; }
.chat-dock__record p { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }
.chat-dock__record a { color: #126a99; font-size: 11px; text-decoration: underline; }
.chat-dock__replies { position: absolute; bottom: calc(100% + 15px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; max-height: 38vh; overflow: auto; pointer-events: none; scrollbar-width: none; }
.chat-dock__replies::-webkit-scrollbar { display: none; }
.chat-dock__replies.is-fading { opacity: 0; transform: translateY(-8px); transition: opacity .7s, transform .7s; }
.chat-bubble { max-width: 94%; padding: 10px 14px; border: 1px solid #dce3e9; border-radius: 15px 15px 15px 5px; background: #fff; box-shadow: 0 8px 24px #23384c14; color: #324254; font-size: 13px; line-height: 1.55; text-align: left; overflow-wrap: anywhere; animation: bubble-in .38s cubic-bezier(.2,.8,.2,1) both; }
.chat-bubble.is-user { border-color: #173b85; border-radius: 15px 15px 5px 15px; background: #173b85; color: #fff; }
.chat-bubble.is-thinking { color: #536b82; }
.chat-source { display: inline-flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; font-size: 11px; }
.chat-source a { padding: 4px 7px; border: 1px solid #dce3e9; border-radius: 7px; background: #fff; text-decoration: underline; }
.chat-dock button:focus-visible, .site-header a:focus-visible { outline: 2px solid #175aab; outline-offset: 3px; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .chat-dock { bottom: max(9px, env(safe-area-inset-bottom)); }
  .chat-dock__meta { gap: 7px; font-size: 10px; }
  .chat-dock__meta > div { gap: 9px; }
  .chat-dock__meta button { font-size: 10px; }
  .chat-dock__form { min-height: 52px; padding-left: 14px; }
  .chat-dock__form input { font-size: 13px; }
  .chat-dock__form button { width: 37px; height: 37px; }
}
@media (prefers-reduced-motion: reduce) { .chat-bubble { animation: none; } }
