/* 北京宁源律师事务所 · 站内在线咨询窗口（独立样式，不影响全站） */
/* 配色延续橙色系：橘红 #D4502A + 深蓝 #1F3049 + 暖白；字体统一思源黑体 */

.ny-chat-mask{position:fixed;inset:0;background:rgba(31,48,73,.10);z-index:190;pointer-events:none;
  opacity:0;visibility:hidden;transition:opacity .22s ease;}
.ny-chat-mask.show{opacity:1;visibility:visible;}

.ny-chat{
  position:fixed;right:22px;bottom:88px;z-index:200;
  width:352px;height:452px;max-height:calc(100vh - 110px);
  display:flex;flex-direction:column;overflow:hidden;
  background:#FBF6EF;border:1px solid #E4DED5;border-radius:5px;
  box-shadow:0 4px 10px rgba(31,48,73,.10),0 22px 60px rgba(31,48,73,.24);
  font-family:"Source Han Sans SC","Noto Sans SC","思源黑体","思源黑体 CN","PingFang SC","Microsoft YaHei",sans-serif;
  opacity:0;visibility:hidden;transform:translateY(14px) scale(.985);transform-origin:bottom right;
  transition:opacity .24s ease,transform .24s ease,visibility .24s;
}
.ny-chat.show{opacity:1;visibility:visible;transform:translateY(0) scale(1);}

/* 头部 */
.ny-chat-head{
  flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:13px 14px;
  background-image:repeating-linear-gradient(102deg,rgba(255,255,255,.035) 0 1px,rgba(0,0,0,.012) 1px 3px),
    linear-gradient(135deg,#1F3049 0%,#2A3C57 58%,#1F3049 100%);
  border-bottom:2px solid #D4502A;
}
.ny-chat-head img{width:38px;height:38px;border-radius:50%;object-fit:cover;flex-shrink:0;
  border:1px solid rgba(242,179,145,.75);box-shadow:0 1px 5px rgba(0,0,0,.3);}
.ny-chat-head .ny-chat-who{flex:1;min-width:0;}
.ny-chat-head .ny-chat-name{font-size:14px;font-weight:600;color:#FFFFFF;letter-spacing:.08em;line-height:1.35;}
.ny-chat-head .ny-chat-status{font-size:10.5px;color:#F2B391;letter-spacing:.06em;display:flex;align-items:center;gap:5px;margin-top:2px;}
.ny-chat-head .ny-chat-status::before{content:"";width:6px;height:6px;border-radius:50%;background:#7BC48A;box-shadow:0 0 0 2px rgba(123,196,138,.22);}
.ny-chat-close{width:26px;height:26px;flex-shrink:0;border:1px solid rgba(255,255,255,.24);border-radius:50%;
  background:rgba(255,255,255,.08);color:#FFFFFF;font-size:16px;line-height:1;cursor:pointer;
  font-family:inherit;transition:background .16s ease,transform .16s ease;}
.ny-chat-close:hover{background:rgba(212,80,42,.85);transform:rotate(90deg);}

/* 消息区 */
.ny-chat-body{flex:1 1 auto;overflow-y:auto;padding:16px 14px 10px;background:#FBF6EF;
  scrollbar-width:thin;scrollbar-color:#DDD5CA transparent;}
.ny-chat-body::-webkit-scrollbar{width:5px;}
.ny-chat-body::-webkit-scrollbar-thumb{background:#DDD5CA;border-radius:3px;}
.ny-msg{display:flex;gap:8px;margin-bottom:12px;align-items:flex-end;}
.ny-msg.me{flex-direction:row-reverse;}
.ny-msg-av{width:26px;height:26px;border-radius:50%;object-fit:cover;flex-shrink:0;border:1px solid #E4DED5;}
.ny-msg.me .ny-msg-av{background:#1F3049;color:#fff;display:flex;align-items:center;justify-content:center;
  font-size:10px;border-color:#1F3049;}
.ny-bubble{max-width:78%;padding:9px 12px;border-radius:4px;font-size:12.5px;line-height:1.75;
  white-space:pre-wrap;word-break:break-word;color:#333333;}
.ny-msg.sys .ny-bubble{background:#FFFFFF;border:1px solid #E9E2D8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 1px 3px rgba(31,48,73,.06);border-left:2px solid #D4502A;}
.ny-msg.me .ny-bubble{background:linear-gradient(180deg,#FBE3D6,#F7C0A0);border:1px solid #E9B391;color:#1F3049;}
.ny-msg-time{font-size:10px;color:#999;flex-shrink:0;padding-bottom:2px;}
.ny-msg.sys .ny-msg-time{order:-1;}

/* 快捷问题 */
.ny-chat-quick{display:flex;gap:6px;flex-wrap:wrap;padding:0 14px 10px;background:#FBF6EF;}
.ny-chat-quick button{font-family:inherit;font-size:11px;color:#1F3049;letter-spacing:.02em;
  background:#FFFFFF;border:1px solid #DDD5CA;border-radius:12px;padding:5px 10px;cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease;}
.ny-chat-quick button:hover{border-color:#D4502A;background:#FFF3EC;transform:translateY(-1px);}

/* 输入区 */
.ny-chat-foot{flex:0 0 auto;border-top:1px solid #E9E2D8;background:#FFFFFF;padding:10px 12px 9px;}
.ny-chat-input-row{display:flex;gap:8px;align-items:flex-end;}
.ny-chat-input{flex:1;min-width:0;height:52px;resize:none;font-family:inherit;font-size:12.5px;line-height:1.6;
  color:#333333;padding:8px 9px;border:1px solid #DDD5CA;border-radius:3px;background:#FDFBF8;
  outline:none;transition:border-color .16s ease,box-shadow .16s ease;}
.ny-chat-input:focus{border-color:#D4502A;box-shadow:0 0 0 2px rgba(212,80,42,.12);}
.ny-chat-send{height:52px;min-width:62px;padding:0 14px;cursor:pointer;font-family:inherit;
  font-size:12.5px;font-weight:600;letter-spacing:.08em;color:#FFFFFF;border:1px solid #8A3218;border-radius:3px;
  background-image:repeating-linear-gradient(102deg,rgba(255,255,255,.05) 0 1px,rgba(0,0,0,.02) 1px 3px),
    linear-gradient(180deg,#E97045 0%,#D4502A 48%,#C7441F 52%,#D4502A 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.32),inset 0 -2px 3px rgba(0,0,0,.22),0 2px 5px rgba(31,48,73,.2);
  transition:transform .14s ease,filter .14s ease,box-shadow .14s ease;}
.ny-chat-send:hover{filter:brightness(1.08);transform:translateY(-1px);}
.ny-chat-send:active{transform:translateY(1px);box-shadow:inset 0 2px 5px rgba(0,0,0,.35);}
.ny-chat-send:disabled{opacity:.6;cursor:not-allowed;transform:none;}
.ny-chat-foot-note{margin-top:7px;display:flex;justify-content:space-between;align-items:center;gap:8px;
  font-size:10px;color:#999;letter-spacing:.02em;line-height:1.5;}
.ny-chat-foot-note a{color:#B7522E;text-decoration:none;white-space:nowrap;}
.ny-chat-foot-note a:hover{text-decoration:underline;}

/* 律师回复气泡（律师在企业微信 / 回复台发出的消息） */
.ny-msg.lawyer .ny-bubble{background:#FFFFFF;border:1px solid #E9E2D8;border-left:2px solid #1F3049;
  color:#1F3049;box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 1px 3px rgba(31,48,73,.07);}
.ny-msg.lawyer .ny-msg-av{border:1px solid rgba(212,80,42,.65);}
.ny-msg.lawyer .ny-msg-time{order:-1;}

/* 窗口关闭期间收到律师回复：按钮右上角未读红点 */
.consult-btn{position:relative;}
.consult-btn.has-unread::after{content:"";position:absolute;top:1px;right:1px;
  width:10px;height:10px;border-radius:50%;background:#D4502A;border:2px solid #FFFFFF;
  box-shadow:0 0 0 1px rgba(138,50,24,.45),0 0 9px rgba(212,80,42,.85);}

@media (max-width:600px){
  .ny-chat{right:0;left:0;bottom:0;width:100%;height:min(78vh,560px);max-height:none;
    border-radius:12px 12px 0 0;border-left:none;border-right:none;border-bottom:none;}
  .ny-chat-mask{background:rgba(31,48,73,.42);pointer-events:auto;}
  .ny-chat.show{transform:translateY(0);}
}
