/* ============================================================
   情途科技客服系统 · 设计系统 v1.0
   2026-11-04

   设计语言：
     · 干净、克制、专业。不用玻璃拟态、不用渐变大色块。
     · 层级靠留白和细边框区分，不靠阴影堆叠。
     · 所有交互动效 ≤ 180ms，不炫技。
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  /* 品牌 */
  --qt-primary:        #2B5CE6;
  --qt-primary-hover:  #1E4BD1;
  --qt-primary-soft:   #EEF3FF;
  --qt-primary-line:   #C7D8FE;

  --qt-success:        #00C48C;
  --qt-success-soft:   #E6FAF4;
  --qt-warning:        #F59E0B;
  --qt-warning-soft:   #FEF6E7;
  --qt-danger:         #EF4444;
  --qt-danger-soft:    #FEECEC;

  /* 中性 */
  --qt-text:           #0F172A;
  --qt-text-2:         #475569;
  --qt-text-3:         #94A3B8;
  --qt-line:           #E2E8F0;
  --qt-line-2:         #EEF2F7;
  --qt-bg:             #F6F8FB;
  --qt-bg-2:           #FFFFFF;
  --qt-bg-3:           #FBFCFE;

  /* 尺寸 */
  --qt-r-sm: 8px;
  --qt-r:    12px;
  --qt-r-lg: 16px;
  --qt-r-pill: 999px;

  /* 阴影（只用两档） */
  --qt-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --qt-shadow:    0 4px 16px rgba(15, 23, 42, .07);

  /* 字体 */
  --qt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
             "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --qt-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 动效 */
  --qt-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--qt-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--qt-text);
  background: var(--qt-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--qt-primary); text-decoration: none; }
a:hover { color: var(--qt-primary-hover); }
img { max-width: 100%; display: block; }

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--qt-r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: content-box; }

/* ---------- 布局 ---------- */
.qt-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.qt-page {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.qt-page--wide { max-width: 1440px; }
.qt-page--full { max-width: none; padding: 0; }

.qt-row { display: flex; align-items: center; gap: 10px; }
.qt-row--between { justify-content: space-between; }
.qt-col { display: flex; flex-direction: column; gap: 10px; }
.qt-grow { flex: 1; min-width: 0; min-height: 0; }

/* ---------- 卡片 ---------- */
.qt-card {
  background: var(--qt-bg-2);
  border: 1px solid var(--qt-line);
  border-radius: var(--qt-r);
  box-shadow: var(--qt-shadow-sm);
}

.qt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--qt-line-2);
}

.qt-card__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.qt-card__body { padding: 16px; }
.qt-card__body--flush { padding: 0; }

/* ---------- 顶栏 ---------- */
.qt-topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--qt-bg-2);
  border-bottom: 1px solid var(--qt-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.qt-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--qt-text);
}

.qt-brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--qt-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.qt-brand__sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--qt-text-3);
  margin-left: 2px;
}

/* ---------- 按钮 ---------- */
.qt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--qt-r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--qt-text-2);
  background: var(--qt-bg-2);
  border: 1px solid var(--qt-line);
  transition: all .18s var(--qt-ease);
  white-space: nowrap;
  user-select: none;
}

.qt-btn:hover {
  color: var(--qt-text);
  border-color: #CBD5E1;
  background: var(--qt-bg-3);
}

.qt-btn:active { transform: scale(.98); }

.qt-btn--primary {
  color: #fff;
  background: var(--qt-primary);
  border-color: var(--qt-primary);
  box-shadow: 0 1px 2px rgba(43, 92, 230, .25);
}
.qt-btn--primary:hover {
  background: var(--qt-primary-hover);
  border-color: var(--qt-primary-hover);
  color: #fff;
}

.qt-btn--ghost { background: transparent; border-color: transparent; }
.qt-btn--ghost:hover { background: var(--qt-line-2); border-color: transparent; }

.qt-btn--danger { color: var(--qt-danger); border-color: #FBD5D5; background: var(--qt-danger-soft); }
.qt-btn--danger:hover { color: #fff; background: var(--qt-danger); border-color: var(--qt-danger); }

.qt-btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.qt-btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.qt-btn--block { width: 100%; }

.qt-btn--icon { width: 36px; padding: 0; }
.qt-btn--icon.qt-btn--sm { width: 30px; }

/* ---------- 表单 ---------- */
.qt-field { display: flex; flex-direction: column; gap: 6px; }

.qt-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--qt-text-2);
}

.qt-input,
.qt-select,
.qt-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--qt-text);
  background: var(--qt-bg-2);
  border: 1px solid var(--qt-line);
  border-radius: var(--qt-r-sm);
  outline: none;
  transition: border-color .18s var(--qt-ease), box-shadow .18s var(--qt-ease);
}

.qt-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.6; }

.qt-input::placeholder,
.qt-textarea::placeholder { color: var(--qt-text-3); }

.qt-input:focus,
.qt-select:focus,
.qt-textarea:focus {
  border-color: var(--qt-primary);
  box-shadow: 0 0 0 3px rgba(43, 92, 230, .12);
}

.qt-input--error { border-color: var(--qt-danger); }

.qt-hint { font-size: 12px; color: var(--qt-text-3); line-height: 1.5; }

.qt-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: var(--qt-r-pill);
  background: #CBD5E1;
  transition: background .2s var(--qt-ease);
  flex-shrink: 0;
}
.qt-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--qt-shadow-sm);
  transition: transform .2s var(--qt-ease);
}
.qt-switch[data-on="1"] { background: var(--qt-primary); }
.qt-switch[data-on="1"]::after { transform: translateX(18px); }

/* ---------- 徽章 ---------- */
.qt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--qt-r-pill);
  background: var(--qt-line-2);
  color: var(--qt-text-2);
  white-space: nowrap;
}
.qt-badge--primary { background: var(--qt-primary-soft); color: var(--qt-primary); }
.qt-badge--success { background: var(--qt-success-soft); color: #059669; }
.qt-badge--warning { background: var(--qt-warning-soft); color: #B45309; }
.qt-badge--danger  { background: var(--qt-danger-soft);  color: #DC2626; }

.qt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--qt-text-3);
}
.qt-dot--on  { background: var(--qt-success); box-shadow: 0 0 0 3px rgba(0, 196, 140, .18); }
.qt-dot--off { background: #CBD5E1; }

/* ---------- 头像 ---------- */
.qt-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--qt-line-2);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--qt-text-3);
  overflow: hidden;
  position: relative;
}
.qt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.qt-avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.qt-avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.qt-avatar--xl { width: 88px; height: 88px; font-size: 30px; }

/* 头像角标 */
.qt-avatar__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--qt-bg-2);
  background: #CBD5E1;
}
.qt-avatar__dot--on { background: var(--qt-success); }

/* ---------- 列表 ---------- */
.qt-list { display: flex; flex-direction: column; }

.qt-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--qt-line-2);
  transition: background .15s var(--qt-ease);
  cursor: pointer;
}
.qt-list__item:last-child { border-bottom: 0; }
.qt-list__item:hover { background: var(--qt-bg-3); }
.qt-list__item--active { background: var(--qt-primary-soft); }

/* ---------- 空状态 ---------- */
.qt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--qt-text-3);
}
.qt-empty__icon { font-size: 36px; opacity: .5; }
.qt-empty__title { font-size: 14px; font-weight: 600; color: var(--qt-text-2); }
.qt-empty__desc { font-size: 12.5px; }

/* ---------- Toast ---------- */
.qt-toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.qt-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: #1E293B;
  border-radius: var(--qt-r-sm);
  box-shadow: var(--qt-shadow);
  animation: qt-toast-in .22s var(--qt-ease);
  pointer-events: auto;
  max-width: 80vw;
}
.qt-toast--success { background: #059669; }
.qt-toast--error   { background: var(--qt-danger); }
.qt-toast--warning { background: #D97706; }

@keyframes qt-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 弹层 ---------- */
.qt-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: qt-fade .18s var(--qt-ease);
}
@keyframes qt-fade { from { opacity: 0; } to { opacity: 1; } }

.qt-modal {
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--qt-bg-2);
  border-radius: var(--qt-r-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
  animation: qt-modal-in .22s var(--qt-ease);
  overflow: hidden;
}
@keyframes qt-modal-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.qt-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--qt-line-2);
  font-size: 15px;
  font-weight: 600;
}

.qt-modal__body { padding: 18px; overflow-y: auto; }
.qt-modal__foot {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--qt-line-2);
}
.qt-modal__foot > * { flex: 1; }

/* ---------- 工具类 ---------- */
.qt-muted { color: var(--qt-text-3); }
.qt-dim   { color: var(--qt-text-2); }
.qt-mono  { font-family: var(--qt-mono); font-size: .92em; }
.qt-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt-center { text-align: center; }
.qt-right { text-align: right; }
.qt-hidden { display: none !important; }
.qt-mt-0 { margin-top: 0; }
.qt-mt-1 { margin-top: 8px; }
.qt-mt-2 { margin-top: 16px; }
.qt-mt-3 { margin-top: 24px; }
.qt-gap-1 { gap: 8px; }
.qt-gap-2 { gap: 16px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .qt-page { padding: 12px; }
  .qt-topbar { height: 52px; padding: 0 12px; }
  .qt-brand__sub { display: none; }
  .qt-modal { max-width: none; max-height: 90vh; }
}
