/* ===========================================================
   报表员 · 微信风格 WMS 数据问答
   =========================================================== */
:root {
  --wx-green: #07c160;
  --wx-bubble-me: #95ec69;
  --wx-bg: #f5f5f5;
  --wx-side: #ededed;
  --wx-line: #e3e3e3;
  --wx-ink: #191919;
  --wx-ink-2: #4a4a4a;
  --wx-muted: #9d9d9d;
  --wx-rail: #2e2e2e;
  --wx-card: #ffffff;
  --wx-blue: #1e88d7;
  --wx-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #1f2329;
  color: var(--wx-ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }

.wx {
  width: 100%;
  height: 100vh;
  display: flex;
  background: #fff;
  overflow: hidden;
}

/* ---------- 左侧导航栏 ---------- */
.wx-rail {
  width: 62px;
  flex: none;
  background: var(--wx-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 16px;
  gap: 6px;
}
.rail-avatar {
  width: 38px; height: 38px; border-radius: 8px;
  background: linear-gradient(135deg, #26b579, #0e8f60);
  color: #fff; font-size: 15px; font-weight: 600;
  display: grid; place-items: center; margin-bottom: 16px;
}
.rail-nav { display: flex; flex-direction: column; gap: 6px; }
.rail-btn {
  width: 40px; height: 40px; border: none; border-radius: 8px;
  background: transparent; color: #9a9a9a; cursor: pointer;
  display: grid; place-items: center;
}
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { color: #ddd; background: rgba(255, 255, 255, .06); }
.rail-btn.on { color: var(--wx-green); }
.rail-bottom { margin-top: auto; }

/* ---------- 会话列表 ---------- */
.wx-side {
  width: 262px; flex: none;
  background: var(--wx-side);
  border-right: 1px solid var(--wx-line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.wx-side-top {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 12px 10px;
}
.wx-search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 9px;
  background: #dedede; border-radius: 5px;
}
.wx-search svg { width: 14px; height: 14px; color: #7b7b7b; flex: none; }
.wx-search input {
  width: 100%; min-width: 0; border: none; outline: none;
  background: transparent; font-size: 12.5px; color: var(--wx-ink);
}
.wx-search input::placeholder { color: #8a8a8a; }
.wx-plus {
  width: 28px; height: 28px; border: none; border-radius: 5px;
  background: #dedede; color: #444; font-size: 16px; line-height: 1;
  cursor: pointer;
}
.wx-plus:hover { background: #d3d3d3; }

.wx-list { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.wx-item {
  width: 100%; border: none; background: transparent;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; text-align: left; cursor: pointer;
  border-bottom: 1px solid #e4e4e4;
}
.wx-item:hover { background: #e5e5e5; }
.wx-item.on { background: #d6d6d6; }
.wx-ava {
  width: 40px; height: 40px; flex: none; border-radius: 6px;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; color: #fff;
  overflow: hidden;
}
.wx-ava svg { width: 22px; height: 22px; }
.wx-ava.bot { background: linear-gradient(135deg, #1e98d7, #0b6fa8); }
.wx-ava.ops { background: #b06a3b; }
.wx-ava.group { background: #6f7f8f; }
.wx-ava.sys { background: #07c160; }
.wx-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wx-item-main b {
  font-size: 13.5px; font-weight: 500; color: var(--wx-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wx-item-main span {
  font-size: 11.5px; color: var(--wx-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wx-item-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex: none;
}
.wx-item-side em { font-style: normal; font-size: 10.5px; color: #a7a7a7; }
.wx-item-side .dot { width: 8px; height: 8px; border-radius: 50%; background: #fa5151; }

/* ---------- 主聊天区 ---------- */
.wx-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--wx-bg);
  min-height: 0;
}
.wx-head {
  height: 60px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: #f5f5f5;
  border-bottom: 1px solid #e6e6e6;
}
.wx-head-main { display: flex; align-items: baseline; gap: 12px; }
.wx-head-main b { font-size: 16px; font-weight: 600; }
.wx-head-main span { font-size: 11.5px; color: #8d8d8d; display: inline-flex; align-items: center; gap: 5px; }
.online { width: 6px; height: 6px; border-radius: 50%; background: var(--wx-green); display: inline-block; }
.wx-head-actions { display: flex; gap: 4px; }
.wx-head-actions button {
  width: 32px; height: 32px; border: none; border-radius: 5px;
  background: transparent; color: #555; cursor: pointer;
  display: grid; place-items: center;
}
.wx-head-actions button:hover { background: #e6e6e6; }
.wx-head-actions svg { width: 17px; height: 17px; }

.wx-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px 26px 18px;
  background: var(--wx-bg);
}
.wx-day {
  text-align: center; margin: 4px 0 14px;
}
.wx-day span {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10.5px; color: #9c9c9c; background: #e2e2e2;
}

.wx-msg {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.wx-msg.me { justify-content: flex-end; }
.wx-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 5px;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff;
}
.wx-avatar.bot { background: linear-gradient(135deg, #1e98d7, #0b6fa8); }
.wx-avatar.me { background: linear-gradient(135deg, #26b579, #0e8f60); }

.wx-bubble {
  position: relative; max-width: min(620px, 72%);
  padding: 10px 13px;
  background: #fff; border-radius: 5px;
  font-size: 13.5px; line-height: 1.62; color: var(--wx-ink);
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.wx-msg.bot .wx-bubble::before {
  content: ""; position: absolute; left: -6px; top: 12px;
  border: 6px solid transparent; border-right-color: #fff; border-left: none;
}
.wx-msg.me .wx-bubble {
  background: var(--wx-bubble-me);
}
.wx-msg.me .wx-bubble::before {
  content: ""; position: absolute; right: -6px; top: 12px;
  border: 6px solid transparent; border-left-color: var(--wx-bubble-me); border-right: none;
}
.wx-time {
  margin-top: 4px; font-size: 10px; color: #a2a2a2; text-align: right;
}
.wx-msg.me .wx-time { color: #7c9a6f; }

.wx-bubble p { margin: 0 0 6px; }
.wx-bubble p:last-child { margin-bottom: 0; }
.wx-bubble b { font-weight: 600; }
.wx-bubble .hl { color: var(--wx-blue); font-weight: 600; }
.wx-bubble .warn { color: #d64545; font-weight: 600; }
.wx-bubble ul { margin: 6px 0 2px; padding-left: 16px; }
.wx-bubble li { margin-bottom: 3px; }

/* ---------- 数据卡片 ---------- */
.wx-card {
  margin-top: 8px; background: #f8fbfd;
  border: 1px solid #e2eef7; border-radius: 8px;
  overflow: hidden;
}
.wx-card:first-child { margin-top: 2px; }
.wx-card-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; background: #eef7fe;
  font-size: 12px; color: #0b6fa8;
}
.wx-card-h b { font-size: 12.5px; font-weight: 600; }
.wx-card-h span { font-size: 10.5px; color: #7d90a3; }
.wx-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: #e2eef7;
}
.wx-stats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wx-stats > div {
  background: #fff; padding: 9px 11px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.wx-stats em {
  font-style: normal; font-size: 17px; font-weight: 650; color: var(--wx-ink);
  font-variant-numeric: tabular-nums;
}
.wx-stats em i { font-style: normal; font-size: 10px; color: #8a9aab; font-weight: 400; margin-left: 2px; }
.wx-stats span { font-size: 10.5px; color: #8a9aab; }
.wx-stats .up { color: #2e9e6b; }
.wx-stats .down { color: #d64545; }

.wx-table { width: 100%; border-collapse: collapse; font-size: 11.5px; background: #fff; }
.wx-table th {
  text-align: left; font-weight: 500; color: #7d90a3;
  padding: 6px 10px; background: #f4f9fd; white-space: nowrap;
}
.wx-table td {
  padding: 6px 10px; color: #33475b;
  border-top: 1px solid #eef4f9;
  white-space: nowrap;
}
.wx-table td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.wx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wx-table tr:last-child td { border-bottom: none; }
.wx-more { padding: 6px 10px; font-size: 10.5px; color: #8a9aab; background: #fff; border-top: 1px solid #eef4f9; }

.wx-bars { padding: 9px 11px 10px; display: flex; flex-direction: column; gap: 7px; background: #fff; }
.wx-bar-row { display: grid; grid-template-columns: 64px 1fr 36px; align-items: center; gap: 8px; font-size: 11px; color: #52677d; }
.wx-bar-row em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-bar-row .bar { height: 7px; border-radius: 4px; background: #e8f1f8; overflow: hidden; }
.wx-bar-row .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #38a8e6, #0b6fa8); }
.wx-bar-row b { text-align: right; font-weight: 600; color: #33475b; font-variant-numeric: tabular-nums; }

.wx-tip {
  margin-top: 8px; padding: 7px 10px;
  background: #fff7e8; border: 1px solid #f2dfbb; border-radius: 6px;
  font-size: 11.5px; color: #8a6417; line-height: 1.55;
}
.wx-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.wx-tags span {
  font-size: 10.5px; padding: 2px 7px; border-radius: 9px;
  background: #eef5fb; color: #3f6f92;
}

/* ---------- 输入中 ---------- */
.wx-typing { display: inline-flex; align-items: center; gap: 4px; height: 16px; }
.wx-typing i {
  width: 5px; height: 5px; border-radius: 50%; background: #9bb3c6;
  animation: wxBlink 1.2s infinite ease-in-out;
}
.wx-typing i:nth-child(2) { animation-delay: .15s; }
.wx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wxBlink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- 快捷问题 ---------- */
.wx-quick {
  flex: none;
  display: flex; gap: 6px; padding: 8px 22px 0;
  overflow-x: auto; background: #f5f5f5;
  scrollbar-width: none;
}
.wx-quick::-webkit-scrollbar { display: none; }
.wx-quick button {
  flex: none; border: 1px solid #dbe6ee; background: #fff;
  color: #42627d; font-size: 11.5px; padding: 5px 11px;
  border-radius: 13px; cursor: pointer; white-space: nowrap;
}
.wx-quick button:hover { border-color: #9cc8e8; color: #0b6fa8; background: #f4fbff; }

/* ---------- 输入区 ---------- */
.wx-compose {
  flex: none; background: #f5f5f5;
  border-top: 1px solid #e6e6e6;
  padding: 6px 22px 14px;
  display: flex; flex-direction: column;
}
.wx-tools { display: flex; gap: 2px; padding: 2px 0 4px; }
.wx-tools button {
  width: 28px; height: 28px; border: none; border-radius: 4px;
  background: transparent; color: #616161; cursor: pointer;
  display: grid; place-items: center;
}
.wx-tools button:hover { background: #e9e9e9; }
.wx-tools svg { width: 18px; height: 18px; }
.wx-input-wrap {
  background: #fff; border-radius: 6px; border: 1px solid #e5e5e5;
  padding: 7px 10px;
}
.wx-input-wrap textarea {
  width: 100%; min-height: 22px; max-height: 96px;
  border: none; outline: none; resize: none;
  font-family: inherit; font-size: 13px; line-height: 1.55; color: var(--wx-ink);
  background: transparent;
}
.wx-input-wrap textarea::placeholder { color: #b0b0b0; }
.wx-compose { position: relative; }
.wx-send {
  align-self: flex-end; margin-top: 8px;
  min-width: 78px; height: 30px; padding: 0 18px;
  border: none; border-radius: 4px;
  background: var(--wx-green); color: #fff; font-size: 13px;
  cursor: pointer;
}
.wx-send:hover { background: #06ad56; }
.wx-send:disabled { background: #b9e3c9; cursor: default; }

/* ---------- 滚动条 ---------- */
.wx-body::-webkit-scrollbar, .wx-list::-webkit-scrollbar { width: 8px; }
.wx-body::-webkit-scrollbar-thumb, .wx-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .16); border-radius: 4px;
}
.wx-body::-webkit-scrollbar-track, .wx-list::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .wx-side { display: none; }
  .wx-rail { width: 52px; }
  .wx-body { padding: 12px 12px 16px; }
  .wx-bubble { max-width: 86%; }
  .wx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
