/* ============================================================
   淘小蜜 · 客服系统公共样式
   主题变量取自 chatui 3.1.29 默认主题 + alime-alicare 3.11.16
   ============================================================ */
:root{
  --brand-1:#ff5000;
  --brand-2:#ff9000;
  --brand-3:#fff9eb;
  --brand-4:#ffefe5;
  --black:#000; --white:#fff;
  --gray-1:#111; --gray-2:#666; --gray-3:#999; --gray-4:#ccc;
  --gray-5:#ddd; --gray-6:#eee; --gray-7:#f5f5f5; --gray-8:#f8f8f8;
  --light-1:#eee; --light-2:#f5f5f5;
  --fill-1:#ffffff;
  --fill-2:#f8f8f8;
  --red:#ff3634;
  --blue:#39f;
  --green:#1dbf1d;
  --gutter:12px;
  --navbar-h:50px;
  --action-size:37px;
  --shadow-1:0 3px 4px 0 rgba(0,0,0,.04);
  --shadow-2:0 4px 8px 0 rgba(0,0,0,.08);
  --font:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0}
body{font-family:var(--font);color:var(--gray-1);background:#eceef1}
button{font-family:inherit}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-thumb{background:rgba(0,0,0,.14);border-radius:3px}
::-webkit-scrollbar-track{background:transparent}

/* ============================================================
   一、访客端 ChatApp（与线上页面 1:1）
   ============================================================ */
.ChatApp{
  position:relative;
  width:960px;height:100vh;
  display:flex;flex-direction:column;
  background:var(--white);
  overflow:hidden;
  box-shadow:0 0 0 1px rgba(0,0,0,.04);
}
.HeaderX{flex:0 0 auto;background:var(--fill-2);position:relative;z-index:10}
.Navbar{
  height:var(--navbar-h);
  display:flex;align-items:center;
  padding:0 13px;
  border-bottom:1px solid var(--gray-5);
  background:transparent;
}
.Navbar-left{display:flex;align-items:center;flex:0 0 auto}
.Navbar-main{flex:1;display:flex;align-items:center;min-height:34px}
.Navbar-right{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto}
.Btn{
  display:inline-flex;align-items:center;justify-content:center;
  margin:0;padding:0;border:1px solid transparent;background:transparent;
  cursor:pointer;color:inherit;overflow:visible;
}
.IconBtn{width:34px;height:34px;border-radius:50%;color:var(--gray-1)}
.IconBtn svg{width:22px;height:22px;display:block}
.Navbar-title{font-size:17px;font-weight:500;color:var(--gray-1);margin:0 0 0 8px;line-height:32px;letter-spacing:.2px}
.Navbar-sub{font-size:12px;color:var(--gray-2);margin-left:8px;line-height:32px}

.MessageContainer{flex:1 1 auto;min-height:0;background:#f5f5f5;display:flex;flex-direction:column}
.PullToRefresh{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 13px 12px}
.PullToRefresh-loadMore{
  display:block;margin:12px auto 0;padding:0;border:0;background:transparent;
  font-size:14px;line-height:22px;color:var(--gray-2);cursor:pointer;
}
.Message{display:flex;align-items:flex-start;margin-top:13px}
.Message-main{display:flex;align-items:flex-start;width:100%}
.Avatar{
  flex:0 0 auto;width:38px;height:38px;border-radius:50%;overflow:hidden;margin-right:5px;
  background:linear-gradient(160deg,#ffe7d2 0%,#ffd0b0 100%);
  display:flex;align-items:center;justify-content:center;
  font-size:14px;color:#a8551f;
}
.Avatar img{width:100%;height:100%;display:block;object-fit:cover}
.Message-content{flex:1 1 auto;min-width:0;display:flex}
.Bubble{
  max-width:100%;background:var(--white);border-radius:12px;
  box-shadow:var(--shadow-1);border:1px solid #f0f0f0;
  padding:15px 14px 14px;
  font-size:15px;line-height:24px;color:var(--gray-1);
  white-space:pre-wrap;word-wrap:break-word;
}
.Message.right .Message-main{flex-direction:row-reverse}
.Message.right .Avatar{margin-right:0;margin-left:5px;background:linear-gradient(160deg,#e8f0ff,#d6e4ff);color:#3a6bbf}
.Message.right .Message-content{justify-content:flex-end}
.Message.right .Bubble{background:var(--brand-3);border-color:#ffe9d8}
.Message.system{justify-content:center;margin-top:13px}
.Message.system .sys{
  font-size:12px;color:var(--gray-3);background:rgba(0,0,0,.04);
  padding:3px 10px;border-radius:99px;
}

.Message-quick{margin-top:13px;display:flex;padding-left:43px}
.quick-card{
  display:flex;align-items:center;justify-content:space-between;
  width:433px;min-height:39px;padding:0 14px;
  background:var(--brand-3);border:1px solid #ffe3cf;border-radius:10px;
  color:#8a4a12;font-size:14px;line-height:20px;cursor:pointer;text-align:left;
}
.quick-card .arrow{flex:0 0 auto;margin-left:10px;color:#c9a68c}
.quick-card .arrow svg{width:14px;height:14px;display:block}

.QuickReplies{
  flex:0 0 auto;position:relative;display:flex;align-items:center;
  padding:9px 0;height:53px;
  background:linear-gradient(180deg,#f5f5f5 0%,#fdf8f3 100%);
}
.ScrollView-control{
  flex:0 0 auto;width:34px;height:33px;border:0;background:transparent;
  color:var(--gray-3);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;
}
.ScrollView-control svg{width:16px;height:16px}
.ScrollView-control--prev{margin-left:13px}
.ScrollView-control--next{margin-right:13px}
.ScrollView{flex:1 1 auto;min-width:0;overflow-x:auto;display:flex;align-items:center;gap:8px;padding:0}
.ScrollView::-webkit-scrollbar{height:0}
.QuickReply{
  display:inline-flex;align-items:center;height:35px;padding:0 12px;border-radius:99px;
  background:var(--fill-1);border:1px solid #ffd0bf;
  font-size:14px;line-height:20px;font-weight:500;color:var(--gray-1);
  white-space:nowrap;cursor:pointer;flex:0 0 auto;position:relative;
}
.QuickReply::after{
  content:"";position:absolute;right:2px;top:2px;width:6px;height:6px;border-radius:50%;
  background:var(--red);border:1px solid #fff;
}

.Composer{
  flex:0 0 auto;display:flex;align-items:center;
  padding:9px 13px;gap:8px;
  background:linear-gradient(180deg,#ffffff 0%,#fdf8f3 100%);
}
.Composer-action{
  flex:0 0 auto;width:var(--action-size);height:var(--action-size);
  border:0;background:transparent;border-radius:50%;color:var(--gray-1);
  display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;
}
.Composer-action svg{width:24px;height:24px;display:block}
.Composer-action:hover{background:rgba(0,0,0,.04)}
.Composer-inputWrap{flex:1 1 auto;min-width:0}
.Input{
  display:block;width:100%;height:var(--action-size);padding:0 12px;
  background:var(--white);border:1px solid var(--gray-6);border-radius:12px;
  color:var(--gray-1);font-size:15px;line-height:35px;outline:none;resize:none;
  font-family:inherit;
}
.Input::placeholder{color:var(--gray-4)}
.Input:focus{border-color:var(--brand-1)}
.Composer-sendBtn{
  flex:0 0 auto;height:var(--action-size);padding:0 16px;
  border:1px solid transparent;border-radius:999px;
  background:linear-gradient(90deg,var(--brand-2) 0%,var(--brand-1) 98%);
  color:#fff;font-size:14px;line-height:18px;cursor:pointer;transition:.15s ease-in-out;
}
.Composer-sendBtn:active{opacity:.8}

/* ============================================================
   二、客服工作台 Console
   ============================================================ */
.Console{display:flex;flex-direction:column;height:100vh;background:#eceef1}

/* 顶栏 */
.Topbar{
  flex:0 0 auto;height:50px;display:flex;align-items:center;
  padding:0 16px;background:var(--white);border-bottom:1px solid #e8e8e8;
  gap:14px;
}
.Topbar-logo{
  display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;letter-spacing:.2px;
}
.Topbar-logo .dot{width:20px;height:20px;border-radius:6px;background:linear-gradient(135deg,var(--brand-2),var(--brand-1))}
.Topbar-logo .tag{
  font-size:11px;font-weight:500;color:var(--brand-1);background:var(--brand-3);
  border:1px solid #ffe3cf;border-radius:99px;padding:1px 8px;
}
.Topbar-spacer{flex:1}
.Topbar-stat{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--gray-2)}
.Topbar-stat b{color:var(--brand-1);font-size:14px}
.Topbar-me{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--gray-1)}
.Topbar-me .ava{
  width:28px;height:28px;border-radius:50%;background:linear-gradient(160deg,#ffe2cc,#ffc39a);
  display:flex;align-items:center;justify-content:center;font-size:13px;color:#a8551f;
}
.Topbar-me .st{width:6px;height:6px;border-radius:50%;background:var(--green)}

/* 三栏 */
.Console-body{flex:1 1 auto;min-height:0;display:flex;padding:12px;gap:12px}

/* 左：会话列表 */
.Sidebar{
  flex:0 0 268px;display:flex;flex-direction:column;min-height:0;
  background:var(--white);border-radius:12px;box-shadow:var(--shadow-1);overflow:hidden;
}
.Sidebar-head{flex:0 0 auto;padding:12px 12px 8px}
.Sidebar-title{display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:600;margin-bottom:10px}
.Sidebar-title .cnt{font-size:12px;font-weight:400;color:var(--gray-2)}
.Search{
  display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;
  background:var(--gray-8);border-radius:8px;color:var(--gray-3);
}
.Search svg{width:15px;height:15px;flex:0 0 auto}
.Search input{border:0;background:transparent;outline:none;font-size:13px;color:var(--gray-1);width:100%}
.ConvList{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 8px 8px}
.Conv{
  display:flex;gap:10px;padding:10px;border-radius:10px;cursor:pointer;position:relative;
  transition:background .12s;
}
.Conv:hover{background:var(--gray-8)}
.Conv.active{background:var(--brand-3)}
.Conv-ava{
  flex:0 0 auto;width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:14px;color:#8a4a12;
}
.Conv-body{flex:1 1 auto;min-width:0}
.Conv-row1{display:flex;align-items:center;gap:6px}
.Conv-name{font-size:13.5px;font-weight:500;color:var(--gray-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.Conv-time{margin-left:auto;font-size:11px;color:var(--gray-3);flex:0 0 auto}
.Conv-preview{
  margin-top:4px;font-size:12px;color:var(--gray-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:18px;
}
.Conv-badge{
  position:absolute;right:10px;bottom:12px;min-width:16px;height:16px;padding:0 4px;
  border-radius:99px;background:var(--brand-1);color:#fff;font-size:11px;line-height:16px;text-align:center;
}
.Conv-tagBot,.Conv-tagHuman,.Conv-tagClosed{
  font-size:10px;line-height:14px;padding:0 5px;border-radius:4px;flex:0 0 auto;
}
.Conv-tagBot{color:#0a7c4a;background:#e6f7ee}
.Conv-tagHuman{color:var(--brand-1);background:var(--brand-3);border:1px solid #ffe3cf}
.Conv-tagClosed{color:var(--gray-3);background:var(--gray-7)}

/* 中：聊天区 */
.ChatCol{
  flex:1 1 auto;min-width:0;display:flex;flex-direction:column;min-height:0;
  background:var(--white);border-radius:12px;box-shadow:var(--shadow-1);overflow:hidden;
}
.Chat-head{
  flex:0 0 auto;height:52px;display:flex;align-items:center;gap:10px;
  padding:0 14px;border-bottom:1px solid #f0f0f0;
}
.Chat-head .name{font-size:14.5px;font-weight:600}
.Chat-head .meta{font-size:12px;color:var(--gray-2)}
.Chat-head .spacer{flex:1}
.Pill{
  font-size:12px;padding:3px 10px;border-radius:99px;border:1px solid var(--gray-6);
  background:var(--white);color:var(--gray-2);cursor:pointer;
}
.Pill:hover{border-color:var(--brand-1);color:var(--brand-1)}
.Pill.primary{background:linear-gradient(90deg,var(--brand-2),var(--brand-1));color:#fff;border-color:transparent}
.Pill.ghost{background:var(--gray-8);border-color:transparent}

.Chat-stream{flex:1 1 auto;min-height:0;overflow-y:auto;padding:14px 16px;background:#fafafa}
.Chat-stream .Message{margin-top:12px}
.Chat-stream .Message:first-child{margin-top:0}
.Chat-stream .Bubble{padding:12px 14px;font-size:14.5px;line-height:22px}
.Chat-stream .Avatar{width:34px;height:34px;font-size:13px}
.Chat-empty{
  height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--gray-3);font-size:13px;gap:8px;
}
.Chat-empty .big{font-size:34px;opacity:.35}

/* 中：发送区 */
.Chat-foot{
  flex:0 0 auto;border-top:1px solid #f0f0f0;padding:10px 14px 12px;
  background:linear-gradient(180deg,#fff 0%,#fdf8f3 100%);
}
.Foot-tools{display:flex;align-items:center;gap:8px;margin-bottom:8px;overflow-x:auto}
.Foot-tools::-webkit-scrollbar{height:0}
.Chip{
  flex:0 0 auto;height:26px;padding:0 10px;border-radius:99px;font-size:12px;
  border:1px solid #ffd0bf;background:#fff;color:#8a4a12;cursor:pointer;
}
.Chip:hover{background:var(--brand-3)}
.Foot-row{display:flex;align-items:flex-end;gap:8px}
.Foot-row .Composer-action{width:32px;height:32px;color:var(--gray-2)}
.Foot-row .Composer-action svg{width:20px;height:20px}
.Foot-input{
  flex:1 1 auto;min-width:0;height:64px;padding:8px 12px;border:1px solid var(--gray-6);
  border-radius:10px;font-size:14px;line-height:20px;resize:none;outline:none;font-family:inherit;
  color:var(--gray-1);background:#fff;
}
.Foot-input:focus{border-color:var(--brand-1)}
.Foot-send{
  flex:0 0 auto;height:64px;padding:0 20px;border:0;border-radius:12px;
  background:linear-gradient(90deg,var(--brand-2),var(--brand-1));color:#fff;
  font-size:14px;cursor:pointer;
}
.Foot-send:active{opacity:.85}

/* 右：客户资料 */
.Profile{
  flex:0 0 280px;display:flex;flex-direction:column;gap:12px;min-height:0;
  overflow-y:auto;padding-bottom:2px;
}
.Card{
  flex:0 0 auto;
  background:var(--white);border-radius:12px;box-shadow:var(--shadow-1);padding:14px;
}
.Profile-top{display:flex;flex-direction:column;align-items:center;gap:8px;padding:6px 0 4px}
.Profile-ava{
  width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:20px;color:#8a4a12;
}
.Profile-name{font-size:15px;font-weight:600}
.Profile-sub{font-size:12px;color:var(--gray-2)}
.TagRow{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.Tag{font-size:11px;padding:2px 8px;border-radius:99px;background:var(--gray-8);color:var(--gray-2)}
.Tag.hot{background:var(--brand-3);color:var(--brand-1);border:1px solid #ffe3cf}
.KV{display:flex;justify-content:space-between;font-size:12.5px;padding:7px 0;border-bottom:1px dashed #f0f0f0}
.KV:last-child{border-bottom:0}
.KV span:first-child{color:var(--gray-3)}
.Card-title{font-size:13px;font-weight:600;margin-bottom:6px}
.Acts{display:flex;gap:8px;flex-wrap:wrap}
.Acts .Pill{flex:1 1 auto;text-align:center;padding:7px 0}

.Toast{
  position:fixed;left:50%;bottom:28px;transform:translateX(-50%) translateY(8px);
  background:rgba(17,17,17,.86);color:#fff;font-size:13px;padding:8px 16px;border-radius:8px;
  opacity:0;pointer-events:none;transition:.2s;z-index:99;
}
.Toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
