* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #f4f6fb;
  color: #1f2937;
}
.layout {
  min-height: 100vh;
  display: flex;
}
.sidebar {
  width: 250px;
  background: #111827;
  color: #e5e7eb;
  padding: 20px 14px;
  transition: width 0.2s ease, padding 0.2s ease;
}
.sidebar.sidebar-collapsed {
  width: 76px;
  padding: 20px 8px;
}
.sidebar.sidebar-collapsed .brand,
.sidebar.sidebar-collapsed .role-tag,
.sidebar.sidebar-collapsed .menu-group-title,
.sidebar.sidebar-collapsed .menu-sub {
  display: none;
}
.sidebar.sidebar-collapsed .menu-link {
  text-align: center;
  padding: 10px 6px;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.role-tag {
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 16px;
}
.menu-link {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #e5e7eb;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}
.menu-link:hover {
  background: rgba(59, 130, 246, 0.35);
}
.menu-link.is-active {
  background: rgba(22, 186, 170, 0.35);
  border: 1px solid rgba(22, 186, 170, 0.5);
}
.menu-group {
  margin-bottom: 10px;
}
.menu-group-title {
  width: 100%;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #9fb5d1;
  margin: 4px 4px 6px;
  padding: 4px 2px;
}
.menu-group-children {
  display: none;
}
.menu-group.menu-group-open .menu-group-children {
  display: block;
}
.menu-sub {
  margin-left: 8px;
  font-size: 13px;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.header {
  height: 64px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #e5e7eb;
}
.header-title {
  font-size: 18px;
  font-weight: 600;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.content {
  padding: 20px;
}
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 16px;
  margin-bottom: 16px;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #dbe3ee;
}
.kpi .label {
  color: #6b7280;
  font-size: 13px;
}
.kpi .value {
  margin-top: 6px;
  font-weight: 700;
  font-size: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn.primary {
  background: #2563eb;
  color: #fff;
}
.btn.danger {
  background: #ef4444;
  color: #fff;
}
.btn.light {
  background: #eef2ff;
  color: #1e3a8a;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
}
th {
  background: #f8fafc;
  color: #334155;
}
.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.task-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
input, select, textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 13px;
}
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #edf3ff 0%, #f5f7fb 100%);
}
.auth-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe3ee;
  padding: 24px;
}
.auth-card h1 {
  margin-top: 0;
  margin-bottom: 6px;
}
.auth-card .hint {
  margin: 0 0 14px 0;
  color: #64748b;
}
.captcha-box {
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}
.alert {
  padding: 10px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  margin-bottom: 12px;
}
.paidan-toast-host {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.paidan-toast {
  min-width: 180px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.18s ease;
  pointer-events: auto;
}
.paidan-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.paidan-toast-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.paidan-toast-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.paidan-toast-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}
.paidan-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3010;
  padding: 14px;
}
.paidan-modal-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dbe3ee;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  padding: 14px;
}
.paidan-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.paidan-modal-body {
  color: #334155;
  line-height: 1.7;
  white-space: pre-wrap;
}
.paidan-modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.pill.ok {
  background: #dcfce7;
  color: #166534;
}
.pill.warn {
  background: #fef3c7;
  color: #92400e;
}
.pill.danger {
  background: #fee2e2;
  color: #991b1b;
}
.timeout-row {
  background: #fff1f2;
}
.plugin-fields-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.toolbar .left,
.toolbar .right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hidden-form {
  display: none;
}
.op-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.list-pager {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dbe3ee;
  overflow-x: auto;
}
.list-pager .summary {
  color: #64748b;
  font-size: 13px;
  flex: 0 0 auto;
}
.list-pager .turn {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.list-pager .jump {
  display: flex !important;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 8px;
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.list-pager .jump > * {
  flex: 0 0 auto;
}
.list-pager .jump label {
  display: inline-flex;
  margin: 0;
  color: #334155;
  white-space: nowrap;
}
.list-pager .jump input[type="number"] {
  width: 90px;
  min-height: 34px;
}
.list-pager .jump select {
  width: 90px;
  min-height: 34px;
}
.proof-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.proof-form input {
  min-width: 220px;
  flex: 1;
}
.cashier-card .hint {
  color: #64748b;
}
.cashier-value {
  font-size: 18px !important;
  word-break: break-all;
}
.cashier-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.take-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.take-form p {
  margin: 0;
}
.proof-form .btn {
  min-width: 110px;
}
.proof-form input[type="file"] {
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  padding: 8px;
}
.task-card-grid {
  display: none;
}
.task-card {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}
.task-card .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.task-card .meta {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 4px;
}
.task-card .actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.order-card-grid {
  display: none;
}
.order-card {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}
.order-card .head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.order-card .order-no {
  font-size: 13px;
  color: #334155;
  word-break: break-all;
}
.order-card .meta {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 4px;
}
.order-card .actions {
  margin-top: 8px;
}
.order-no-lines {
  line-height: 1.5;
  white-space: normal;
}
.order-no-lines > div {
  word-break: break-all;
}
.cashier-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}
.cashier-summary .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}
.cashier-summary .line:last-child {
  margin-bottom: 0;
}
.chart-box {
  width: 100%;
  height: 320px;
}
.chart-box.sm {
  height: 260px;
}
.agent-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.agent-card {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  min-width: 0;
  overflow: hidden;
}
.agent-card-line {
  line-height: 1.6;
  color: #374151;
  font-size: 13px;
}
.agent-card-line.title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.empty-tip {
  color: #64748b;
  padding: 8px 2px;
}
.security-2fa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.security-2fa-panel {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}
.security-2fa-panel h4 {
  margin: 0 0 10px 0;
  color: #1e293b;
}
.qr-wrap {
  width: 180px;
  min-height: 180px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: #fff;
}
.security-key-row {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.sidebar-mask {
  display: none;
}
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    width: 240px;
    transition: transform 0.2s ease;
  }
  .sidebar.sidebar-mobile-open {
    transform: translateX(0);
  }
  .sidebar.sidebar-collapsed {
    width: 240px;
    padding: 20px 14px;
  }
  .sidebar.sidebar-collapsed .brand,
  .sidebar.sidebar-collapsed .role-tag,
  .sidebar.sidebar-collapsed .menu-group-title,
  .sidebar.sidebar-collapsed .menu-sub {
    display: block;
  }
  .sidebar-mask.show {
    display: block;
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
  }
  .header {
    padding: 0 12px;
  }
  .header-title {
    font-size: 15px;
    max-width: 58vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-user span {
    display: none;
  }
  .header-user {
    gap: 6px;
  }
  .header-user .btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .content {
    padding: 12px;
  }
  .card {
    padding: 12px;
  }
  .kpi {
    padding: 12px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .agent-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .security-2fa-grid {
    grid-template-columns: 1fr;
  }
  .qr-wrap {
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .task-form-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    min-height: 44px;
    padding: 10px 12px;
  }
  input, select, textarea {
    min-height: 44px;
  }
  th, td {
    white-space: nowrap;
  }
  .table-scroll.mobile-hide-on-h5 {
    display: none;
  }
  .task-card-grid {
    display: block;
  }
  .order-card-grid {
    display: block;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar .left,
  .toolbar .right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .toolbar .right .btn {
    width: 100%;
  }
  .proof-form {
    flex-direction: column;
    align-items: stretch;
  }
  .proof-form input {
    min-width: 0;
  }
  .proof-form input[type="file"] {
    width: 100%;
  }
  .list-pager {
    align-items: stretch;
  }
  .list-pager .turn,
  .list-pager .jump {
    width: 100%;
    flex-wrap: wrap;
  }
  .list-pager .turn .btn {
    flex: 1;
  }
  .list-pager .jump input[type="number"],
  .list-pager .jump select {
    width: 100%;
  }
  .cashier-actions .btn {
    width: 100%;
  }
  .cashier-summary .line {
    flex-direction: column;
    gap: 2px;
  }
  .paidan-toast-host {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  .paidan-toast {
    min-width: 0;
    max-width: none;
  }
  .header {
    min-height: 56px;
    height: auto;
  }
  .header-title .btn {
    min-height: 34px;
    padding: 6px 10px;
  }
  .chart-box,
  .chart-box.sm {
    height: 220px;
  }
  .kpi .value {
    font-size: 20px;
  }
}
