:root {
  color: #0f1f3d;
  background: #f4f7fb;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 58% 4%, rgba(52, 102, 198, 0.12), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #0f1f3d;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  border-color: #1d63f0;
  color: #1d63f0;
  box-shadow: 0 8px 18px rgba(29, 99, 240, 0.12);
}

button:disabled,
button.is-busy {
  border-color: #1d63f0;
  background: #e7efff;
  color: #1d4ed8;
  cursor: wait;
  opacity: 0.9;
}

button.primary,
#loginBtn {
  border-color: #1f67f2;
  background: linear-gradient(135deg, #1f76ff 0%, #0f57dd 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 99, 240, 0.24);
}

button.danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  height: 100vh;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(15, 61, 123, 0.96) 0%, rgba(9, 43, 87, 0.98) 100%),
    #0b356d;
  color: #ffffff;
  box-shadow: 16px 0 34px rgba(17, 43, 81, 0.16);
}

.brand {
  margin-bottom: 30px;
}

.brand img {
  display: block;
  width: 100%;
  max-width: 228px;
  height: auto;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.25;
}

.brand strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.nav.active,
.nav:hover {
  background: linear-gradient(135deg, #3f86ff 0%, #315cf2 100%);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(30, 98, 230, 0.34);
}

.nav-icon {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.nav-icon::before,
.nav-icon::after {
  position: absolute;
  content: "";
}

.icon-user::before {
  top: 3px;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.icon-user::after {
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 9px;
  border-radius: 9px 9px 3px 3px;
  background: currentColor;
}

.icon-file::before,
.icon-form::before {
  inset: 2px 5px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-file::after,
.icon-form::after {
  top: 8px;
  left: 9px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.icon-transfer::before {
  top: 3px;
  left: 10px;
  width: 4px;
  height: 16px;
  border-radius: 3px;
  background: currentColor;
}

.icon-transfer::after {
  top: 2px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: rotate(45deg);
}

.icon-chat::before {
  inset: 4px 2px 6px;
  border-radius: 8px;
  background: currentColor;
}

.icon-chat::after {
  right: 5px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.icon-faq::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-faq::after {
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  content: "?";
  font-size: 17px;
  font-weight: 900;
}

.icon-book::before {
  inset: 3px 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-book::after {
  top: 3px;
  bottom: 3px;
  left: 11px;
  width: 2px;
  background: currentColor;
}

.collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  padding: 22px 10px 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 700;
}

.collapse-btn span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(66, 127, 235, 0.36);
  color: #bcd4ff;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 28px;
}

.topbar,
.panel-head,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin: 0 4px 24px;
}

.top-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions input {
  width: 150px;
  min-height: 42px;
  border-color: #d8e1ef;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 3px rgba(15, 31, 61, 0.04);
}

.top-actions button {
  min-height: 42px;
  padding: 0 20px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: #081a37;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

h2 {
  color: #0b1e3d;
  font-size: 20px;
  font-weight: 900;
}

h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}

p,
.muted {
  color: #687894;
}

p {
  margin-top: 8px;
}

#loginState {
  color: #687894;
  font-size: 16px;
}

#loginState::first-letter {
  color: inherit;
}

.panel {
  display: none;
  min-height: 520px;
  border: 1px solid rgba(218, 226, 238, 0.86);
  border-radius: 8px;
  padding: 22px 22px 72px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(15, 39, 78, 0.09);
}

.panel.active {
  display: block;
}

.panel-head {
  margin-bottom: 28px;
}

.panel-head button {
  min-width: 100px;
}

.table {
  overflow: hidden;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
}

.row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 130px 180px 300px;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px 20px;
  border-bottom: 1px solid #e5ebf4;
}

.row:last-child {
  border-bottom: 0;
}

.row.header {
  min-height: 52px;
  background: linear-gradient(180deg, #f7fbff 0%, #f2f6fb 100%);
  color: #64748b;
  font-size: 15px;
  font-weight: 900;
}

#userList .row {
  grid-template-columns: minmax(300px, 1.5fr) 140px minmax(230px, 0.8fr) 142px;
}

#userList .row:not(.header) {
  min-height: 118px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.avatar {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f7aff, #1158dd);
  color: #ffffff;
}

.avatar.wechat {
  background: linear-gradient(135deg, #1ed760, #04b84b);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span::before,
.avatar span::after {
  position: absolute;
  content: "";
}

.avatar.account span::before {
  top: 12px;
  left: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
}

.avatar.account span::after {
  left: 12px;
  bottom: 11px;
  width: 20px;
  height: 10px;
  border-radius: 13px 13px 5px 5px;
  background: #ffffff;
}

.avatar.wechat span::before,
.avatar.wechat span::after {
  border-radius: 50%;
  background: #ffffff;
}

.avatar.wechat span::before {
  left: 9px;
  top: 15px;
  width: 22px;
  height: 16px;
}

.avatar.wechat span::after {
  right: 8px;
  bottom: 12px;
  width: 17px;
  height: 13px;
  box-shadow: -9px -1px 0 -6px #12c85a, -2px -1px 0 -6px #12c85a;
}

.user-meta {
  min-width: 0;
}

.user-meta strong {
  display: block;
  color: #071733;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.user-meta p {
  max-width: 420px;
  overflow: hidden;
  color: #687894;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 6px;
  border-radius: 4px;
  padding: 0 7px;
  background: #d9eaff;
  color: #0f6be8;
  font-size: 13px;
  font-weight: 800;
}

.date-stack {
  display: grid;
  gap: 4px;
  color: #0f1f3d;
  font-size: 15px;
  line-height: 1.35;
}

.metric-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f0f4ff 0%, #e7ecfb 100%);
  color: #1436cf;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.metric {
  min-width: 82px;
  font-size: 15px;
}

.tag.off {
  background: #f3f4f6;
  color: #6b7280;
}

.row-actions {
  align-items: center;
  justify-content: flex-start;
}

.row-actions button:first-child {
  min-width: 68px;
  min-height: 40px;
  font-size: 15px;
}

.icon-more {
  width: 32px;
  min-width: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #0f1f3d;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.empty {
  padding: 38px;
  color: #687894;
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.36);
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  width: min(720px, 100vw);
  height: 100vh;
  overflow: auto;
  padding: 22px;
  background: #ffffff;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.16);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  border: 1px solid #edf0f5;
  border-radius: 6px;
  padding: 12px;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 13px;
}

.detail-item strong {
  word-break: break-word;
}

.full {
  grid-column: 1 / -1;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  color: #4b5563;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  padding: 8px 12px;
  background: #ffffff;
  color: #0f1f3d;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  padding: 10px 12px;
}

.manual-form {
  max-width: 860px;
}

.manual-form textarea {
  min-height: 320px;
}

@media (max-width: 1500px) {
  .sidebar {
    width: 236px;
  }

  .main {
    padding: 22px 18px 26px;
  }

  .panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand span,
  .nav {
    font-size: 14px;
  }

  #userList .row {
    grid-template-columns: minmax(260px, 1fr) 112px 230px 112px;
    gap: 12px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .metric-list {
    gap: 8px;
  }

  .tag.metric {
    min-width: 70px;
    padding: 0 8px;
    font-size: 14px;
  }

  .user-meta strong,
  .date-stack,
  .row-actions button:first-child {
    font-size: 15px;
  }

  .user-meta p {
    font-size: 13px;
  }
}

@media (max-width: 1200px) {
  #userList .row {
    grid-template-columns: minmax(220px, 1fr) 100px 216px 100px;
    gap: 10px;
  }

  .tag.metric {
    min-width: 66px;
    padding: 0 6px;
    font-size: 13px;
  }
}

@media (max-width: 960px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .collapse-btn {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .row,
  #userList .row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .metric-list {
    flex-wrap: wrap;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
