:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --light-bg: #f8f9fa;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f8f9fa;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: #212529;
  position: relative;
}

a {
  color: #0d6efd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h6 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

.m-0 {
  margin: 0 !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.d-flex {
  display: flex !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.text-center {
  text-align: center !important;
}

.text-muted {
  color: #6c757d !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-warning {
  color: #ffc107 !important;
}

.fw-medium {
  font-weight: 500 !important;
}

.fs-3 {
  font-size: 1.75rem !important;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0.75rem;
  width: 100%;
}

.card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  margin-bottom: 1rem;
  overflow: hidden;
}

.card.mb-3 {
  margin-bottom: 1rem;
}

#queryCard {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  margin-bottom: 1rem;
  transition: 0.3s;
  box-shadow: var(--card-shadow);
  background: #fff;
}

.card-header {
  background: linear-gradient(to right, #4361ee, #3f37c9);
  padding: 0.75rem 1rem;
  border: none;
  color: #fff;
  font-size: 0.95rem;
}

.card-header h6 {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  display: block;
  text-align: left;
}

.card-header.bg-light {
  background: #f8f9fa;
  color: #212529;
  border-bottom: 1px solid #dee2e6;
}

.card-header.bg-light h6 {
  display: flex;
  align-items: center;
}

.card-body {
  padding: 0.85rem 0.75rem;
}

.form-control {
  display: block;
  width: 100%;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  background: #fff;
  color: #212529;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group {
  display: flex;
  width: 100%;
}

.d-flex.align-items-center {
  gap: 0.5rem;
}

.d-flex.align-items-center .form-control.me-2 {
  margin-right: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.captcha-img {
  border-radius: 8px;
  height: 42px;
  width: 130px;
  flex: 0 0 130px;
  border: none;
  cursor: pointer;
  object-fit: cover;
  background: #cdc4c5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.5;
  background: transparent;
}

.btn-outline-secondary {
  background: #fff;
  border-color: #ced4da;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

.btn-primary {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.btn-primary:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.action-row {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.75rem;
  margin-top: 1rem !important;
}

.mobile-full {
  width: 100%;
}

.remaining-query {
  text-align: left;
  width: 100%;
}

.remaining-query > span {
  color: #dc3545;
  padding: 0;
  display: inline-block;
  font-size: 0.875rem;
}

#loginBtn {
  margin: 0.25rem 0 0;
  color: #212529;
  font-size: 0.875rem;
  text-align: left;
}

#loginBtn a {
  color: #0d6efd;
  text-decoration: underline;
}

#loginBtn.is-logged {
  color: #198754;
}

.btn-ghost {
  border: none;
  background: none;
  color: #0d6efd;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.card-lable {
  background: linear-gradient(135deg, #f8fbff 0%, #e6f0ff 100%);
  border-radius: 12px;
  border: 1px solid #d0e2ff;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 98, 255, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.card-lable h6 {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #333;
  margin-top: 0;
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.8rem;
  font-weight: 400;
}

.card-lable h6:first-child {
  font-size: 1rem;
  font-weight: 600;
  color: #1a56db;
  margin-bottom: 1rem;
  padding-left: 0;
}

.card-lable h6 > i.bi {
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-size: 1.2rem;
  color: #3b82f6;
}

.card-lable h6:first-child > i.bi {
  position: static;
  font-size: 1rem;
  margin-right: 0.35rem;
}

.lable-black {
  color: #1e293b !important;
  font-weight: 500;
}

.history-title {
  margin-bottom: 0.5rem;
}

.history-card {
  background: white;
  border: 1px solid #e9ecef;
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.history-card .history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: #212529;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.history-card .history-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: transparent;
  padding: 0;
}

.history-card .history-bottom > span {
  display: inline-block;
  background: #eaf8ef;
  color: #2f6b45;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.history-card .history-bottom.fail > span {
  background: #fff1f0;
  color: #a8071a;
}

.history-card .ok-text {
  color: #198754;
  font-style: normal;
  font-weight: 600;
}

.history-card .fail-text {
  color: #dc3545;
  font-style: normal;
  font-weight: 600;
}

.result-fail {
  color: #e53935;
  font-size: 0.95rem;
  line-height: 1.8;
  padding: 0.35rem 0.25rem;
  text-align: left;
}

.result-fail div {
  margin: 0;
}

.result-success {
  padding: 0.15rem 0.1rem 0.35rem;
}

.result-success-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.result-wx {
  font-weight: 600;
  color: #212529;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pill.ok {
  background: #d1f2df;
  color: #198754;
}

.result-success-time {
  color: #6c757d;
  font-size: 0.85rem;
}

.result-row {
  display: flex;
  gap: 0.5rem;
}

.result-row .label {
  color: #6c757d;
  min-width: 5.5rem;
}

.result-badge,
.badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

.badge-ok,
.badge-normal {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
}

.badge-warn,
.badge-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

#resultArea[hidden],
#historyEmpty[hidden] {
  display: none !important;
}

.footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-bottom: 1rem;
}

.beian-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
}

.beian-link {
  color: #0d6efd;
  text-decoration: underline;
  font-size: 0.8rem;
}

.copyright-text p {
  margin: 0.55rem 0 0;
  color: #495057;
  font-size: 0.78rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  background: rgba(33, 37, 41, 0.92);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  z-index: 2000;
  opacity: 0;
  transition: 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  body {
    padding: 0;
    background: #f0f4f8;
  }

  .container {
    padding: 0.75rem 0.75rem 1rem;
  }

  .card-lable {
    margin-left: 0;
    margin-right: 0;
  }

  .card-header {
    font-size: 0.9rem;
  }

  #queryCard {
    top: 0.5rem;
    border-radius: 10px;
    width: 100%;
  }

  .beian-info {
    flex-direction: column;
    align-items: center;
  }

  .beian-info a {
    width: auto;
    margin-left: 0 !important;
  }
}
