.visitor-mobile-notice,
.visitor-mobile-disclaimer,
.visitor-attachment-panel,
.composer #visitorMobileAttach {
  display: none;
}

@media (max-width: 640px) and (hover: none) and (pointer: coarse) {
  .visitor-layout {
    height: 100%;
    height: var(--visitor-mobile-viewport-height, 100dvh);
  }

  .app {
    width: 100%;
    background: #f5f7f6;
  }

  #visitorChatPane .top {
    position: relative;
    z-index: 2;
    padding: max(8px, env(safe-area-inset-top)) 14px 10px;
    background: #283630;
  }

  #visitorChatPane #siteTitle,
  #visitorChatPane .product-notice,
  #visitorChatPane .visitor-actions,
  #visitorChatPane #visitorStatusBadge[data-state="leave"],
  #visitorChatPane .top .sub#assignee,
  #visitorChatPane #shotBar,
  #visitorChatPane .visitor-desktop-attach {
    display: none;
  }

  .visitor-status-badge {
    margin-bottom: 4px;
    gap: 5px;
    min-width: 0;
    color: #ffe093;
    font-size: 12px;
    line-height: 1.35;
  }

  .visitor-mobile-notice,
  .visitor-mobile-disclaimer {
    text-align: center;
  }

  .visitor-mobile-notice {
    display: block;
    text-wrap: balance;
    margin: 2px 0 0;
    color: #f4faf6;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .visitor-mobile-disclaimer {
    display: block;
    margin: 8px 0 0;
    padding: 6px 9px;
    border: 1px solid #887448;
    border-radius: 8px;
    background: #414235;
    color: #ffe7aa;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .visitor-mobile-disclaimer strong {
    margin-right: 4px;
    font-weight: 700;
  }

  .visitor-attachment-panel {
    padding: 4px;
    border: 1px solid #d7e1da;
    border-radius: 12px;
    background: #fff;
    color: #25382d;
    box-shadow: 0 8px 28px #25382d24;
  }

  .visitor-attachment-panel button {
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    color: #25382d;
    background: transparent;
    font: inherit;
    font-size: 14px;
    text-align: left;
  }

  .visitor-attachment-panel button:hover {
    background: #edf5ef;
  }

  #visitorChatPane .composer {
    position: relative;
    flex: 0 0 auto;
    gap: 8px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border-color: #dce5de;
    background: #fff;
  }

  .composer #visitorMobileAttach {
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d8e5dc;
    background: #edf5ef;
    color: #25583e;
  }

  .composer #input {
    min-width: 0;
    min-height: 44px;
    max-height: 104px;
    padding: 10px 11px;
    border-color: #cfded4;
    border-radius: 10px;
    font-size: 16px;
    line-height: 22px;
    field-sizing: content;
  }

  .composer #input::placeholder {
    color: #606e65;
    opacity: 1;
  }

  .composer #send {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 10px;
    background: #087748;
    font-size: 15px;
    font-weight: 650;
  }

  #visitorMobileAttach[aria-expanded="true"] ~ .visitor-attachment-panel {
    position: absolute;
    z-index: 1;
    bottom: calc(100% + 6px);
    left: 12px;
    display: grid;
    width: min(265px, calc(100vw - 24px));
  }

  #visitorChatPane :is(button, summary, textarea):focus-visible {
    outline: 2px solid #148554;
    outline-offset: 2px;
  }
}
@media (max-width: 640px) and (hover: none) and (pointer: coarse) {
  #msgs .bubble.is-media > img {
    max-width: min(100%, 248px) !important;
    max-height: 168px !important;
    width: auto !important;
    height: auto !important;
    cursor: zoom-in;
  }

  .mobile-image-thumb:focus-visible {
    outline: 2px solid #17633a;
    outline-offset: 3px;
  }

  .mobile-image-message::after {
    display: block;
    margin-top: 5px;
    color: #52615c;
    font-size: 12px;
    line-height: 1.45;
    content: "点按查看原图";
  }
}

.mobile-original-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #171b20;
  color: #fff;
}

.mobile-original-viewer[open] {
  display: flex;
  flex-direction: column;
}

.mobile-original-viewer::backdrop { background: #171b20; }

.mobile-original-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid #454c54;
}

.mobile-original-toolbar strong { margin-right: auto; }

.mobile-original-toolbar button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #717b85;
  border-radius: 8px;
  background: #282e35;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mobile-original-toolbar button:disabled { opacity: .6; cursor: default; }
.mobile-original-toolbar button:focus-visible { outline: 2px solid #9fdeb4; outline-offset: 2px; }

.mobile-original-image-area {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-original-image-area img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.mobile-original-viewer.is-zoomed .mobile-original-image-area { display: block; }
.mobile-original-viewer.is-zoomed img { max-width: none; max-height: none; }
