/* page-assist.css — 联系浮层 + AI 小耕 FAB（has-page-assist 内页；视觉同首页） */

.ui-icon {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
}
.ui-icon--wechat {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
}
.ui-icon--phone {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}
.ui-icon--mail {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}
.ui-icon--sparkles {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='m12 3-1.9 5.8H4l4.9 3.6-1.9 5.8L12 14.4l4.9 3.6-1.9-5.8L20 8.8h-6.1Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='m12 3-1.9 5.8H4l4.9 3.6-1.9 5.8L12 14.4l4.9 3.6-1.9-5.8L20 8.8h-6.1Z'/%3E%3C/svg%3E");
}

.contact-dock {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  pointer-events: none;
}
.contact-dock.is-visible:not(.is-suppressed) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.contact-dock.is-visible.is-nudged:not(.is-suppressed):not(.is-open) .contact-dock-fab {
  animation: contact-dock-nudge 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}
@keyframes contact-dock-nudge {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.contact-dock-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(12, 11, 10, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: default;
  opacity: 0;
  transition: opacity 0.32s ease;
}
.contact-dock.is-open .contact-dock-backdrop {
  display: block;
  opacity: 1;
}
.contact-dock-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(18.5rem, calc(100vw - 2rem));
  padding: 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 252, 0.94);
  border: 1px solid rgba(26, 24, 20, 0.08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 20px 50px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(8px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}
.contact-dock-panel[hidden] { display: none; }
.contact-dock.is-open .contact-dock-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.contact-dock-sheet-handle { display: none; }
.contact-dock-head {
  padding: 1.15rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(26, 24, 20, 0.06);
}
.contact-dock-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.contact-dock-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.contact-dock-desc {
  margin: 0.4rem 0 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--muted);
}
.contact-dock-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
}
.contact-dock-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: calc(var(--radius-md) - 2px);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.18s ease;
}
.contact-dock-item:hover {
  background: rgba(201, 154, 46, 0.08);
}
.contact-dock-item.is-primary {
  background: rgba(201, 154, 46, 0.06);
  border: 1px solid rgba(201, 154, 46, 0.18);
}
.contact-dock-item.is-primary:hover {
  background: rgba(201, 154, 46, 0.11);
}
.contact-dock-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(26, 24, 20, 0.05);
  color: var(--ink);
}
.contact-dock-item-icon .ui-icon {
  width: 1rem;
  height: 1rem;
}
.contact-dock-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.contact-dock-item-label {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
}
.contact-dock-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-dock-item-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: rgba(201, 154, 46, 0.14);
}
.contact-dock-item--ai {
  border: 1px solid rgba(200, 169, 110, 0.3);
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.12) 0%, rgba(34, 211, 238, 0.06) 100%);
}
.contact-dock-item-badge--ai {
  background: rgba(61, 214, 140, 0.15);
  color: #2ea86a;
  font-size: 0.65rem;
}
.contact-dock-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid rgba(26, 24, 20, 0.08);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 252, 0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.contact-dock-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.14);
}
.contact-dock.is-open .contact-dock-fab {
  background: var(--ink);
  color: #fafaf8;
  border-color: transparent;
}
.contact-dock-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.contact-dock-fab-icon--close { display: none; }
.contact-dock.is-open .contact-dock-fab-icon--open { display: none; }
.contact-dock.is-open .contact-dock-fab-icon--close { display: inline-flex; }

.ai-xiaogeng-fab {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: calc(max(1.5rem, env(safe-area-inset-bottom, 0px)) + 3.25rem + 0.65rem);
  z-index: 298;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem 0.55rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 169, 110, 0.35);
  background: linear-gradient(135deg, rgba(18, 16, 14, 0.94), rgba(28, 24, 20, 0.92));
  color: #f5f0e8;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s, box-shadow 0.2s;
  pointer-events: none;
}
.ai-xiaogeng-fab.is-visible:not(.is-suppressed) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ai-xiaogeng-fab:hover {
  border-color: rgba(200, 169, 110, 0.55);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22), 0 0 20px rgba(200, 169, 110, 0.12);
  color: #fff;
}
.ai-xiaogeng-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(200, 169, 110, 0.18);
  color: var(--gold, #c8a96e);
}
.ai-xiaogeng-fab-label {
  padding-right: 0.15rem;
}
body.has-ai-fab-visible .scroll-assist.is-visible:not(.is-dock-away):not(.is-ai-fab-away) {
  bottom: calc(max(1.5rem, env(safe-area-inset-bottom, 0px)) + 6.5rem + 1.3rem);
}

@media (max-width: 1024px) {
  .contact-dock {
    right: 0;
    left: 0;
    bottom: 0;
    align-items: stretch;
    gap: 0;
  }
  .contact-dock-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: 3rem;
    height: 3rem;
    z-index: 2;
  }
  .contact-dock-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: auto;
    max-width: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: max(4.5rem, calc(3.25rem + env(safe-area-inset-bottom, 0px)));
    transform: translateY(100%);
    transform-origin: bottom center;
  }
  .contact-dock.is-open .contact-dock-panel {
    transform: translateY(0);
  }
  .contact-dock-sheet-handle {
    display: block;
    width: 2.25rem;
    height: 0.25rem;
    margin: 0.65rem auto 0.15rem;
    border-radius: 999px;
    background: rgba(26, 24, 20, 0.14);
  }
  .contact-dock-item {
    min-height: 52px;
    padding: 0.85rem 1rem;
  }
  .contact-dock-item-label { font-size: max(14px, 0.875rem); }
  .scroll-assist {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 3rem + 0.5rem);
  }
  .scroll-assist.is-dock-away {
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
  .ai-xiaogeng-fab {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 3rem + 0.5rem);
    padding: 0.5rem;
  }
  .ai-xiaogeng-fab-label { display: none; }
  body.has-ai-fab-visible .scroll-assist.is-visible:not(.is-dock-away):not(.is-ai-fab-away) {
    bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 6rem + 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-dock { transition: none; }
  .contact-dock-fab { animation: none !important; }
  .contact-dock-item:hover,
  .contact-dock-fab:hover { transform: none; }
  .contact-dock-panel { transition: none; }
  .contact-dock-backdrop { transition: none; }
  .ai-xiaogeng-fab { transition: none; }
}
