* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f2f4f8;
  color: #1f2937;
  font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2e62d9 0%, #1e4fc4 100%);
}
.login-card {
  width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.login-title { font-size: 20px; font-weight: 700; text-align: center; }
.login-sub { font-size: 12px; color: #6b7280; text-align: center; margin: 8px 0 24px; }
.login-err { color: #ef4444; font-size: 12px; min-height: 18px; margin-top: 10px; text-align: center; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #1e4fc4;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
.brand { font-size: 18px; font-weight: 700; padding: 0 22px; }
.brand-sub { font-size: 12px; opacity: .75; padding: 6px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.15); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; border-right: 3px solid #ffd21e; }
.badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 5px;
}
.sidebar-foot { margin-top: auto; padding: 16px 22px 0; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; display: flex; justify-content: space-between; }
.logout { color: #ffd21e; cursor: pointer; }

.content { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 18px; }
.tab { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }

/* ---------- 通用组件 ---------- */
.ipt {
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  width: 100%;
}
.ipt:focus { border-color: #2e62d9; box-shadow: 0 0 0 2px rgba(46,98,217,.12); }
textarea.ipt { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.ipt-select { width: 140px; }
.btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn-primary { background: #2e62d9; border-color: #2e62d9; color: #fff; }
.btn-primary:hover { background: #2554c2; }
.btn-block { width: 100%; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-link { border: none; background: none; color: #2e62d9; cursor: pointer; padding: 0 6px; }
.btn-link.danger { color: #ef4444; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.notice-row { display: flex; gap: 10px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar .ipt { width: 260px; }
.tip-text { color: #6b7280; font-size: 12px; line-height: 1.7; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { background: #fff; border-radius: 12px; overflow: auto; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f1f4; white-space: nowrap; }
.table th { background: #f8fafc; font-size: 13px; color: #4b5563; }
.table tr:hover td { background: #fafbfc; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.tag-待审核 { background: #fef3c7; color: #b45309; }
.tag-已通过 { background: #d1fae5; color: #047857; }
.tag-已拒绝 { background: #fee2e2; color: #b91c1c; }
.tag-已完成 { background: #dbeafe; color: #1d4ed8; }
.tag-visible-1 { background: #d1fae5; color: #047857; }
.tag-visible-0 { background: #e5e7eb; color: #6b7280; }
.empty-row td { text-align: center; color: #9ca3af; padding: 30px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  width: 480px; max-width: 92vw;
  max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 12px;
  padding: 22px 24px;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-err { color: #ef4444; font-size: 12px; min-height: 16px; }

/* ---------- 客服 ---------- */
.chat-layout { display: flex; gap: 16px; height: calc(100vh - 130px); }
.conv-list { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; padding: 14px; }
.conv-items { overflow-y: auto; flex: 1; }
.conv-item {
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: #e8f0fe; }
.conv-top { display: flex; justify-content: space-between; align-items: center; }
.conv-name { font-weight: 600; font-size: 13px; }
.conv-time { font-size: 11px; color: #9ca3af; }
.conv-msg { font-size: 12px; color: #6b7280; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-unread {
  background: #ef4444; color: #fff; font-size: 11px;
  min-width: 17px; height: 17px; line-height: 17px;
  border-radius: 9px; text-align: center; padding: 0 4px;
}
.chat-panel { flex: 1; display: flex; flex-direction: column; padding: 14px; min-width: 0; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #9ca3af; }
.chat-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msg-list { flex: 1; overflow-y: auto; padding: 6px 4px; }
.msg-row { display: flex; margin-bottom: 14px; }
.msg-row.admin { justify-content: flex-end; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; margin: 0 10px;
  background: #64748b;
}
.msg-row.admin .msg-avatar { background: #2e62d9; }
.msg-body { max-width: 62%; }
.msg-meta { font-size: 11px; color: #9ca3af; margin-bottom: 4px; }
.msg-bubble {
  padding: 9px 13px; border-radius: 10px;
  background: #f1f5f9; line-height: 1.6; word-break: break-all;
  font-size: 13px;
}
.msg-row.admin .msg-bubble { background: #2e62d9; color: #fff; }
.msg-bubble img { max-width: 240px; border-radius: 8px; display: block; cursor: pointer; }
.msg-bubble video { max-width: 280px; border-radius: 8px; display: block; }
.chat-input-bar { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid #f0f1f4; }
