

body.visitor-page {
  --brand: #1989FA;
  --brand-deep: #0F6FE0;
  --brand-soft: rgba(25,137,250,.12);
  --brand-rgb: 25, 137, 250;
  --user-bubble-a: #56A8FF;
  --user-bubble-b: #1989FA;
  --page-bg: #F4F5F7;
  --header-bg: #FFFFFF;
  --text-main: #1F2329;
  --text-sub: #9AA0A8;
}

html, body { height: 100%; }
body {
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.vc-app {
  height: var(--app-h, 100vh);
  display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto;
  background: var(--page-bg);
  position: relative;
}

.vc-header {
  flex: 0 0 54px; display: flex; align-items: center;
  background: var(--header-bg);
  padding: 0 6px;
  border-bottom: 1px solid #EDEEF0;
  position: relative; z-index: 20;
}
.vc-header .icon-btn { color: #3D3F45; }
.vc-header .icon-btn:hover { background: rgba(0,0,0,.05); }
.vc-title {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  text-align: left;
}

.vc-kf-av {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #5BA8FF, var(--brand-deep));
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.vc-kf-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.vc-kf-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1.2; }
.vc-kf-av.hidden { display: none; }

.vc-brand {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 0; max-width: none;
  font-size: clamp(14px, 4.2vw, 17px); font-weight: 600; color: #1F2329;
  line-height: 1.15;
}
.vc-brand-name {
  min-width: 0; white-space: nowrap; overflow: visible; text-overflow: clip;
}

.vc-official {
  flex: 0 0 auto;
  height: 12px; line-height: 12px; padding: 0 5px;
  border-radius: 3px; background: #FCEFC7; color: #8A6A16;
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  white-space: nowrap;
}
.vc-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #FA5151; color: #fff; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.vc-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #888;
}
.vc-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
}

.vc-status.online::before { background: #07c160; }
.vc-status.busy::before { background: #C58B00; }
.vc-status.offline::before { background: #FA5151; }
.vc-status.off::before { background: #bbb; }
.vc-actions { display: flex; align-items: center; }

.vc-menu {
  position: absolute; top: 48px; right: 10px; z-index: 50;
  background: #fff; border-radius: 12px; min-width: 190px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  overflow: hidden; padding: 6px;
}
.vc-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: none; padding: 11px 12px; border-radius: 8px;
  font-size: 14px; color: #333; text-align: left; cursor: pointer;
}
.vc-menu-item:hover { background: #f4f5f7; }
.vc-menu-ico { width: 22px; height: 22px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: #5b6470; }
.vc-menu-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vc-menu-state { margin-left: auto; font-size: 12px; color: var(--brand); }
.vc-menu-info { cursor: default; }
.vc-menu-info:hover { background: none; }

.vc-msgs {
  flex: 1; overflow-y: auto; padding: 16px 14px 10px;
  -webkit-overflow-scrolling: touch;
}
.vc-msgs::-webkit-scrollbar { width: 0; }

.vc-sys {
  text-align: center; font-size: 12px; color: #8B929A;
  background: rgba(0,0,0,.04); border-radius: 6px;
  padding: 4px 10px; margin: 8px auto; width: fit-content; max-width: 86%;
  line-height: 1.6;
}

.vc-time {
  text-align: center; font-size: 11px; color: #B0B6BE;
  margin: 12px 0 6px;
}

.vc-row { display: flex; margin-bottom: 14px; align-items: flex-start; }
.vc-row.me { flex-direction: row-reverse; }

.vc-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #5BA8FF, var(--brand-deep));
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.vc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-row.me .vc-avatar { display: none; }

.vc-body { max-width: 76%; margin: 0 10px; min-width: 0; }
.vc-row.me .vc-body { display: flex; flex-direction: column; align-items: flex-end; }
.vc-row.other .vc-body { display: flex; flex-direction: column; align-items: flex-start; }

.vc-nick {
  font-size: 11px; color: #9AA0A8; margin: 0 0 4px 4px;
}

.vc-bubble {
  padding: 10px 13px; border-radius: 10px;
  font-size: 15px; line-height: 1.5; word-break: break-word;
  white-space: pre-wrap;
}
.vc-row.other .vc-bubble {
  background: #fff; color: #1F2329;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.vc-row.me .vc-bubble {
  background: linear-gradient(135deg, var(--user-bubble-a), var(--user-bubble-b));
  color: #fff;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 3px rgba(var(--brand-rgb),.22);
}
.vc-row.me .vc-bubble a { color: #EAF4FF; text-decoration: underline; }
.vc-bubble a { color: var(--brand-deep); text-decoration: underline; }

.vc-imgbubble { display: block; padding: 0; overflow: hidden; border-radius: 10px; background: #fff; }
.vc-imgbubble img { display: block; max-width: 210px; max-height: 280px; object-fit: cover; }
.vc-imgbubble img[data-state="loading"] { min-width: 120px; min-height: 90px; background: #ECECEC; }
.vc-imgbubble img[data-state="error"] { min-width: 140px; min-height: 100px; background: #F3F3F3; object-fit: contain; }

.vc-videobubble { display: block; padding: 0; overflow: hidden; border-radius: 10px; background: #000; }
.vc-videobubble video { display: block; max-width: 230px; max-height: 300px; }

.vc-withdrawn { color: #B0B6BE; font-size: 13px; background: rgba(0,0,0,.03); }

.vc-read { font-size: 11px; color: #B0B6BE; margin-top: 3px; }
.vc-read.read { color: var(--brand); }

.vc-quickbar {
  display: flex; gap: 8px; padding: 8px 12px 2px;
  background: var(--page-bg); overflow-x: auto; flex: 0 0 auto;
}
.vc-quickbar::-webkit-scrollbar { display: none; }
.vc-quick {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  border: none; background: #fff; color: #333;
  border-radius: 16px; padding: 6px 13px; font-size: 13px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  cursor: pointer; white-space: nowrap;
}
.vc-quick:active { background: #F0F1F2; }
.vc-quick .q-ico { font-size: 14px; }

.vc-inputwrap {
  flex: 0 0 auto; background: #fff;
  border-top: 1px solid #E6E7E8;
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
}
.vc-inputbar {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px;
}
.ico-btn {
  width: 36px; height: 36px; flex: 0 0 auto;
  border: none; background: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #4A5058; font-size: 24px;
}
.ico-btn:active { background: #F0F1F2; }
.vc-inner { flex: 1; min-width: 0; }
.vc-input {
  width: 100%; border: none; background: #F0F1F2; border-radius: 8px;
  padding: 9px 12px; font-size: 16px; line-height: 1.4; outline: none;
  resize: none; max-height: 96px; min-height: 38px; box-sizing: border-box;
  font-family: inherit; color: #1F2329;
}
.vc-input:focus { background: #fff; box-shadow: 0 0 0 1.5px var(--brand-soft); }
.vc-input::placeholder { color: #B0B6BE; }
.vc-send {
  flex: 0 0 auto; height: 38px; padding: 0 20px;
  border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--user-bubble-a), var(--brand));
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: 0 2px 6px rgba(var(--brand-rgb),.28);
}
.vc-send:active { background: var(--brand-deep); }
.vc-send.disabled { background: #D8DDE3; color: #fff; cursor: not-allowed; box-shadow: none; }

.vc-send.is-loading { position: relative; opacity: .88; color: transparent !important; pointer-events: none; }
.vc-send.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: vcSpin .65s linear infinite;
}

.vc-sending-tip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #9AA1A9; margin-top: 4px; }
.vc-sending-tip.fail { color: #FA5151; }
.vc-tip-spin {
  width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid #D5D9DD; border-top-color: var(--brand);
  animation: vcSpin .65s linear infinite;
}
.vc-tip-ico { font-weight: 700; }
.vc-row[data-pending="1"] .vc-bubble { opacity: .7; }
@keyframes vcSpin { to { transform: rotate(360deg); } }

.vc-pop {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 12;
  background: #fff; border-top: 1px solid #EEF0F1;
  border-radius: 14px 14px 0 0; padding: 8px 12px 18px;
  box-shadow: 0 -6px 24px rgba(0,0,0,.07);
}
.vc-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 10px;
}
.vc-pop-title { font-size: 13px; font-weight: 600; color: #5A6068; }
.vc-pop-close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #F2F3F5; color: #5A6068; font-size: 14px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.vc-pop-close:active { background: #E6E8EB; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-cell {
  font-size: 24px; text-align: center; padding: 6px 0; border-radius: 8px; cursor: pointer;
}
.emoji-cell:active { background: #F2F3F5; }

.vc-more {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 12;
  background: #fff; border-top: 1px solid #EEF0F1;
  border-radius: 14px 14px 0 0; padding: 8px 16px 22px;
  box-shadow: 0 -6px 24px rgba(0,0,0,.07);
}
.vc-more-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 10px;
}
.vc-more-title { font-size: 13px; font-weight: 600; color: #5A6068; }
.vc-more-close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #F2F3F5; color: #5A6068; font-size: 14px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.vc-more-close:active { background: #E6E8EB; }
.vc-more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vc-more-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: none; background: none; padding: 0; cursor: pointer; color: #333; font-size: 12px;
}
.vc-more-item:active { opacity: .6; }
.vc-more-ico {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
}

.vc-preview {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
}
.vc-preview img { max-width: 94vw; max-height: 88vh; border-radius: 6px; }
.vc-preview video { max-width: 94vw; max-height: 88vh; border-radius: 6px; }
.vc-preview-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.16); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}

.vc-header {
  min-height: 56px; padding: 6px 10px;
  border-bottom: 1px solid rgba(0,0,0,.045);
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.vc-header .icon-btn { width: 34px; height: 34px; border-radius: 8px; }
.vc-kf-av { width: 34px; height: 34px; }
.vc-kf-meta { padding-right: 4px; }
.vc-status { font-size: 11px; line-height: 1.1; }

.vc-msgs { padding: 14px 12px 8px; }
.vc-row { margin-bottom: 12px; }
.vc-row:last-child { margin-bottom: 2px; }

.vc-inputwrap { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.vc-inputbar { align-items: flex-end; }
.vc-inner { border-radius: 10px; }
.vc-send { min-width: 62px; height: 36px; border-radius: 8px; font-size: 15px; }

@media (min-width: 720px) {
  .vc-app { border-left: 1px solid #E6E7E8; border-right: 1px solid #E6E7E8; box-shadow: 0 0 40px rgba(0,0,0,.06); }
}

.vc-row.other .vc-body { display: flex; flex-direction: column; align-items: flex-start; }
.vc-msg-meta {
  display: flex; align-items: center; gap: 5px;
  margin: 0 0 5px 3px; max-width: 100%; min-width: 0;
}
.vc-msg-name {
  font-size: 12px; font-weight: 600; color: #8A9099;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-msg-meta .vc-official { height: 14px; line-height: 14px; font-size: 10px; padding: 0 5px; }

.vc-row.other .vc-bubble { border-top-left-radius: 10px; }

.quote-blue { color: #1a7fe0; font-weight: 600; cursor: pointer; word-break: break-all; }
.quote-blue:active { opacity: .65; }
.vc-bubble.me .quote-blue { color: #d9f2ff; }
.vc-bubble .quote-blue:hover { text-decoration: underline; }

.vc-bubble .chat-link { color: #1a7fe0; text-decoration: underline; word-break: break-all; }
.vc-bubble.me .chat-link { color: #d9f2ff; }

body.visitor-page .vc-mute-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #FA5151; color: #fff; font-size: 13px; font-weight: 700; line-height: 1;
}
body.visitor-page .vc-sysline {
  text-align: center; font-size: 12px; color: #9AA1A9;
  padding: 6px 24px; line-height: 1.6;
}

body.visitor-page .vc-waitbar {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  color: #8B929A;
  background: rgba(0, 0, 0, .04);
  padding: 7px 12px;
  line-height: 1.5;
}

body.visitor-page .vc-auth {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20, 24, 30, .48);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
body.visitor-page .vc-auth-card {
  width: 100%; max-width: 340px; background: #fff; border-radius: 16px;
  padding: 24px 20px 18px; box-shadow: 0 14px 40px rgba(0,0,0,.22);
  display: flex; flex-direction: column; gap: 11px;
}
body.visitor-page .vc-auth-title { font-size: 18px; font-weight: 700; color: #1b1b1b; text-align: center; }
body.visitor-page .vc-auth-sub { font-size: 12.5px; color: #8B929A; text-align: center; margin-top: -5px; line-height: 1.6; }
body.visitor-page .vc-auth-tabs { display: flex; background: #f1f3f5; border-radius: 10px; padding: 3px; }
body.visitor-page .vc-auth-tab {
  flex: 1; height: 36px; border: none; background: none; border-radius: 8px;
  font-size: 14px; color: #606266; cursor: pointer;
}
body.visitor-page .vc-auth-tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 5px rgba(0,0,0,.1); }
body.visitor-page .vc-auth-input {
  height: 46px; border: 1px solid #e3e5e8; border-radius: 10px; padding: 0 14px;
  font-size: 15px; outline: none; background: #fafbfc; width: 100%; box-sizing: border-box;
}
body.visitor-page .vc-auth-input:focus { border-color: var(--brand); background: #fff; }
body.visitor-page .vc-auth-err {
  font-size: 13px; color: #e64340; background: #fdf0ef; border-radius: 8px;
  padding: 8px 12px; line-height: 1.5;
}
body.visitor-page .vc-auth-btn {
  height: 46px; border: none; border-radius: 10px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
body.visitor-page .vc-auth-btn:active { opacity: .85; }
body.visitor-page .vc-auth-btn[disabled] { opacity: .55; }
body.visitor-page .vc-auth-cancel {
  height: 40px; border: none; background: none; color: #8B929A; font-size: 14px; cursor: pointer;
}
body.visitor-page .vc-auth-tip { font-size: 12px; color: #a8adb5; text-align: center; line-height: 1.6; }
