* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #4f8fe9, #3d7fe0);
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.nav-item {
  display: block;
  color: #dbe9ff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.stat-box {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 14px;
}

.stat-box strong {
  font-size: 30px;
}

.main {
  flex: 1;
  padding: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: #64748b;
}

.toolbar {
  margin-top: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

input, select {
  height: 36px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
}

input:focus, select:focus {
  border-color: #4f8fe9;
}

#searchInput {
  width: 300px;
}

#groupFilter {
  width: 140px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}

.btn.primary {
  background: #409eff;
  color: #fff;
}

.btn.danger {
  background: #ef4444;
  color: #fff;
}

.btn-mini {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 4px;
  color: #fff;
}

.btn-blue {
  background: #4ea6f5;
}

.btn-orange {
  background: #e6a53a;
}

.btn-green {
  background: #58b65d;
}

.btn-deepblue {
  background: #3c95ea;
}

.btn-red {
  background: #e76565;
}

.table-wrap {
  margin-top: 14px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  font-size: 14px;
}

th {
  background: #fafcff;
  color: #475569;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.tag.group {
  background: #d1fae5;
  color: #047857;
}

.tag.status-ok {
  background: #dcfce7;
  color: #166534;
}

.tag.status-stop {
  background: #fee2e2;
  color: #991b1b;
}

.tag.role {
  background: #dbeafe;
  color: #1d4ed8;
}

.pager {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pager-actions {
  display: flex;
  gap: 8px;
}

dialog {
  border: 0;
  border-radius: 12px;
  width: 420px;
  padding: 0;
}

#mailForm {
  display: grid;
  gap: 10px;
  padding: 18px;
}

#mailForm h3 {
  margin: 0 0 8px;
}

#mailForm label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

#inboxDialog {
  width: min(1100px, 94vw);
}

.inbox-wrap {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.inbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
}

.inbox-head h3 {
  margin: 0;
}

.inbox-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.inbox-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 520px;
}

.mail-list {
  border-right: 1px solid #eef2f7;
  overflow: auto;
}

.mail-item {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.mail-item:hover,
.mail-item.active {
  background: #f5f9ff;
}

.mail-item strong {
  display: block;
  margin-bottom: 6px;
}

.mail-item p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.mail-detail {
  padding: 16px;
  overflow: auto;
}

.mail-detail h4 {
  margin: 0 0 8px;
}

.mail-meta {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 14px;
}

.verify-code {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
}

#importDialog {
  width: min(1020px, 96vw);
}

.import-wrap {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.import-head {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.import-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 1px;
}

.icon-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  color: #a8b0bb;
  cursor: pointer;
}

.import-tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid #e8edf3;
  padding: 0 20px;
}

.import-tab {
  border: 0;
  background: transparent;
  color: #3b4654;
  font-size: 16px;
  padding: 16px 0 14px;
  cursor: pointer;
}

.import-tab.active {
  color: #3f95e6;
  border-bottom: 4px solid #3f95e6;
}

.import-body {
  padding: 14px 20px;
}

.import-tip {
  margin: 8px 0 8px;
  color: #606f82;
  font-size: 14px;
}

.import-tip.sub {
  color: #8a97a7;
}

.import-list {
  margin: 0 0 12px 0;
  padding-left: 36px;
  color: #4d5968;
  font-size: 14px;
  line-height: 1.5;
}

#importText {
  width: 100%;
  height: 380px;
  resize: vertical;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  color: #6b7280;
}

.import-file-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #7b8794;
}

.drop-zone {
  border: 1px dashed #8ec3e8;
  border-radius: 10px;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fbfdff;
}

.drop-zone.dragover {
  background: #f2f9ff;
}

.drop-icon {
  font-size: 64px;
  color: #b3bac5;
  line-height: 1;
  margin-bottom: 12px;
}

.drop-text {
  font-size: 14px;
  color: #4b5563;
}

.drop-link {
  color: #3f95e6;
  cursor: pointer;
  margin-left: 4px;
}

.import-tip.ok {
  color: #53a76b;
}

.import-actions {
  border-top: 1px solid #eef2f7;
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hidden {
  display: none;
}
