.external-wechat-page { min-height: 100vh; background: #ededed; }
.external-wechat-main { width: min(980px, calc(100% - 28px)); margin: 28px auto; }
.external-wechat-shell { display: grid; grid-template-rows: auto auto minmax(360px, 68vh) auto; overflow: hidden; border: 1px solid #d2d7da; border-radius: 18px; background: #ededed; box-shadow: 0 20px 55px rgba(15,35,49,.16); }
.external-wechat-header { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 12px 17px; color: #fff; background: linear-gradient(135deg,#1f8f55,#07c160); }
.external-wechat-header > a { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; color: #fff; border-radius: 10px; background: rgba(255,255,255,.15); }
.external-wechat-avatar { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; color: #14834c; font-size: 20px; border-radius: 9px; background: #fff; }
.external-wechat-header > div:nth-child(3) { flex: 1; min-width: 0; }
.external-wechat-header h1 { margin: 0; color: #fff; font-size: clamp(18px,3vw,25px); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-wechat-header p { margin: 3px 0 0; color: rgba(255,255,255,.82); font-size: 12px; }
.external-wechat-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; font-size: 11px; font-weight: 800; border-radius: 999px; background: rgba(0,0,0,.13); }
.external-wechat-live i { width: 7px; height: 7px; border-radius: 50%; background: #c8ffda; box-shadow: 0 0 0 3px rgba(200,255,218,.18); }
.external-wechat-status { display: none; padding: 7px 12px; color: #765515; font-size: 12px; text-align: center; background: #fff4cf; }
.external-wechat-status:not(:empty) { display: block; }
.external-wechat-status.is-error { color: #973b3f; background: #fdecee; }
.external-wechat-messages { padding: 20px 18px; overflow-y: auto; overscroll-behavior: contain; background-color: #ededed; background-image: radial-gradient(rgba(30,80,55,.055) 1px, transparent 1px); background-size: 18px 18px; }
.external-wechat-loading,.external-wechat-empty { display: grid; place-items: center; min-height: 100%; color: #8b969c; text-align: center; }
.external-wechat-empty i { font-size: 44px; }
.external-wechat-row { display: flex; margin: 9px 0; }
.external-wechat-row.is-mine { justify-content: flex-end; }
.external-wechat-row.is-theirs { justify-content: flex-start; }
.external-wechat-bubble { position: relative; width: fit-content; max-width: min(76%, 620px); padding: 10px 11px 7px; color: #20272b; border-radius: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.1); background: #fff; }
.external-wechat-row.is-mine .external-wechat-bubble { background: #95ec69; }
.external-wechat-bubble::before { content: ''; position: absolute; top: 13px; width: 0; height: 0; border: 6px solid transparent; }
.external-wechat-row.is-theirs .external-wechat-bubble::before { left: -12px; border-right-color: #fff; }
.external-wechat-row.is-mine .external-wechat-bubble::before { right: -12px; border-left-color: #95ec69; }
.external-wechat-bubble p { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.external-wechat-bubble small { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px 9px; margin-top: 5px; color: #708078; font-size: 9px; }
.external-wechat-bubble small .is-read { color: #168954; }
.external-wechat-picture { display: block; margin: 2px 0 5px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.45); }
.external-wechat-picture img { display: block; max-width: 100%; max-height: 390px; object-fit: contain; }
.external-wechat-composer { position: relative; display: grid; grid-template-columns: 45px minmax(0,1fr) 48px; align-items: end; gap: 8px; padding: 11px 13px; border-top: 1px solid #d1d6d9; background: #f7f7f7; }
.external-wechat-composer textarea { width: 100%; min-height: 44px; max-height: 120px; padding: 11px 12px; color: #20272b; border: 1px solid #d8dddf; border-radius: 8px; background: #fff; outline: 0; resize: none; }
.external-wechat-composer textarea:focus { border-color: #07c160; box-shadow: 0 0 0 3px rgba(7,193,96,.1); }
.external-wechat-image-button,.external-wechat-composer > button { display: grid; place-items: center; width: 45px; height: 44px; margin: 0; color: #566269; font-size: 19px; border: 0; border-radius: 8px; background: #e8ebed; cursor: pointer; }
.external-wechat-image-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.external-wechat-composer > button { width: 48px; color: #fff; background: #07c160; }
.external-wechat-composer > button:disabled { opacity: .55; }
.external-wechat-file { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; color: #27714b; font-size: 11px; border-radius: 7px; background: #e3f7eb; }
.external-wechat-file[hidden] { display: none; }
.external-wechat-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-wechat-file button { flex: 0 0 27px; width: 27px; height: 27px; color: #8e3439; border: 0; border-radius: 6px; background: #fff; cursor: pointer; }
.external-supplier-chat-link { position: absolute; top: 12px; left: 58px; z-index: 3; display: grid; place-items: center; width: 38px; height: 38px; color: #138b50; font-size: 17px; border: 1px solid #a9d8bd; border-radius: 10px; background: #f2fbf6; }
.external-supplier-chat-link:hover,.external-supplier-chat-link:focus { color: #fff; text-decoration: none; border-color: #07c160; background: #07c160; }
.external-supplier-chat-link.has-new { color: #fff; border-color: #07c160; background: #07c160; box-shadow: 0 0 0 4px rgba(7,193,96,.14); }
.external-supplier-chat-link strong { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; color: #fff; font-size: 10px; border: 2px solid #fff; border-radius: 999px; background: #e64242; }
.external-wechat-dashboard-alert { display: flex; align-items: center; gap: 10px; color: #17643a !important; text-decoration: none; border: 1px solid #9bd2b3; background: #eaf9f1 !important; }
.external-wechat-dashboard-alert span { flex: 1; }
.external-wechat-dashboard-alert:hover,.external-wechat-dashboard-alert:focus { color: #0d4f2c !important; text-decoration: none; border-color: #07c160; }
@media (max-width:767px) {
  .external-wechat-main { width: calc(100% - 6px); margin: 5px 3px; }
  .external-wechat-shell { grid-template-rows: auto auto minmax(360px, calc(100vh - 250px)) auto; border-radius: 11px; }
  .external-wechat-header { min-height: 68px; padding: 9px 8px; }
  .external-wechat-avatar { flex-basis: 40px; width: 40px; height: 40px; }
  .external-wechat-live { padding: 4px 7px; }
  .external-wechat-messages { padding: 15px 10px; }
  .external-wechat-bubble { max-width: 86%; }
  .external-wechat-composer { grid-template-columns: 43px minmax(0,1fr) 45px; gap: 6px; padding: 8px 6px; }
}
