* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  color: #111827;
}

.login-header p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-block {
  width: 100%;
}

.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

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

.sidebar {
  width: 250px;
  background: #111827;
  color: #e5e7eb;
  padding: 20px 16px;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.sidebar-logo h2 {
  margin: 0;
  font-size: 28px;
  color: #ffffff;
}

.sidebar-logo p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-group-title {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 0 10px;
}

.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #d1d5db;
  transition: background 0.2s, color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: #1f2937;
  color: #ffffff;
}

.main-wrapper {
  flex: 1;
  min-width: 0;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left h1 {
  margin: 0;
  font-size: 24px;
  color: #111827;
}

.topbar-left p {
  margin: 6px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.admin-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.admin-name {
  font-weight: 600;
}

.admin-role {
  font-size: 13px;
  color: #6b7280;
}

.content {
  padding: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  min-height: 110px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 14px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-link {
  font-size: 13px;
  color: #2563eb;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-active,
.status-verified {
  background: #dcfce7;
  color: #166534;
}

.status-revoked,
.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-expired {
  background: #f3f4f6;
  color: #4b5563;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.server-status-list {
  padding: 8px 0;
}

.server-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.server-status-item:last-child {
  border-bottom: none;
}

.server-status-item p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot.online {
  background: #dcfce7;
  color: #166534;
}

.status-dot.warning {
  background: #fef3c7;
  color: #92400e;
}

.status-dot.offline {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

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

  .admin-info {
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .content {
    padding: 16px;
  }

  .topbar {
    padding: 16px;
  }
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-toolbar {
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-actions-inline .inline-actions {
  display: flex;
  gap: 10px;
}

.btn-default {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-default:hover {
  background: #f9fafb;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.panel-meta {
  font-size: 13px;
  color: #6b7280;
}

.table-actions {
  white-space: nowrap;
}

.text-link {
  color: #2563eb;
  margin-right: 10px;
  font-size: 14px;
}

.text-link:last-child {
  margin-right: 0;
}

.text-danger {
  color: #dc2626;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-list {
  padding: 14px 18px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  min-width: 120px;
  color: #6b7280;
  font-size: 14px;
}

.detail-value {
  flex: 1;
  text-align: right;
  color: #111827;
  font-size: 14px;
}

.timeline {
  padding: 20px 20px 8px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: #2563eb;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.timeline-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.timeline-text {
  font-size: 14px;
  color: #374151;
}

.mt-18 {
  margin-top: 18px;
}

.form-panel .form-layout {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.form-footer {
  padding: 0 18px 18px;
  display: flex;
  gap: 10px;
}

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
}

.alert-box {
  margin: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

@media (max-width: 1400px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .detail-grid,
  .form-panel .form-layout {
    grid-template-columns: 1fr;
  }

  .detail-item {
    flex-direction: column;
  }

  .detail-value {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
.code-text {
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  letter-spacing: 1px;
}

.detail-item-block {
  display: block;
}

.detail-code-block {
  margin-top: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}
.stats-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.review-waiting {
  background: #fef3c7;
  color: #92400e;
}

.review-done {
  background: #dcfce7;
  color: #166534;
}

.review-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.review-expired {
  background: #e5e7eb;
  color: #374151;
}

.text-success {
  color: #15803d;
}

.checklist-box {
  padding: 16px 18px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #374151;
}

.check-item:last-child {
  border-bottom: none;
}

.check-item input {
  margin-top: 2px;
}

.review-form-box {
  padding: 18px;
}

.no-margin {
  margin: 0;
}

@media (max-width: 900px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .stats-grid-4 {
    grid-template-columns: 1fr;
  }
}
.import-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.import-done {
  background: #dcfce7;
  color: #166534;
}

.import-processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.import-conflict {
  background: #fef3c7;
  color: #92400e;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.role-super {
  background: #ede9fe;
  color: #6d28d9;
}

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

.role-viewer {
  background: #e5e7eb;
  color: #374151;
}

.profile-form-box {
  padding: 18px;
}

.no-padding {
  padding: 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: #111827;
}

.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
}

.text-muted {
    color: #6b7280;
    font-size: 13px;
    margin: 4px 0 0;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 10px;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    color: #374151;
    background: #f9fafb;
    font-weight: 600;
}

.table-empty {
    text-align: center !important;
    color: #6b7280;
    padding: 24px 0 !important;
}

.simple-chart {
    display: flex;
    align-items: end;
    gap: 14px;
    min-height: 240px;
    padding: 10px 0;
}

.simple-chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.simple-chart-bar-wrap {
    height: 180px;
    display: flex;
    align-items: end;
    width: 100%;
    justify-content: center;
}

.simple-chart-bar {
    width: 36px;
    max-width: 100%;
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    border-radius: 8px 8px 0 0;
}

.simple-chart-value {
    margin-top: 8px;
    font-size: 13px;
    color: #111827;
    font-weight: 600;
}

.simple-chart-label {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

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

.status-inactive {
    background: #f3f4f6;
    color: #4b5563;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .simple-chart {
        gap: 8px;
    }

    .simple-chart-bar {
        width: 24px;
    }

    .input {
        width: 100%;
        min-width: 0;
    }
}
