* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }
.admin-wrap { min-height: 100vh; display: flex; flex-direction: column; }
/* 大屏（如 4K）下顶栏、内容与页脚同一最大宽度居中，避免横向拉满 */
.admin-inner {
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
.admin-header { background: #001529; color: #fff; height: 56px; }
.admin-header .admin-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header .brand { font-weight: 600; font-size: 16px; }
.admin-header nav a { color: rgba(255,255,255,.85); text-decoration: none; margin-left: 16px; }
.admin-header nav a:hover { color: #fff; }
.admin-header .sep { opacity: .5; margin-left: 16px; }
.admin-header .user { color: rgba(255,255,255,.65); margin-right: 8px; }
.admin-main { flex: 1; padding: 24px 0; }
.admin-footer { text-align: center; padding: 16px 0; color: #999; font-size: 12px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); padding: 24px; margin-bottom: 24px; }
.card h1 { margin: 0 0 20px; font-size: 18px; font-weight: 600; }
.form-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #666; }
.form-row input, .form-row select { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; min-width: 200px; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 4px; border: 1px solid #1890ff; background: #1890ff; color: #fff; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-secondary { background: #fff; color: #1890ff; }
/* 避免 .btn:hover 与浅色字同色：白底 + 深蓝字 */
.btn.btn-secondary:hover {
  background: #fff;
  border-color: #40a9ff;
  color: #096dd9;
}
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; }
table.data th { background: #fafafa; font-weight: 600; }
table.data tr:hover td { background: #fafafa; }
.pagination { margin-top: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; text-decoration: none; color: #333; }
.pagination a:hover { border-color: #1890ff; color: #1890ff; }
.pagination .current { background: #1890ff; border-color: #1890ff; color: #fff; }
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.muted { color: #64748b; font-size: 13px; line-height: 1.5; }
.form-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #666; cursor: pointer; user-select: none; }
.form-check input { width: auto; min-width: auto; margin: 0; cursor: pointer; }
.link-inline { color: #2563eb; text-decoration: none; font-weight: 500; white-space: nowrap; }
.link-inline:hover { text-decoration: underline; color: #1d4ed8; }

/* 报表 · 查看聊天记录 */
.td-action { vertical-align: middle; text-align: center; white-space: nowrap; }
.btn-chatlog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1d4ed8;
  text-decoration: none;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.1s;
}
.btn-chatlog:hover {
  color: #1e40af;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.25);
}
.btn-chatlog:active { transform: scale(0.98); }
.btn-chatlog__ic { flex-shrink: 0; opacity: 0.85; }

/* 聊天内容列表 */
.card-messages__head { margin-bottom: 8px; }
.card-messages__head h1 { margin-bottom: 8px; }
.card-messages__sub { margin: 0 0 16px; max-width: 720px; }
.table-wrap--messages { border: 1px solid #e8ecf1; border-radius: 10px; overflow: hidden; }
.table-messages { font-size: 13px; }
.table-messages th { font-size: 12px; color: #475569; white-space: nowrap; }
/* 时间整行显示：避免窄列把「YYYY-MM-DD HH:MM:SS」挤成多行 */
.table-messages th.col-time,
.table-messages td.col-time {
  white-space: nowrap;
  width: 1%;
  min-width: 11.5rem;
  padding-left: 18px;
  padding-right: 20px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.table-messages .col-group { max-width: 140px; }
.table-messages .col-id { width: 1%; }
.table-messages .col-name { max-width: 100px; }
.table-messages .col-body { min-width: 200px; max-width: 360px; }
.table-messages .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; color: #334155; }
.table-messages__row:hover td { background: #f8fafc; }
.table-messages .msg-cell {
  vertical-align: top;
  line-height: 1.45;
}
.msg-preview {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}
.btn-msg-full {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s;
}
.btn-msg-full:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* 消息全文弹窗 */
.msg-modal[hidden] { display: none !important; }
.msg-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.msg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.msg-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.35);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.msg-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e8ecf1;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.msg-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.msg-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px 0;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.msg-modal__close:hover { background: #f1f5f9; color: #0f172a; }
.msg-modal__body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

/* —— 登录 / 重置页：蓝白 · 科技简约 —— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: linear-gradient(165deg, #f0f9ff 0%, #ffffff 42%, #e0f2fe 100%);
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
}
.login-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(37, 99, 235, 0.04),
    0 24px 48px -12px rgba(30, 64, 175, 0.12);
}
.login-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.login-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.45);
  position: relative;
}
.login-badge::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  opacity: 0.9;
}
.login-head-text { min-width: 0; }
.login-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3b82f6;
}
.login-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.25;
}
.login-hint {
  margin: -12px 0 20px;
  font-size: 12px;
}
.login-hint code {
  font-size: 11px;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
}
.login-form { margin-top: 4px; }
.login-field { margin-bottom: 18px; }
.login-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.login-field input::placeholder { color: #94a3b8; }
.login-field input:hover { border-color: #cbd5e1; background: #fff; }
.login-field input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.login-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.login-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px -4px rgba(37, 99, 235, 0.5);
}
.login-submit:active { transform: translateY(1px); }
.login-foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
}
.login-foot a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.login-foot a:hover { text-decoration: underline; color: #1d4ed8; }
.login-box .alert { margin-bottom: 18px; border-radius: 10px; }
.login-box .alert-error { border-radius: 10px; }
.login-box .alert-success { border-radius: 10px; }
