/* ============================ 工作台布局 ============================ */
.app-body {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.rail {
  width: 72px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 14px;
  gap: 8px;
}
.rail-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #6366f1, #4338ca);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 14px rgba(79, 70, 229, 0.3);
  margin-bottom: 10px;
}
.rail-logo svg {
  width: 22px;
  height: 22px;
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.rail-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: #8b93a7;
  display: grid;
  place-items: center;
  transition: 0.16s;
}
.rail-btn svg {
  width: 21px;
  height: 21px;
}
.rail-btn:hover {
  background: #f4f5fa;
  color: var(--ink-2);
}
.rail-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.rail-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.rail-btn[data-tip] {
  position: relative;
}
.rail-btn[data-tip]:hover::after,
.rail-avatar[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 52px;
  top: 50%;
  transform: translateY(-50%);
  background: #101828;
  color: #fff;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 40;
  pointer-events: none;
}
.rail-avatar[data-tip] {
  position: relative;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.view {
  display: none;
  flex: 1;
  min-height: 0;
}
.view.active {
  display: flex;
  flex-direction: column;
}
#view-chats.active {
  flex-direction: row;
}

/* ============================ 会话列表 ============================ */
.conv-col {
  width: 336px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.conv-head {
  padding: 18px 16px 10px;
  flex: none;
}
.conv-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.conv-title-row h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.conv-title-row h2 span {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 500;
  margin-left: 3px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #067647;
  background: var(--green-soft);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.live-pill .dot {
  width: 5px;
  height: 5px;
}
.search {
  position: relative;
  margin-bottom: 10px;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 33px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fafbfe;
  outline: none;
  font-size: 12.5px;
  transition: 0.15s;
}
.search input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.filters {
  display: flex;
  gap: 2px;
  background: #f4f5fa;
  border-radius: 9px;
  padding: 3px;
}
.filters button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  transition: 0.15s;
  font-weight: 500;
}
.filters button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
}
.conv-item {
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 11px;
  cursor: pointer;
  align-items: flex-start;
  transition: background 0.14s;
  position: relative;
}
.conv-item:hover {
  background: #f8f9fd;
}
.conv-item.active {
  background: var(--brand-soft);
}
.conv-item .avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
  position: relative;
}
.online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
}
.conv-body {
  flex: 1;
  min-width: 0;
}
.conv-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conv-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.conv-time {
  font-size: 10.5px;
  color: var(--muted-2);
  flex: none;
}
.conv-last {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.5;
}
.conv-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.conv-meta .tag {
  height: 18px;
  font-size: 10px;
  padding: 0 6px;
}
.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.conv-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ============================ 聊天区 ============================ */
.chat-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f7f8fc;
  position: relative;
}
.chat-head {
  height: 64px;
  flex: none;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
}
.chat-head .avatar {
  width: 36px;
  height: 36px;
}
.ch-who {
  min-width: 0;
}
.ch-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ch-sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ch-sub .dot {
  width: 6px;
  height: 6px;
}
.ch-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mobile-back {
  display: none;
}
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 8px;
}
.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 18px;
  color: var(--muted-2);
  font-size: 11px;
}
.day-divider::before,
.day-divider::after {
  content: "";
  height: 1px;
  background: #e7e9f0;
  flex: 1;
}
.msg-row {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  align-items: flex-end;
  animation: msgIn 0.2s ease both;
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.msg-row .avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}
.msg-row.me {
  flex-direction: row-reverse;
}
.msg-col {
  max-width: min(66%, 620px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-row.me .msg-col {
  align-items: flex-end;
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.msg-row.me .msg-bubble {
  background: linear-gradient(135deg, #5b52ee, #4f46e5);
  color: #fff;
  border-color: transparent;
  border-bottom-right-radius: 5px;
}
.msg-row.them .msg-bubble {
  border-bottom-left-radius: 5px;
}
.msg-bubble a {
  color: inherit;
  text-decoration: underline;
}
.msg-meta {
  font-size: 10.5px;
  color: var(--muted-2);
  padding: 0 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.msg-system {
  text-align: center;
  margin: 16px 0;
}
.msg-system span {
  display: inline-block;
  background: #eceef5;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 99px;
}
.typing-row {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 11px 14px;
  border-radius: 14px;
  width: fit-content;
  margin-bottom: 14px;
}
.typing-row i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #98a2b3;
  animation: blink 1.2s infinite;
}
.typing-row i:nth-child(2) {
  animation-delay: 0.18s;
}
.typing-row i:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
.chat-end-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 11.5px;
  margin: 14px 0 4px;
}

/* 输入区 */
.composer {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 16px 12px;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}
.tool-btn:hover {
  background: #f4f5fa;
  color: var(--ink-2);
}
.tool-btn svg {
  width: 15px;
  height: 15px;
}
.composer-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfe;
  transition: 0.15s;
  padding: 8px 10px;
}
.composer-box:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.composer-box textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  font-size: 13.5px;
  line-height: 1.7;
  padding: 0;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.composer-foot .hint {
  font-size: 11px;
  margin: 0;
}
.send-btn {
  height: 30px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  transition: 0.15s;
}
.send-btn:hover {
  background: var(--brand-600);
}
.send-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 弹出层 */
.popover {
  position: absolute;
  bottom: 96px;
  left: 16px;
  width: 320px;
  max-height: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 20;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.popover-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popover-list {
  overflow-y: auto;
  padding: 6px;
}
.qr-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.qr-item:hover {
  background: var(--brand-soft);
}
.qr-item b {
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.qr-item p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
}
.emoji-grid button {
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 17px;
}
.emoji-grid button:hover {
  background: #f4f5fa;
}

/* ============================ 访客信息 ============================ */
.info-col {
  width: 296px;
  flex: none;
  background: #fff;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px 18px 28px;
}
.info-sec {
  margin-bottom: 22px;
}
.info-sec h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.info-profile {
  text-align: center;
  padding: 6px 0 4px;
}
.info-profile .avatar {
  width: 54px;
  height: 54px;
  font-size: 19px;
  margin: 0 auto 9px;
}
.info-profile b {
  font-size: 14px;
  display: block;
}
.info-profile span {
  font-size: 11.5px;
  color: var(--muted);
}
.info-profile .tag {
  margin-top: 8px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #f0f1f6;
  font-size: 12.5px;
}
.kv:last-child {
  border-bottom: none;
}
.kv span {
  color: var(--muted);
  flex: none;
}
.kv b {
  font-weight: 500;
  color: var(--ink-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}
.kv a {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-edit .tag {
  cursor: pointer;
}
.tag-edit .tag i {
  font-style: normal;
  opacity: 0.6;
  font-size: 12px;
}
.tag-add {
  border: 1px dashed #d0d5dd;
  background: transparent;
  color: var(--muted);
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
}
.tag-add:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.note-box textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  resize: vertical;
  outline: none;
  background: #fafbfe;
}
.note-box textarea:focus {
  border-color: var(--brand);
  background: #fff;
}
.note-box .btn {
  margin-top: 7px;
}
.hist-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: 0.15s;
  background: #fff;
}
.hist-item:hover {
  border-color: #c9cde0;
  box-shadow: var(--shadow-xs);
}
.hist-item b {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}
.hist-item span {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 400;
}
.hist-item p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rating-stars {
  color: #f79009;
  letter-spacing: 1px;
  font-size: 13px;
}

/* ============================ 页面通用 ============================ */
.page-head {
  padding: 24px 28px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex: none;
}
.page-head h1 {
  margin: 0 0 3px;
  font-size: 21px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.page-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 32px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h3 {
  margin: 0 0 2px;
  font-size: 14.5px;
  font-weight: 650;
}
.panel-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.panel-head code {
  background: #f4f5fa;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
.panel-count {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 500;
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.kpi b {
  font-size: 27px;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.1;
}
.kpi b small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
  letter-spacing: 0;
}
.kpi .kpi-ico {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.kpi .kpi-foot {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.kpi .kpi-foot em {
  font-style: normal;
  color: var(--green);
  font-weight: 600;
}

/* 图表 */
.chart-wrap {
  height: 216px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 10px;
}
.chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  width: 100%;
  justify-content: center;
}
.chart-bars i {
  display: block;
  width: 14px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  min-height: 3px;
  transition: height 0.4s ease;
  position: relative;
}
.chart-bars i.msg {
  background: #dfe3f7;
}
.chart-bars i:hover::after {
  content: attr(data-v);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #101828;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.chart-x {
  font-size: 10.5px;
  color: var(--muted-2);
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}
.lg-conv {
  background: var(--brand);
}
.lg-msg {
  background: #dfe3f7;
}
.dash-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.page-list .pl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #f0f1f6;
  font-size: 12.5px;
}
.page-list .pl-item:last-child {
  border-bottom: none;
}
.pl-item .pl-idx {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #f4f5fa;
  color: var(--muted);
  font-size: 10.5px;
  display: grid;
  place-items: center;
  flex: none;
}
.pl-item .pl-main {
  flex: 1;
  min-width: 0;
}
.pl-item b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-item span {
  font-size: 10.5px;
  color: var(--muted-2);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-item em {
  font-style: normal;
  font-size: 12px;
  color: var(--brand-600);
  font-weight: 600;
}

.recent-list .rc-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #f0f1f6;
  cursor: pointer;
}
.recent-list .rc-item:last-child {
  border-bottom: none;
}
.rc-item .avatar {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}
.rc-main {
  flex: 1;
  min-width: 0;
}
.rc-main b {
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.rc-main b span {
  font-size: 10.5px;
  color: var(--muted-2);
  font-weight: 400;
}
.rc-main p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================ 快捷回复页 ============================ */
.quick-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 16px;
  align-items: start;
}
.qr-form .btn {
  width: 100%;
}
.qr-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  transition: 0.15s;
}
.qr-card:hover {
  border-color: #cfd4e2;
  box-shadow: var(--shadow-xs);
}
.qr-card .qc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.qr-card b {
  font-size: 13px;
}
.qr-card .qc-del {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
}
.qr-card .qc-del:hover {
  background: var(--red-soft);
  color: var(--red);
}
.qr-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ============================ 设置 ============================ */
.settings-wrap {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 0 28px 0;
  min-height: 0;
}
.set-nav {
  width: 172px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 20px;
}
.set-nav button {
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  transition: 0.15s;
}
.set-nav button:hover {
  background: #eef0f7;
  color: var(--ink-2);
}
.set-nav button.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.set-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-bottom: 40px;
}
.set-pane {
  display: none;
}
.set-pane.active {
  display: block;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inline-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  font-size: 12.5px;
  color: var(--muted);
}
.save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 4px 0 24px;
}
.save-hint {
  font-size: 12px;
  color: var(--muted-2);
}
.swatches {
  display: flex;
  gap: 9px;
}
.swatches button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid transparent;
  background: var(--c);
  position: relative;
  transition: 0.15s;
}
.swatches button:hover {
  transform: scale(1.08);
}
.swatches button.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c);
}
.swatches button.active::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.seg {
  display: inline-flex;
  background: #f4f5fa;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg button {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.seg button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  font-weight: 500;
}
.preview-wrap {
  background: #f7f8fc;
  border: 1px dashed #dfe3ef;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  min-height: 300px;
}
.pv-window {
  width: 290px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.pv-head {
  padding: 12px 14px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #fff;
  transition: background 0.2s;
}
.pv-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.pv-head b {
  font-size: 12.5px;
  display: block;
}
.pv-head span {
  font-size: 10.5px;
  opacity: 0.85;
}
.pv-body {
  padding: 14px 12px;
  background: #fafbff;
  min-height: 130px;
}
.pv-bubble {
  background: #f2f4f8;
  border-radius: 11px;
  border-bottom-left-radius: 4px;
  padding: 8px 11px;
  font-size: 11.5px;
  max-width: 84%;
  margin-bottom: 8px;
  line-height: 1.6;
}
.pv-bubble.me {
  margin-left: auto;
  color: #fff;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 4px;
  transition: background 0.2s;
}
.pv-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--muted-2);
}
.pv-input span {
  flex: 1;
  background: #f6f7fb;
  border-radius: 7px;
  padding: 6px 9px;
}
.pv-input b {
  font-size: 11px;
  transition: color 0.2s;
}
.pv-launcher {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.18);
  margin-bottom: 4px;
}
.pv-launcher svg {
  width: 22px;
  height: 22px;
}
.team-list .tm-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px dashed #f0f1f6;
}
.team-list .tm-item:last-child {
  border-bottom: none;
}
.tm-main {
  flex: 1;
  min-width: 0;
}
.tm-main b {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tm-main span {
  font-size: 11.5px;
  color: var(--muted);
}
.team-form {
  max-width: 520px;
}
.snippet-box {
  width: 100%;
  background: #0f1222;
  color: #c8cde0;
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
}
.snippet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.kv-list {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.kv-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 12.5px;
}
.kv-list span {
  color: var(--muted);
}
.kv-list code {
  font-family: ui-monospace, monospace;
  background: #f4f5fa;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
  word-break: break-all;
  text-align: right;
}
.warn-box {
  margin-top: 18px;
  background: #fffaeb;
  border: 1px solid #fdead0;
  border-radius: 10px;
  padding: 13px 15px;
}
.warn-box b {
  font-size: 12.5px;
  color: #b54708;
}
.warn-box p {
  margin: 4px 0 9px;
  font-size: 12px;
  color: #7a5220;
  line-height: 1.7;
}
.tip-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 2;
}

/* 下拉菜单 */
.dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 5px;
  min-width: 150px;
  z-index: 30;
}
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.dropdown button:hover {
  background: #f4f5fa;
}

/* ============================ 响应式 ============================ */
@media (max-width: 1280px) {
  .info-col {
    width: 270px;
  }
  .conv-col {
    width: 310px;
  }
}
@media (max-width: 1140px) {
  .info-col {
    display: none;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .conv-col {
    width: 280px;
  }
  .dash-2col,
  .quick-layout {
    grid-template-columns: 1fr;
  }
  .settings-wrap {
    padding: 0 16px;
  }
  .set-nav {
    width: 140px;
  }
  .scroll-area,
  .page-head {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 760px) {
  .rail {
    width: 56px;
  }
  .rail-btn {
    width: 38px;
    height: 38px;
  }
  .rail-btn.active::before {
    left: -9px;
  }
  .conv-col {
    width: 100%;
  }
  .chat-col {
    display: none;
  }
  .app-body.chat-open .conv-col {
    display: none;
  }
  .app-body.chat-open .chat-col {
    display: flex;
  }
  .mobile-back {
    display: inline-flex;
  }
  .msg-col {
    max-width: 80%;
  }
  .chat-msgs {
    padding: 16px 14px 8px;
  }
  .info-col {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .set-nav {
    width: 118px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}
