/* ================================================
   鸿乐内部版 — 全局样式
   ================================================ */

:root {
  --blue: #1F68FF;
  --blue2: #1557D4;
  --bg: #F0F2F5;
  --white: #FFFFFF;
  --text: #1D2129;
  --sub: #86909C;
  --border: #E4E7EB;
  --danger: #FF4D4F;
  --warn: #FF9C00;
  --ok: #00B42A;
  --shadow: 0 2px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --grad: linear-gradient(135deg, #1F68FF 0%, #3D7EFF 100%);
  --grad-danger: linear-gradient(135deg, #FF4D4F 0%, #ff7875 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
  font-size: 14px;
  transition: border .2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
}

/* ---- 登录页 ---- */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #d0dbff 0%, var(--bg) 60%);
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card h1 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--blue);
}

.login-card p {
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 32px;
}

.login-card input {
  width: 100%;
  margin-bottom: 16px;
}

.btn-login {
  width: 100%;
  background: var(--grad);
  color: #fff;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31,104,255,.35);
  transition: all .2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(31,104,255,.45);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
  text-align: left;
}

.brand {
  font-size: 36px;
  margin-bottom: 16px;
}

/* ---- App 框架 ---- */
.app {
  display: none;
  min-height: 100vh;
  height: 100vh;
}

.app.show {
  display: flex;
}

/* ---- 顶栏 ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  padding: 0 20px;
  height: 56px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.topbar .logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.role-tag {
  background: #e8f0ff;
  color: var(--blue);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.notif-btn {
  position: relative;
  background: none;
  font-size: 20px;
  border: none;
  cursor: pointer;
}

.notif-btn .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-name {
  font-weight: 600;
}

.logout-btn {
  background: none;
  color: var(--sub);
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.logout-btn:hover {
  color: var(--danger);
}

/* ---- 侧栏 ---- */
.sidebar-close {
  display: none !important;
}

.sidebar {
  width: 200px;
  background: var(--white);
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 12px 0;
  box-shadow: 2px 0 8px rgba(0,0,0,.05);
}

.section-label {
  color: var(--sub);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 8px 20px 4px;
}

.sidebar button {
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  background: none;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  border: none;
  cursor: pointer;
}

.sidebar button:hover {
  background: #f5f7ff;
  color: var(--blue);
}

.sidebar button.active {
  background: linear-gradient(90deg, #e8f0ff 0%, #f5f7ff 100%);
  color: var(--blue);
  font-weight: 700;
  border-right: 3px solid var(--blue);
}

.sidebar button .icon {
  font-size: 16px;
}

/* ---- 主内容区 ---- */
.main {
  margin-left: 200px;
  margin-top: 56px;
  padding: 24px 24px 24px 28px;
  min-height: calc(100vh - 56px);
  box-sizing: border-box;
  width: calc(100% - 200px);
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title .sub {
  font-size: 13px;
  color: var(--sub);
  font-weight: 400;
}

/* ---- 统计卡片 ---- */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.stats-grid > .stat-card {
  flex: 1 1 calc(50% - 8px);
  min-width: 140px;
  max-width: calc(50% - 8px);
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.stat-card .val {
  font-size: 28px;
  font-weight: 700;
}

.stat-card .val.danger { color: var(--danger); }
.stat-card .val.warn   { color: var(--warn); }
.stat-card .val.ok     { color: var(--ok); }

.stat-card .label {
  color: var(--sub);
  font-size: 13px;
  margin-top: 4px;
}

.stat-card.blue {
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(31,104,255,.30);
  color: #fff;
}

.stat-card.blue .val  { color: #fff; }
.stat-card.blue .label { color: rgba(255,255,255,.75); }

/* ---- 卡片 ---- */
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---- 表格 ---- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f7f8fa;
  color: var(--sub);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafbff;
}

/* ---- 状态标签 ---- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.tag-pending  { background: #fff7e6; color: #ad6800; }
.tag-active   { background: #f0f9eb; color: #52c41a; }
.tag-expired  { background: #f5f5f5; color: #999; }
.tag-rejected { background: #fff1f0; color: #ff4d4f; }
.tag-disabled { background: #f5f5f5; color: #999; }

/* ---- 按钮 ---- */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(31,104,255,.30);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31,104,255,.40);
}

.btn-danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
}

.btn-danger:hover {
  background: var(--grad-danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,77,79,.30);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  box-shadow: 0 1px 4px rgba(31,104,255,.10);
}

.btn-outline:hover {
  background: #e8f0ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(31,104,255,.20);
}

.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger-outline:hover {
  background: var(--grad-danger);
  color: #fff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---- 表单 ---- */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 14px;
  flex: 1;
  min-width: 180px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
}

.form-group.full {
  flex: 100%;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .count {
  color: var(--sub);
  font-size: 13px;
  margin-left: auto;
}

/* ---- 空状态 ---- */
.empty {
  text-align: center;
  padding: 40px;
  color: var(--sub);
}

.empty .icon {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ---- 弹窗 ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 20px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.close-btn {
  background: none;
  font-size: 20px;
  color: var(--sub);
  border: none;
  cursor: pointer;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- 提醒列表 ---- */
.alert-list {
  max-height: 400px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item.unread {
  background: #f0f7ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: -2px -4px 2px;
  border: none;
}

.alert-item .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-item .time {
  color: var(--sub);
  font-size: 12px;
  margin-top: 2px;
}

/* ---- 回执框 ---- */
.receipt-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-line;
  line-height: 1.8;
  max-height: 300px;
  overflow-y: auto;
}


/* ---- 汉堡按钮 ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  background: none;
  border: none;
}
/* ---- 侧边栏遮罩 ---- */
.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 998;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* 汉堡按钮 - 移动端底部中央 */
  .hamburger {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: rgba(255,255,255,.95);
    border-radius: 50px;
    padding: 10px 28px;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
  }

  /* 侧边栏默认隐藏 */
  .sidebar {
    position: fixed;
    display: block;
    width: 75vw;
    max-width: 260px;
    left: -75vw;
    top: 0;
    bottom: 0;
    transition: left .3s ease;
    z-index: 999;
    box-shadow: none !important;
    padding-top: 56px;
    pointer-events: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.2) !important;
    pointer-events: auto;
  }


  .sidebar.open .sidebar-close {
    display: flex !important;
    align-items: center;
    gap: 10px;
  }

  /* 遮罩层 - 只有 show 时才显示 */
  .sidebar-mask.show {
    display: block;
    pointer-events: auto;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 12px 12px !important;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    box-sizing: border-box;
  }

  .stats-grid {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  .stat-card {
    padding: 16px 14px !important;
  }

  .stat-card .val {
    font-size: 24px !important;
  }

  .card {
    padding: 18px 14px !important;
    border-radius: 12px !important;
  }

  .page-title {
    font-size: 18px !important;
    margin-bottom: 14px !important;
  }

  /* 表格横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  table { min-width: 600px; font-size: 12px; }
  th, td { padding: 8px 10px !important; white-space: nowrap; }

  .form-row { flex-direction: column; }
  .form-group { min-width: 100% !important; }
  .form-group input,
  .form-group select { font-size: 14px; }

  .btn { padding: 7px 12px; font-size: 12px; }
  .btn-sm { padding: 5px 8px; font-size: 11px; }

  /* 弹窗全屏 */
  .modal { width: 96vw !important; max-width: 96vw !important; border-radius: 16px !important; }
  .modal-body { padding: 16px 14px !important; }
  .modal-header { padding: 16px 14px !important; }
  .modal-footer { padding: 14px !important; }

  /* 登录页 */
  .login-card { padding: 32px 24px !important; width: 94vw !important; }
}

@media (max-width: 480px) {
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }

  /* 强制2列 */
  .stats-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .stats-grid > .stat-card {
    flex: 1 1 calc(50% - 5px) !important;
    min-width: calc(50% - 5px) !important;
    max-width: 100% !important;
  }

  /* topbar压缩 */
  .topbar { height: 52px !important; padding: 0 12px !important; }
  .topbar .logo { font-size: 13px !important; }
  .topbar-right { gap: 6px !important; }
  .role-tag, .user-name { display: none !important; }
  .avatar { width: 28px !important; height: 28px !important; font-size: 12px !important; }
  .logout-btn { padding: 4px 8px !important; font-size: 11px !important; }
  .notif-btn { font-size: 16px !important; padding: 4px !important; }

  /* 表格 */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; width: 100%; }
  table { min-width: 480px !important; font-size: 11px !important; }
  th, td { padding: 6px 8px !important; white-space: nowrap; }

  /* 卡片 */
  .card { padding: 14px 12px !important; border-radius: 12px !important; }
  .stat-card { padding: 14px 10px !important; border-radius: 10px !important; }
  .stat-card .val { font-size: 20px !important; }
  .stat-card .label { font-size: 11px !important; }
  .page-title { font-size: 16px !important; }

  /* 弹窗 */
  .modal { width: 98vw !important; max-width: 98vw !important; border-radius: 16px !important; }
  .modal-body { padding: 14px 10px !important; }

  /* 主内容 */
  .main { padding: 12px 10px !important; margin-top: 52px !important; }

  /* 登录页 */
  .login-card { padding: 28px 20px !important; width: 94vw !important; }
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

/* ---- 回执预览样式 ---- */
.receipt-preview {
  border: 2px solid #1F68FF;
  border-radius: 8px;
  overflow: hidden;
  font-family: monospace;
}
.receipt-header {
  background: #1F68FF;
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
}
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.receipt-table tr {
  border-bottom: 1px solid #e8e8e8;
}
.receipt-table tr:last-child {
  border-bottom: none;
}
.receipt-table .label {
  padding: 8px 12px;
  color: #666;
  font-size: 13px;
  width: 35%;
  background: #f7f9ff;
}
.receipt-table .value {
  padding: 8px 12px;
  color: #333;
  font-size: 13px;
  font-weight: 500;
}
.receipt-footer {
  background: #f7f9ff;
  border-top: 1px solid #e8e8e8;
  padding: 8px 12px;
  color: #888;
  font-size: 12px;
  text-align: center;
  line-height: 1.8;
}

/* 左侧联系人列表 */
.msg-contact-list { width:140px; border-right:1px solid #eee; overflow-y:auto; padding:8px 0; }
.msg-contact-tip { font-size:11px; color:#999; padding:6px 12px 4px; }
.msg-contact-item { display:flex; align-items:center; gap:8px; padding:8px 12px; cursor:pointer; transition:background 0.15s; }
.msg-contact-item:hover { background:#f5f5f5; }
.msg-contact-item.active { background:#e8f0fe; }
.msg-contact-item .avatar { width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.msg-contact-item .name { font-size:13px; color:#333; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* 聊天区域 */
.msg-chat-area { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.msg-empty { flex:1; display:flex; align-items:center; justify-content:center; }
.msg-thread { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }

.msg-bubble-wrap { display:flex; flex-direction:column; max-width:70%; }
.msg-bubble-wrap.me { align-self:flex-end; align-items:flex-end; }
.msg-bubble-wrap.other { align-self:flex-start; align-items:flex-start; }
.msg-sender { font-size:11px; color:#999; margin-bottom:2px; }
.msg-bubble { padding:10px 14px; border-radius:16px; font-size:14px; line-height:1.5; word-break:break-all; }
.msg-bubble-me { background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border-bottom-right-radius:4px; }
.msg-bubble-other { background:#f1f1f1; color:#333; border-bottom-left-radius:4px; }
.msg-time { font-size:11px; color:#ccc; margin-top:2px; }

/* 输入区 */
.msg-input-area { display:flex; gap:10px; padding:12px 16px; border-top:1px solid #eee; background:#fff; }
.msg-input-area input { flex:1; padding:10px 14px; border:1px solid #ddd; border-radius:24px; font-size:14px; outline:none; }
.msg-input-area input:focus { border-color:#667eea; }
.msg-send-btn { padding:10px 20px; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border:none; border-radius:24px; font-size:14px; cursor:pointer; }
.msg-send-btn:hover { opacity:0.9; }

/* 消息badge */
#msgBadge { background:#f44; color:#fff; border-radius:10px; padding:1px 6px; font-size:11px; display:inline; }

/* 响应式 */
@media (max-width:600px) {
  .msg-contact-list { width:100px; }
  .msg-bubble { font-size:13px; }
}
/* ===== 消息页面 - QQ风格 ===== */
.msg-page { display:flex; flex-direction:column; height:calc(100vh - 56px); overflow:hidden; flex:1; }
.msg-header { display:flex; align-items:center; gap:12px; padding:12px 16px; background:#fff; border-bottom:1px solid #ddd; font-size:15px; font-weight:600; color:#333; flex-shrink:0; }

.msg-body-qq { flex:1; display:flex; overflow:hidden; }

/* 左侧联系人面板 */
.msg-contact-panel { width:200px; border-right:1px solid #ddd; background:#f5f5f5; overflow-y:auto; flex-shrink:0; }
.msg-contact-tip { font-size:11px; color:#999; padding:8px 12px 4px; }
.msg-contact-item { display:flex; align-items:center; gap:10px; padding:8px 12px; cursor:pointer; transition:background 0.15s; }
.msg-contact-item:hover { background:#e0e0e0; }
.msg-contact-item.active { background:#c8d8f8; }
.msg-contact-item .avatar { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.msg-contact-item .name { font-size:13px; color:#333; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* 右侧聊天面板 */
.msg-chat-panel { flex:1; display:flex; flex-direction:column; overflow:hidden; background:#fff; }
.msg-empty { flex:1; display:flex; align-items:center; justify-content:center; }
.msg-no-msg-tip { text-align:center; color:#bbb; padding:30px; font-size:13px; }

/* 聊天消息区 */
.msg-chat-window { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.msg-chat-msgs { flex:1; overflow-y:auto; padding:12px 16px; background:#f0f0f0; }
.msg-date-tag { text-align:center; font-size:11px; color:#aaa; margin:10px 0; }

/* QQ气泡 */
.qq-msg-me { display:flex; justify-content:flex-end; margin-bottom:10px; align-items:flex-end; }
.qq-msg-other { display:flex; justify-content:flex-start; margin-bottom:10px; align-items:flex-end; }
.qq-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.qq-content { max-width:70%; margin:0 8px; }
.qq-sender { font-size:11px; color:#999; margin-bottom:2px; }
.qq-bubble-me { background:#5191d4; color:#fff; padding:8px 12px; border-radius:12px 12px 2px 12px; font-size:14px; line-height:1.5; word-break:break-all; display:inline-block; }
.qq-bubble-other { background:#fff; color:#333; padding:8px 12px; border-radius:12px 12px 12px 2px; font-size:14px; line-height:1.5; word-break:break-all; display:inline-block; border:1px solid #ddd; }

/* 输入区 */
.msg-chat-input { display:flex; gap:10px; padding:10px 16px; background:#fff; border-top:1px solid #ddd; flex-shrink:0; }
.msg-chat-input textarea { flex:1; padding:8px 12px; border:1px solid #ccc; border-radius:6px; font-size:14px; resize:none; outline:none; font-family:inherit; }
.msg-chat-input textarea:focus { border-color:#5191d4; }
.msg-send-btn { padding:8px 20px; background:#5191d4; color:#fff; border:none; border-radius:6px; font-size:14px; cursor:pointer; align-self:flex-end; }
.msg-send-btn:hover { background:#4070b8; }

#msgBadge { background:#f44; color:#fff; border-radius:10px; padding:1px 6px; font-size:11px; display:inline; }

/* 移动端 */
@media (max-width:600px) {
  .msg-contact-panel { width:80px; }
  .msg-contact-item .name { display:none; }
  .qq-avatar { width:30px; height:30px; font-size:12px; }
  .qq-content { max-width:80%; }
}


/* === 欢迎弹层动画 === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ---- 工单 ---- */
.ticket-tip{background:#eaf2ff;border:1px solid #cfe0ff;color:#1f4f99;padding:12px 14px;border-radius:8px;line-height:1.7;margin-bottom:14px;font-size:13px}
.ticket-steps{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--border);border-radius:8px;padding:12px;margin-bottom:14px;color:var(--sub);font-size:13px}
.ticket-steps span{padding:6px 10px;border-radius:999px;background:#f5f7fa}
.ticket-steps span.active{background:var(--blue);color:#fff;font-weight:700}
.ticket-dept-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:8px}
.ticket-dept{border:1px solid var(--border);border-radius:10px;background:#fff;padding:18px 16px;cursor:pointer;transition:.2s;display:flex;align-items:center;gap:8px}
.ticket-dept input{display:none}
.ticket-dept.selected{border-color:var(--blue);box-shadow:0 0 0 3px rgba(31,104,255,.08);background:#f8fbff}
.ticket-detail-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px}
.ticket-content{background:#f7f8fa;border:1px solid var(--border);border-radius:10px;padding:14px;line-height:1.8}
.ticket-replies{display:flex;flex-direction:column;gap:10px}
.ticket-reply{border:1px solid var(--border);border-radius:10px;padding:12px;background:#fff}
.ticket-reply div{display:flex;justify-content:space-between;color:var(--sub);font-size:12px;margin-bottom:6px}
.ticket-reply p{line-height:1.7}
@media(max-width:768px){.ticket-dept-grid{grid-template-columns:1fr}.ticket-steps{overflow:auto}.ticket-detail-head{flex-direction:column}}


/* ---- 内部消息 ---- */
.im-page{height:calc(100vh - 110px);display:flex;flex-direction:column;background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.im-topbar{height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--border);background:#f8fbff}
.im-title{font-weight:700;color:var(--text)}.im-select{min-width:220px}
.im-messages{flex:1;overflow:auto;background:#f7f8fa;padding:18px}.im-empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--sub);gap:8px}.im-empty-icon{font-size:42px}.im-empty-title{font-weight:700;color:var(--text)}
.im-thread{display:flex;flex-direction:column;gap:12px}.im-date-divider{text-align:center;color:var(--sub);font-size:12px;margin:8px 0}.im-date-divider span{background:#e8eef8;border-radius:999px;padding:3px 10px}
.im-bubble-wrap{display:flex;gap:8px;align-items:flex-end}.im-me{justify-content:flex-end}.im-avatar{width:30px;height:30px;border-radius:50%;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}.im-bubble-group{max-width:70%}.im-bubble{padding:10px 12px;border-radius:14px;line-height:1.6;white-space:pre-wrap;word-break:break-word}.im-bubble-me{background:var(--blue);color:#fff;border-bottom-right-radius:4px}.im-bubble-other{background:#fff;border:1px solid var(--border);border-bottom-left-radius:4px}.im-sender-name,.im-time{font-size:12px;color:var(--sub);margin:3px 4px}
.im-input-bar{border-top:1px solid var(--border);padding:12px;background:#fff}.im-input-wrap{display:flex;gap:10px;align-items:flex-end}.im-input{flex:1;resize:none;min-height:40px;max-height:120px;border:1px solid var(--border);border-radius:10px;padding:10px}.im-send-btn{background:var(--blue);color:#fff;border:0;border-radius:10px;padding:10px 18px;cursor:pointer}
