:root {
  --ink: #14213d;
  --ink-soft: #536078;
  --muted: #7c879c;
  --paper: #f6f7fb;
  --white: #ffffff;
  --blue: #246bfd;
  --blue-dark: #1554d4;
  --blue-pale: #eaf0ff;
  --mint: #37cbb0;
  --line: #e4e8f1;
  --shadow: 0 24px 70px rgba(25, 45, 95, 0.13);
  --radius: 24px;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 4% 2%, rgba(121, 161, 255, 0.14), transparent 24rem),
    radial-gradient(circle at 92% 12%, rgba(74, 220, 190, 0.12), transparent 23rem),
    var(--paper);
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.page-glow--one {
  top: 28rem;
  left: -28rem;
  background: rgba(53, 112, 255, 0.08);
}

.page-glow--two {
  top: 56rem;
  right: -28rem;
  background: rgba(74, 213, 186, 0.07);
}

.site-header {
  width: min(1220px, calc(100% - 64px));
  height: 104px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border: 1px solid rgba(36, 107, 253, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(37, 86, 195, 0.1);
}

.brand-mark svg {
  width: 31px;
  height: 31px;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand small {
  color: #9aa3b6;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  color: #536078;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--blue);
}

.nav-contact {
  min-width: 132px;
  height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(32, 52, 92, 0.05);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.nav-contact:hover {
  border-color: #bdcaf4;
  transform: translateY(-1px);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(55, 203, 176, 0.11);
}

.hero {
  width: min(1220px, calc(100% - 64px));
  min-height: 610px;
  margin: 22px auto 40px;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 74px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-left: 10px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: #4c668c;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(55, 203, 176, 0.12);
}

.hero h1 {
  max-width: 560px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(54px, 5.5vw, 80px);
  line-height: 1.07;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.hero h1 span {
  display: block;
  color: var(--blue);
  position: relative;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 40px;
  bottom: -4px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(36, 107, 253, 0.14), transparent);
  transform: rotate(-1.5deg);
}

.hero-lead {
  max-width: 490px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 34px;
}

.primary-button {
  height: 56px;
  min-width: 160px;
  padding: 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #3379ff, #1e5fe7);
  box-shadow: 0 16px 28px rgba(36, 107, 253, 0.22);
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.primary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(36, 107, 253, 0.28);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #67738a;
  font-size: 14px;
  font-weight: 600;
}

.text-link span {
  font-size: 16px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 21px;
  margin-top: 34px;
  color: #7b8699;
  font-size: 12px;
}

.trust-row > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row svg {
  width: 16px;
  height: 16px;
  padding: 2px;
  color: #4ba994;
  background: #e9f8f3;
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-visual {
  min-height: 548px;
  position: relative;
  display: grid;
  place-items: center;
}

.visual-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(88, 121, 183, 0.1);
}

.visual-orbit--one {
  width: 540px;
  height: 540px;
}

.visual-orbit--two {
  width: 430px;
  height: 430px;
  border-style: dashed;
  transform: rotate(25deg);
}

.preview-window {
  width: min(420px, 90%);
  padding: 0 0 18px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.83);
  box-shadow:
    0 35px 80px rgba(33, 56, 113, 0.16),
    inset 0 0 0 1px rgba(222, 229, 244, 0.7);
  backdrop-filter: blur(18px);
  transform: rotate(-1.2deg);
}

.preview-topbar {
  height: 82px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eef1f6;
  background: rgba(255, 255, 255, 0.74);
}

.preview-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(140deg, #4c8dff, #1559df);
  border-radius: 14px;
  box-shadow: 0 7px 15px rgba(36, 107, 253, 0.2);
}

.avatar svg {
  width: 86%;
  height: 86%;
}

.avatar--support {
  width: 43px;
  height: 43px;
}

.avatar--large {
  width: 46px;
  height: 46px;
  border-radius: 15px;
}

.preview-person div {
  display: grid;
  gap: 5px;
}

.preview-person strong {
  font-size: 14px;
}

.preview-person small {
  color: #8b95a8;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.preview-person small i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}

.preview-topbar button {
  padding: 8px;
  display: flex;
  gap: 3px;
  border: 0;
  background: none;
}

.preview-topbar button span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a5adbb;
}

.preview-body {
  height: 310px;
  padding: 22px;
  background:
    radial-gradient(circle at 10% 90%, rgba(221, 232, 255, 0.36), transparent 45%),
    #f8f9fc;
}

.preview-date {
  margin-bottom: 16px;
  color: #a7afbd;
  font-size: 10px;
  text-align: center;
}

.mini-message {
  width: fit-content;
  max-width: 78%;
  padding: 12px 15px;
  margin-bottom: 11px;
  border-radius: 7px 17px 17px 17px;
  background: #fff;
  color: #4d596d;
  box-shadow: 0 5px 16px rgba(39, 53, 85, 0.06);
  font-size: 12px;
  line-height: 1.65;
}

.mini-message--user {
  margin-left: auto;
  color: #fff;
  background: #246bfd;
  border-radius: 17px 7px 17px 17px;
  box-shadow: 0 7px 17px rgba(36, 107, 253, 0.17);
}

.typing-bubble {
  width: 54px;
  height: 30px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 7px 14px 14px 14px;
  background: #fff;
}

.typing-bubble i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9ca8bc;
  animation: typing 1.3s infinite ease-in-out;
}

.typing-bubble i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-bubble i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  35% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.preview-notice {
  margin: 0 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, #2e75ff, #175ce7);
  border-radius: 15px;
  box-shadow: 0 13px 24px rgba(36, 107, 253, 0.24);
}

.notice-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--blue);
  background: #fff;
  border-radius: 10px;
}

.notice-icon svg {
  width: 19px;
  height: 19px;
}

.preview-notice > span:nth-child(2) {
  display: grid;
  gap: 1px;
}

.preview-notice small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}

.preview-notice strong {
  font-size: 12px;
  font-weight: 600;
}

.notice-arrow {
  width: 16px;
  height: 16px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.78;
}

.float-tag {
  position: absolute;
  z-index: 3;
  min-height: 44px;
  padding: 9px 14px 9px 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4b5669;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(238, 241, 247, 0.9);
  border-radius: 14px;
  box-shadow: 0 13px 30px rgba(38, 54, 92, 0.11);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.float-tag--saved {
  top: 76px;
  right: 3px;
}

.float-tag--privacy {
  bottom: 72px;
  left: -2px;
}

.float-tag > span:first-child {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 9px;
}

.float-tag svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.float-check {
  color: #199a80 !important;
  background: #e8f9f4 !important;
}

.how-section {
  padding: 105px 32px 110px;
  background: #fff;
}

.section-heading {
  max-width: 1040px;
  margin: 0 auto 54px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading > span,
.section-kicker {
  color: #9ba6b9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.section-heading h2,
.questions-copy h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 40px);
  letter-spacing: -0.04em;
}

.steps {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e9edf5;
  border-radius: 25px;
  background: #e9edf5;
}

.steps article {
  min-height: 290px;
  padding: 36px 33px 32px;
  position: relative;
  background: #fff;
}

.step-no {
  position: absolute;
  top: 25px;
  right: 28px;
  color: #d9deea;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.step-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #edf2ff;
  border-radius: 17px;
}

.step-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.steps article:nth-child(2) .step-icon {
  color: #1f9b83;
  background: #e9f9f4;
}

.steps article:nth-child(3) .step-icon {
  color: #7d62db;
  background: #f1edff;
}

.steps h3 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.steps p {
  max-width: 250px;
  margin: 0;
  color: #7d8799;
  font-size: 13px;
  line-height: 1.85;
}

.questions-section {
  width: min(1040px, calc(100% - 64px));
  margin: 0 auto;
  padding: 110px 0 118px;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 105px;
}

.questions-copy h2 {
  margin-top: 15px;
}

.questions-copy p {
  margin: 17px 0 27px;
  color: #7b879a;
  font-size: 14px;
}

.outline-button {
  height: 45px;
  padding: 0 19px;
  color: var(--blue);
  border: 1px solid #c9d7fa;
  border-radius: 13px;
  background: #f7f9ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.faq-list {
  border-top: 1px solid #dfe4ee;
}

.faq-list details {
  border-bottom: 1px solid #dfe4ee;
}

.faq-list summary {
  padding: 25px 4px;
  position: relative;
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary span {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 50%;
  right: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f8;
  transform: translateY(-50%);
}

.faq-list summary span::before,
.faq-list summary span::after {
  content: "";
  width: 10px;
  height: 1.5px;
  position: absolute;
  border-radius: 2px;
  background: #69758a;
  transition: transform 0.2s ease;
}

.faq-list summary span::after {
  transform: rotate(90deg);
}

.faq-list details[open] summary span::after {
  transform: rotate(0);
}

.faq-list details p {
  margin: -6px 55px 24px 4px;
  color: #7b8699;
  font-size: 13px;
  line-height: 1.9;
}

.site-footer {
  min-height: 124px;
  padding: 30px max(32px, calc((100vw - 1040px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: #8e98a9;
  background: #fff;
  border-top: 1px solid #eef1f5;
  font-size: 11px;
}

.brand--footer .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: none;
}

.brand--footer .brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand--footer strong {
  font-size: 13px;
}

.brand--footer small {
  color: #a1a9b7;
  font-size: 8px;
  letter-spacing: 0;
}

.chat-launcher {
  width: 60px;
  height: 60px;
  position: fixed;
  z-index: 50;
  right: 30px;
  bottom: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  border-radius: 19px;
  background: linear-gradient(145deg, #347aff, #1558df);
  box-shadow: 0 18px 32px rgba(32, 94, 230, 0.28);
  cursor: pointer;
  transition:
    transform 0.23s ease,
    box-shadow 0.23s ease,
    border-radius 0.23s ease;
}

.chat-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 38px rgba(32, 94, 230, 0.34);
}

.chat-launcher.is-open {
  border-radius: 50%;
  transform: rotate(0);
}

.launcher-icon {
  width: 30px;
  height: 30px;
  position: absolute;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.launcher-icon--chat {
  width: 29px;
  height: 29px;
}

.launcher-icon--close {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
}

.chat-launcher.is-open .launcher-icon--chat {
  opacity: 0;
  transform: rotate(45deg) scale(0.7);
}

.chat-launcher.is-open .launcher-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.launcher-badge {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 3px solid var(--paper);
  border-radius: 11px;
  background: #ff5b65;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}

.chat-notice {
  width: min(342px, calc(100vw - 94px));
  position: fixed;
  z-index: 49;
  right: 29px;
  bottom: 101px;
  animation: notice-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-notice > button {
  width: 100%;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #2e75ff, #1557df);
  box-shadow: 0 19px 38px rgba(35, 94, 224, 0.26);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-notice > button:hover {
  transform: translateY(-2px);
}

.chat-notice .notice-icon {
  width: 34px;
  height: 34px;
}

.chat-notice-copy {
  display: grid;
  gap: 2px;
}

.chat-notice-copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
}

.chat-notice-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.notice-chevron {
  width: 17px;
  height: 17px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.72;
}

.chat-panel {
  width: 392px;
  height: min(650px, calc(100dvh - 110px));
  position: fixed;
  z-index: 48;
  right: 28px;
  bottom: 100px;
  overflow: hidden;
  border: 1px solid rgba(225, 230, 242, 0.92);
  border-radius: 26px;
  background: #fff;
  box-shadow:
    0 34px 90px rgba(20, 38, 80, 0.2),
    0 5px 20px rgba(20, 38, 80, 0.06);
  transform-origin: right bottom;
  animation: panel-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  height: 78px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    radial-gradient(circle at 92% 0%, rgba(84, 143, 255, 0.09), transparent 38%),
    #fff;
  border-bottom: 1px solid #eef1f6;
}

.chat-header-copy {
  display: grid;
  gap: 4px;
}

.chat-header-copy strong {
  font-size: 15px;
}

.chat-header-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8b95a7;
  font-size: 10px;
}

.chat-header-copy i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

.panel-close {
  width: 34px;
  height: 34px;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: #7f8a9d;
  border: 0;
  border-radius: 10px;
  background: #f5f7fb;
  cursor: pointer;
}

.notify-toggle {
  width: 34px;
  height: 34px;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: #7f8a9d;
  border: 0;
  border-radius: 10px;
  background: #f5f7fb;
  cursor: pointer;
}

.notify-toggle:hover,
.notify-toggle.is-active {
  color: var(--blue);
  background: var(--blue-pale);
}

.notify-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify-toggle + .panel-close {
  margin-left: 5px;
}

.panel-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-context {
  height: 38px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #97a1b3;
  background: #f8f9fc;
  border-bottom: 1px solid #f0f2f7;
  font-size: 9px;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7f918f;
}

.secure-label svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.messages {
  height: calc(100% - 244px);
  padding: 21px 18px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 0% 88%, rgba(221, 232, 255, 0.32), transparent 30%),
    #f8f9fc;
  scrollbar-width: thin;
  scrollbar-color: #d6dce8 transparent;
}

.message-skeleton {
  display: grid;
  gap: 15px;
}

.message-skeleton span {
  width: 58%;
  height: 62px;
  border-radius: 7px 18px 18px 18px;
  background: linear-gradient(90deg, #eef1f7, #f7f8fb, #eef1f7);
  background-size: 220% 100%;
  animation: skeleton 1.5s infinite linear;
}

.message-skeleton span:last-child {
  width: 45%;
  height: 44px;
  margin-left: auto;
  border-radius: 18px 7px 18px 18px;
}

@keyframes skeleton {
  to {
    background-position: -220% 0;
  }
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 15px;
  animation: message-in 0.22s ease both;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.message-row--agent,
.message-row--system {
  justify-content: flex-start;
}

.message-row--visitor {
  justify-content: flex-end;
}

.message-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #4d8cff, #1c5ee1);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.message-stack {
  max-width: 76%;
  display: grid;
  gap: 5px;
}

.message-row--visitor .message-stack {
  justify-items: end;
}

.message-bubble {
  padding: 11px 13px;
  color: #4c586b;
  border-radius: 7px 17px 17px 17px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(40, 55, 86, 0.055);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.message-row--visitor .message-bubble {
  color: #fff;
  border-radius: 17px 7px 17px 17px;
  background: linear-gradient(135deg, #3178ff, #1c5fe6);
  box-shadow: 0 7px 17px rgba(36, 107, 253, 0.17);
}

.message-time {
  padding: 0 2px;
  color: #a1a9b7;
  font-size: 8px;
}

.delivery-mark {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
}

.quick-replies {
  min-height: 46px;
  padding: 5px 17px 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  background: #f8f9fc;
  border-top: 1px solid #f0f2f7;
  scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-replies button {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: #5f6c80;
  border: 1px solid #dfe5f0;
  border-radius: 9px;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.quick-replies button:hover {
  color: var(--blue);
  border-color: #c6d4f6;
}

.composer {
  height: 82px;
  padding: 10px 14px 12px 17px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #fff;
  border-top: 1px solid #eef1f6;
}

.composer textarea {
  width: 100%;
  height: 44px;
  max-height: 96px;
  padding: 12px 52px 10px 14px;
  resize: none;
  color: var(--ink);
  border: 1px solid #e4e8f1;
  border-radius: 14px;
  outline: none;
  background: #f7f8fb;
  font-size: 13px;
  line-height: 1.55;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.composer textarea:focus {
  border-color: #b7c9f7;
  background: #fff;
}

.composer textarea::placeholder {
  color: #a1a9b7;
}

.composer > button {
  width: 39px;
  height: 39px;
  position: absolute;
  z-index: 2;
  right: 19px;
  top: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.composer > button:hover {
  transform: scale(1.04);
}

.composer > button:disabled {
  opacity: 0.4;
  transform: none;
}

.composer > button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-hint {
  position: absolute;
  right: 20px;
  bottom: 3px;
  color: #c2c8d3;
  font-size: 7px;
}

.toast {
  min-width: 180px;
  max-width: calc(100vw - 40px);
  padding: 11px 15px;
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 34px;
  color: #fff;
  border-radius: 12px;
  background: rgba(20, 33, 61, 0.92);
  box-shadow: 0 12px 28px rgba(19, 31, 56, 0.2);
  font-size: 12px;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 0.2s ease both;
}

body.chat-direct {
  height: 100dvh;
  overflow: hidden;
  background: #f8f9fc;
}

.direct-boot {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #5f6c80;
  background:
    radial-gradient(circle at 50% 38%, rgba(72, 133, 255, 0.1), transparent 25rem),
    #f8f9fc;
  font-size: 13px;
}

.direct-boot span {
  width: 18px;
  height: 18px;
  border: 2px solid #c8d6fa;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: direct-spin 0.8s linear infinite;
}

@keyframes direct-spin {
  to {
    transform: rotate(360deg);
  }
}

body.chat-direct .site-header,
body.chat-direct main,
body.chat-direct .site-footer,
body.chat-direct .chat-launcher,
body.chat-direct .chat-notice,
body.chat-direct .page-glow {
  display: none !important;
}

body.chat-direct .chat-panel {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  inset: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.chat-direct .chat-panel:not([hidden]) + * {
  pointer-events: auto;
}

body.chat-direct .chat-header {
  height: 82px;
  padding-left: max(20px, calc((100vw - 900px) / 2));
  padding-right: max(20px, calc((100vw - 900px) / 2));
}

body.chat-direct .chat-context {
  height: 40px;
  padding-left: max(20px, calc((100vw - 900px) / 2));
  padding-right: max(20px, calc((100vw - 900px) / 2));
}

body.chat-direct .messages {
  height: calc(100dvh - 82px - 40px - 48px - 88px);
  padding: 26px max(18px, calc((100vw - 860px) / 2)) 12px;
}

body.chat-direct .message-stack {
  max-width: min(68%, 620px);
}

body.chat-direct .quick-replies {
  min-height: 48px;
  padding-left: max(18px, calc((100vw - 860px) / 2));
  padding-right: max(18px, calc((100vw - 860px) / 2));
}

body.chat-direct .composer {
  height: 88px;
  padding-left: max(18px, calc((100vw - 860px) / 2));
  padding-right: max(18px, calc((100vw - 860px) / 2));
}

body.chat-direct .composer textarea {
  height: 48px;
}

body.chat-direct .composer > button {
  top: 14px;
  right: max(24px, calc((100vw - 860px) / 2 + 6px));
}

body.chat-direct .send-hint {
  right: max(25px, calc((100vw - 860px) / 2 + 7px));
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

@media (max-width: 1060px) {
  .hero {
    gap: 28px;
  }

  .float-tag--saved {
    right: -8px;
  }

  .float-tag--privacy {
    left: -8px;
  }

  .questions-section {
    gap: 60px;
  }
}

@media (max-width: 860px) {
  .site-header,
  .hero,
  .questions-section {
    width: min(100% - 40px, 620px);
  }

  .site-header {
    height: 84px;
  }

  .site-nav a {
    display: none;
  }

  .hero {
    margin-top: 36px;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-copy {
    padding-left: 0;
    text-align: center;
  }

  .hero h1,
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero h1 {
    font-size: clamp(48px, 12vw, 68px);
  }

  .hero-actions,
  .trust-row {
    justify-content: center;
  }

  .hero-visual {
    min-height: 510px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .steps {
    max-width: 620px;
    grid-template-columns: 1fr;
  }

  .steps article {
    min-height: auto;
  }

  .questions-section {
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .hero,
  .questions-section {
    width: calc(100% - 32px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 15px;
  }

  .nav-contact {
    min-width: 96px;
    height: 40px;
    padding: 0 13px;
    font-size: 13px;
  }

  .hero {
    margin-top: 27px;
    min-height: auto;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(43px, 14vw, 58px);
    letter-spacing: -0.07em;
  }

  .hero-lead {
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.8;
  }

  .hero-actions {
    margin-top: 27px;
    gap: 18px;
  }

  .primary-button {
    height: 52px;
    min-width: 145px;
    border-radius: 15px;
  }

  .text-link {
    font-size: 12px;
  }

  .trust-row {
    gap: 13px;
    margin-top: 27px;
    font-size: 10px;
  }

  .hero-visual {
    min-height: 446px;
    margin-top: 10px;
  }

  .visual-orbit--one {
    width: 410px;
    height: 410px;
  }

  .visual-orbit--two {
    width: 330px;
    height: 330px;
  }

  .preview-window {
    width: calc(100% - 24px);
    border-radius: 24px;
  }

  .preview-topbar {
    height: 72px;
    padding: 0 17px;
  }

  .preview-body {
    height: 246px;
    padding: 18px;
  }

  .float-tag {
    font-size: 9px;
  }

  .float-tag--saved {
    top: 42px;
    right: 0;
  }

  .float-tag--privacy {
    bottom: 42px;
    left: 0;
  }

  .how-section {
    padding: 78px 16px 72px;
  }

  .section-heading {
    margin-bottom: 32px;
  }

  .section-heading h2,
  .questions-copy h2 {
    font-size: 30px;
  }

  .steps article {
    padding: 30px 27px;
  }

  .questions-section {
    padding: 78px 0 82px;
  }

  .faq-list summary {
    font-size: 14px;
  }

  .site-footer {
    padding: 27px 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .site-footer p {
    margin: 0;
  }

  .chat-launcher {
    width: 56px;
    height: 56px;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    border-radius: 17px;
  }

  .chat-notice {
    width: calc(100vw - 86px);
    right: 17px;
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 69px);
  }

  .chat-panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    right: 0;
    bottom: 0;
    border: 0;
    border-radius: 0;
  }

  .chat-header {
    height: calc(76px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .chat-context {
    height: 37px;
  }

  .messages {
    height: calc(100dvh - 76px - env(safe-area-inset-top) - 37px - 46px - 92px - env(safe-area-inset-bottom));
    padding-left: 15px;
    padding-right: 15px;
  }

  .composer {
    height: calc(82px + env(safe-area-inset-bottom));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.chat-direct .chat-header {
    height: calc(78px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: 16px;
    padding-right: 16px;
  }

  body.chat-direct .chat-context {
    height: 38px;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.chat-direct .messages {
    height: calc(100dvh - 78px - env(safe-area-inset-top) - 38px - 46px - 92px - env(safe-area-inset-bottom));
    padding-left: 15px;
    padding-right: 15px;
  }

  body.chat-direct .message-stack {
    max-width: 82%;
  }

  body.chat-direct .quick-replies {
    padding-left: 15px;
    padding-right: 15px;
  }

  body.chat-direct .composer {
    height: calc(88px + env(safe-area-inset-bottom));
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.chat-direct .composer > button {
    top: 14px;
    right: 20px;
  }

  body.chat-direct .send-hint {
    right: 20px;
  }

  .message-stack {
    max-width: 82%;
  }

  .message-bubble {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 手机端输入框 16px，避免 iOS 聚焦缩放 */
@media (max-width: 560px) {
  .composer textarea {
    font-size: 16px;
    height: 46px;
  }
}

/* 手机端：隐藏回车提示；把「已送达」状态排到气泡下方，避免压字 */
@media (max-width: 560px) {
  .send-hint {
    display: none;
  }

  .composer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .message-time {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
  }

  .delivery-mark {
    opacity: 0.85;
  }
}

/* ===== 微信风格消息气泡（覆盖旧样式） ===== */
.messages {
  padding: 14px 14px 6px;
  background: #f3f5f8;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  animation: bubble-in 0.16s ease-out;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.message-row--visitor {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-radius: 5px;
  background: linear-gradient(145deg, #5a95ff, #1f61e0);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-stack {
  display: flex;
  flex-direction: column;
  max-width: 76%;
  min-width: 0;
}

.message-row--visitor .message-stack {
  align-items: flex-end;
}

.message-bubble {
  position: relative;
  padding: 10px 13px;
  font-size: 15px;
  line-height: 1.62;
  color: #1c2530;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(20, 35, 60, 0.05);
}

/* 左侧气泡尖角 */
.message-row--agent .message-bubble::before,
.message-row--system .message-bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #fff;
}

/* 自己这一侧：品牌蓝气泡 + 右侧尖角 */
.message-row--visitor .message-bubble {
  color: #fff;
  background: linear-gradient(160deg, #2f7bff, #0f5fe0);
  box-shadow: 0 2px 6px rgba(21, 88, 221, 0.22);
}

.message-row--visitor .message-bubble::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #1765e6;
}

.message-row--system {
  justify-content: center;
}

.message-row--system .message-avatar {
  display: none;
}

.message-row--system .message-stack {
  max-width: 88%;
  align-items: center;
}

.message-row--system .message-bubble {
  padding: 6px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #7b8593;
  text-align: center;
  background: rgba(20, 35, 60, 0.06);
  box-shadow: none;
}

.message-row--system .message-bubble::before {
  display: none;
}

.message-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 0 2px;
  font-size: 11px;
  color: #9aa4b2;
}

.delivery-mark {
  color: #9aa4b2;
}

@media (max-width: 560px) {
  .message-stack {
    max-width: 80%;
  }

  .message-bubble {
    font-size: 15.5px;
    padding: 9px 12px;
  }

  .messages {
    padding: 12px 10px 4px;
  }
}

/* ===== 全屏/手机聊天布局：输入区贴底，消息区自适应 ===== */
.chat-panel {
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.composer {
  flex: 0 0 auto;
  height: auto;
}

/* 客服头像：品牌底 + 白色图标，不再是一个白圆 */
.avatar--support {
  color: #fff;
  background: linear-gradient(150deg, #4d8cff, #1558dd);
}

.avatar--support svg circle {
  fill: #1558dd;
}

@media (max-width: 560px) {
  body.chat-direct .chat-panel,
  .chat-panel {
    width: 100%;
    height: 100dvh;
    right: 0;
    bottom: 0;
    border: 0;
    border-radius: 0;
  }

  .composer {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .composer textarea {
    min-height: 42px;
    height: 42px;
  }
}

/* 修：自己的消息必须靠右（行容器必须撑满宽度，否则 row-reverse 无效） */
.messages {
  display: block;
  width: 100%;
}

.message-row {
  width: 100%;
  box-sizing: border-box;
}

.message-row--visitor {
  justify-content: flex-start;
}

/* 访客端：客服正在输入 */
#presenceLine.is-typing b {
  color: #1558dd;
  font-weight: 600;
}

#presenceLine.is-typing > i {
  background: #1558dd;
  animation: typing-pulse 1s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.32; }
}

/* 顶部客服头像：固定尺寸裁切，避免被图片原始尺寸撑成横条 */
.avatar {
  width: 44px;
  height: 44px;
  overflow: hidden;
}

.avatar--large,
.chat-header .avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.avatar img,
.chat-header .avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

/* 顶部栏排版加固：头像/文字/按钮各归位，不再互相压住 */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header .avatar {
  order: 0;
  flex: 0 0 46px;
}

.chat-header-copy {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.chat-header-copy strong,
.chat-header-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notify-toggle,
.panel-close {
  order: 2;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: rgba(20, 35, 60, 0.05);
}

/* 全屏聊天页：不提供任何跳回官网的入口 */
body.chat-direct .panel-close,
body.chat-direct .chat-launcher,
body.chat-direct .chat-notice {
  display: none !important;
}

/* ===== 媒体消息与灯箱 ===== */
.message-media,
.agent-message-media {
  display: block;
  max-width: 210px;
  padding: 0;
  overflow: hidden;
  position: relative;
  border: 0;
  border-radius: 9px;
  background: #eef2f7;
  cursor: zoom-in;
}

.message-media img,
.agent-message-media img,
.message-media video,
.agent-message-media video {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: rgba(12, 22, 38, 0.28);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 14, 24, 0.92);
}

.media-viewer-inner {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-inner img,
.media-viewer-inner video {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  object-fit: contain;
}

.media-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.attach-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin: 4px 0 0;
  color: #6b7a8c;
  border: 0;
  border-radius: 10px;
  background: #f1f4f9;
  cursor: pointer;
}

.attach-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ===== 访客输入区：一行三件套（+ / 输入框 / 发送） ===== */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: auto;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

.composer .attach-btn {
  order: 0;
  position: static;
  width: 40px;
  height: 42px;
  margin: 0;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #eff3f9;
}

.composer textarea {
  order: 1;
  flex: 1 1 auto;
  width: auto;
  height: 42px;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 12px;
}

.composer > button[type="submit"],
.composer > button:last-of-type {
  order: 2;
  position: static;
  width: 62px;
  height: 42px;
  margin: 0;
  flex: 0 0 auto;
  border-radius: 12px;
}

.composer .send-hint {
  display: none;
}

/* 手机端：输入区更紧凑，按钮不挤压输入框 */
@media (max-width: 560px) {
  .composer {
    gap: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .composer .attach-btn {
    width: 38px;
    height: 40px;
  }

  .composer textarea {
    height: 40px;
    min-height: 40px;
    font-size: 16px;
    padding: 8px 10px;
  }

  .composer > button[type="submit"],
  .composer > button:last-of-type {
    width: 52px;
    height: 40px;
  }
}

/* 加号图标加深，别淡到看不见 */
.attach-btn {
  color: #46536a;
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #e2e8f1;
}

.attach-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
}

/* ===== 语音消息（微信式语音条） ===== */
.mic-btn {
  order: 0;
  width: 40px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #46536a;
  border: 0;
  border-radius: 12px;
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #e2e8f1;
  cursor: pointer;
  touch-action: none;
}

.mic-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mic-btn:active {
  background: #dfe8f6;
}

.message-voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  max-width: 200px;
  padding: 9px 12px;
  font-size: 13px;
  color: #1c2530;
  border: 1px solid #eceff5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.message-row--visitor .message-voice {
  color: #fff;
  border: 0;
  background: linear-gradient(160deg, #2f7bff, #1558dd);
}

.voice-icon {
  font-size: 12px;
  opacity: 0.85;
}

.message-voice.is-playing .voice-icon {
  animation: voice-pulse 0.9s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.voice-secs {
  margin-left: auto;
  font-weight: 500;
}

/* 录音浮层 */
.recording-mask {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 24, 0.42);
}

.recording-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 32px;
  color: #fff;
  border-radius: 18px;
  background: rgba(20, 32, 52, 0.92);
  box-shadow: 0 18px 44px rgba(8, 16, 30, 0.4);
}

.recording-card strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.recording-card span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.recording-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
}

.recording-wave i {
  width: 4px;
  border-radius: 2px;
  background: #6ea8ff;
  animation: rec-wave 0.9s ease-in-out infinite;
}

.recording-wave i:nth-child(1) { height: 10px; animation-delay: 0s; }
.recording-wave i:nth-child(2) { height: 18px; animation-delay: 0.12s; }
.recording-wave i:nth-child(3) { height: 26px; animation-delay: 0.24s; }
.recording-wave i:nth-child(4) { height: 16px; animation-delay: 0.36s; }
.recording-wave i:nth-child(5) { height: 9px; animation-delay: 0.48s; }

@keyframes rec-wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* 访客输入区：四格定死（+ / 麦克风 / 输入框 / 发送），不再靠 order 抢位 */
.composer {
  display: grid !important;
  grid-template-columns: 40px 40px minmax(0, 1fr) 62px !important;
  align-items: end;
  gap: 6px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px)) !important;
  height: auto !important;
}

.composer .attach-btn {
  grid-column: 1;
  width: 40px;
  height: 42px;
  margin: 0;
  position: static !important;
}

.composer .mic-btn {
  grid-column: 2;
  width: 40px;
  height: 42px;
  margin: 0;
  position: static !important;
}

.composer textarea {
  grid-column: 3;
  width: auto !important;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 12px;
}

.composer > button[type="submit"],
.composer > button:last-of-type {
  grid-column: 4;
  position: static !important;
  width: 62px !important;
  height: 42px !important;
  margin: 0;
  border-radius: 12px;
}

.composer .send-hint {
  display: none !important;
}

@media (max-width: 560px) {
  .composer {
    grid-template-columns: 38px 38px minmax(0, 1fr) 54px !important;
    gap: 5px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .composer .attach-btn,
  .composer .mic-btn {
    width: 38px;
    height: 40px;
  }

  .composer textarea {
    height: 40px;
    min-height: 40px;
    font-size: 16px;
    padding: 8px 10px;
  }

  .composer > button[type="submit"],
  .composer > button:last-of-type {
    width: 54px !important;
    height: 40px !important;
  }
}

/* 麦克风按钮跟加号保持同一套浅色，不要跳出来变成蓝色 */
.composer .mic-btn,
.composer .mic-btn:active,
.composer .mic-btn:focus {
  color: #46536a !important;
  background: #eef2f8 !important;
  box-shadow: inset 0 0 0 1px #e2e8f1 !important;
}

.composer .mic-btn:active {
  background: #dfe8f6 !important;
}

/* ===== 客户台桌面端：居中卡片 + 柔和背景，不再横铺一整条 ===== */
@media (min-width: 1024px) {
  body.chat-direct {
    background:
      radial-gradient(1200px 520px at 50% -8%, #e2ecfd 0%, rgba(245, 247, 251, 0) 62%),
      linear-gradient(180deg, #eef2f9 0%, #e8eef7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
  }

  body.chat-direct .chat-panel {
    width: min(760px, 100%);
    height: min(860px, calc(100dvh - 56px));
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(22, 40, 74, 0.16);
    overflow: hidden;
    background: #fff;
  }

  body.chat-direct .chat-header {
    border-radius: 22px 22px 0 0;
    background: #fff;
  }

  body.chat-direct .messages {
    background: #f6f8fc;
  }

  body.chat-direct .composer {
    background: #fff;
    border-top: 1px solid #eef1f6;
  }
}

/* 桌面客户台：真正居中（panel 是 fixed，必须用 transform 定位） */
@media (min-width: 1024px) {
  body.chat-direct {
    display: block;
    padding: 0;
  }

  body.chat-direct .chat-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 56px));
    height: min(860px, calc(100dvh - 56px));
    inset: auto;
    border-radius: 22px;
  }
}

/* 修：inset:auto 必须写在 left/top 之前，否则会把居中重置掉 */
@media (min-width: 1024px) {
  body.chat-direct .chat-panel {
    inset: auto;
    right: auto;
    bottom: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

/* 居中改为 fixed + inset:0 + margin:auto（不依赖 transform） */
@media (min-width: 1024px) {
  body.chat-direct .chat-panel {
    position: fixed;
    inset: 0;
    margin: auto;
    transform: none;
    width: min(760px, calc(100vw - 56px));
    height: min(860px, calc(100dvh - 56px));
    border-radius: 22px;
  }
}

/* ===== 微信式语音：切换按钮 + 按住说话 + 松手确认 ===== */
.mode-toggle {
  grid-column: 1;
  width: 40px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #46536a;
  border: 0;
  border-radius: 12px;
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #e2e8f1;
  cursor: pointer;
}

.mode-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-hold {
  grid-column: 2 / 4;
  height: 42px;
  font-size: 14.5px;
  font-weight: 500;
  color: #16202c;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e2e8f1;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.voice-hold.is-holding {
  color: #5a6472;
  background: #e6ebf3;
  box-shadow: inset 0 0 0 1px #d7dee9;
}

/* 语音模式下隐藏文本输入和加号 */
body.voice-mode .composer textarea,
body.voice-mode .composer .attach-btn,
body.voice-mode .composer > button[type="submit"] {
  display: none !important;
}

body.voice-mode .composer {
  grid-template-columns: 40px minmax(0, 1fr) !important;
}

/* 松手确认条 */
.voice-confirm {
  position: fixed;
  inset: 0;
  z-index: 997;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 18, 30, 0.28);
}

.vc-card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(16, 30, 56, 0.22);
}

.vc-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
}

.vc-wave i {
  width: 4px;
  border-radius: 2px;
  background: #2f7bff;
  animation: rec-wave 0.9s ease-in-out infinite;
}

.vc-wave i:nth-child(1) { height: 10px; }
.vc-wave i:nth-child(2) { height: 18px; animation-delay: 0.1s; }
.vc-wave i:nth-child(3) { height: 26px; animation-delay: 0.2s; }
.vc-wave i:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.vc-wave i:nth-child(5) { height: 9px; animation-delay: 0.4s; }

.vc-card strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.vc-actions { display: flex; gap: 10px; width: 100%; margin-top: 4px; }

.vc-actions button {
  flex: 1 1 0;
  height: 44px;
  font-size: 14.5px;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
}

#vcCancel {
  color: #46536a;
  border: 1px solid #e3eaf3;
  background: #f7f9fc;
}

#vcSend {
  color: #fff;
  border: 0;
  background: linear-gradient(160deg, #2f7bff, #1558dd);
  box-shadow: 0 8px 18px rgba(31, 97, 224, 0.22);
}

/* 修正五件套的网格：切换 / 加号 / 输入 / 发送，各自一列 */
.composer {
  grid-template-columns: 40px 40px minmax(0, 1fr) 62px !important;
}

.composer .mode-toggle { grid-column: 1 !important; }
.composer .attach-btn { grid-column: 2 !important; }
.composer textarea { grid-column: 3 !important; }
.composer > button[type="submit"],
.composer > button:last-of-type { grid-column: 4 !important; }
.composer .voice-hold { grid-column: 2 / 5 !important; }

body.voice-mode .composer {
  grid-template-columns: 40px minmax(0, 1fr) !important;
}

body.voice-mode .composer .voice-hold { grid-column: 2 / -1 !important; }

@media (max-width: 560px) {
  .composer {
    grid-template-columns: 38px 38px minmax(0, 1fr) 54px !important;
  }
  .composer .mode-toggle { width: 38px; height: 40px; }
}

/* 输入区改用 flex，彻底避开 grid 列冲突 */
.composer {
  display: flex !important;
  align-items: flex-end;
  gap: 6px;
  grid-template-columns: none !important;
}

.composer .mode-toggle { order: 0; flex: 0 0 40px; width: 40px; grid-column: auto !important; }
.composer .attach-btn { order: 1; flex: 0 0 40px; width: 40px; grid-column: auto !important; }
.composer textarea { order: 2; flex: 1 1 auto; width: auto !important; grid-column: auto !important; }
.composer > button[type="submit"],
.composer > button:last-of-type { order: 3; flex: 0 0 62px; width: 62px !important; grid-column: auto !important; }
.composer .voice-hold { order: 2; flex: 1 1 auto; width: auto; grid-column: auto !important; }

body.voice-mode .composer .mode-toggle { order: 0; }
body.voice-mode .composer .voice-hold { display: block !important; }

@media (max-width: 560px) {
  .composer .mode-toggle,
  .composer .attach-btn { flex-basis: 38px; width: 38px; }
  .composer > button[type="submit"],
  .composer > button:last-of-type { flex-basis: 54px; width: 54px !important; }
}

/* 覆盖旧的绝对定位（发送键/mic 的 right:20px 会吃掉切换键） */
.composer .mode-toggle,
.composer .attach-btn,
.composer .voice-hold {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
}

.composer {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* 「按住 说话」用微信那种白底描边，不要蓝色实心 */
.composer .voice-hold,
.composer .voice-hold:active {
  color: #16202c !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px #e2e8f1 !important;
  font-weight: 500;
}

.composer .voice-hold.is-holding {
  color: #5a6472 !important;
  background: #e9eef5 !important;
  box-shadow: inset 0 0 0 1px #d7dee9 !important;
}

/* 录音提示改成底部小浮条，不要大卡片挡住聊天内容 */
.recording-mask {
  background: transparent !important;
  align-items: flex-end !important;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
}

.recording-card {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  background: rgba(24, 36, 56, 0.92) !important;
  box-shadow: 0 12px 28px rgba(10, 20, 36, 0.28) !important;
}

.recording-card .recording-wave { height: 18px; }
.recording-card .recording-wave i { width: 3px; }

.recording-card strong {
  font-size: 15px !important;
  font-variant-numeric: tabular-nums;
}

.recording-card span {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}
