/**
 * Website statistics module.
 */

.qimeng-stats-wrapper {
  color: #242424;
}

.qm-stats-panel {
  --qm-stats-surface: #fff;
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  min-height: 112px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--qm-stats-surface);
  box-shadow: 0 5px 16px rgba(133, 68, 49, 0.08);
}

.qm-stats-brand {
  position: relative;
  display: flex;
  min-height: 112px;
  padding: 14px 16px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 238, 157, 0.48), transparent 38%),
    linear-gradient(138deg, #f34f9b 0%, #fa6f91 45%, #ffbd59 100%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 166 160' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M0 0h148c-17 18-20 39-10 61 8 18 8 32 0 50-8 18-7 34 6 49H0V0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 166 160' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M0 0h148c-17 18-20 39-10 61 8 18 8 32 0 50-8 18-7 34 6 49H0V0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.qm-stats-brand::before,
.qm-stats-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.qm-stats-brand::before {
  width: 208px;
  height: 208px;
  top: -42px;
  right: -98px;
  border: 26px solid rgba(255, 188, 129, 0.42);
}

.qm-stats-brand::after {
  width: 136px;
  height: 136px;
  bottom: -95px;
  left: -82px;
  border: 17px solid rgba(255, 229, 204, 0.5);
}

.qm-stats-brand-orbit {
  position: relative;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  color: #fff;
}

.qm-stats-brand-orbit svg {
  width: 28px;
  height: 28px;
}

.qm-stats-heading {
  position: relative;
  z-index: 4;
  margin: 0;
  color: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.qm-stats-brand-year {
  position: relative;
  z-index: 4;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  line-height: 1.2;
}

.qm-stats-grid {
  display: grid;
  grid-template-columns: repeat(min(var(--qm-stats-columns, 10), 10), minmax(0, 1fr));
  margin: 0;
  padding: 8px 4px 7px;
  list-style: none;
  background: var(--qm-stats-surface);
}

.qm-stats-item {
  --qm-stats-accent: #ee654b;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 96px;
  padding: 0 4px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.qm-stats-item::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 44px;
  background: #eee9e7;
  transform: translateY(-50%);
  content: '';
}

.qm-stats-item:last-child::after {
  display: none;
}

.qm-stats-item:hover .qm-stats-icon-wrapper {
  transform: translateY(-2px);
}

.qm-stats-icon-wrapper {
  --qm-stats-icon-color: #f15f78;
  --qm-stats-icon-bg: #fff0f4;
  order: 2;
  display: grid;
  width: 32px;
  height: 32px;
  margin: 2px 0 1px;
  place-items: center;
  border-radius: 50%;
  color: var(--qm-stats-icon-color);
  background: var(--qm-stats-icon-bg);
  transition: transform 180ms ease;
}

.qm-stats-icon-wrapper i {
  font-size: 15px;
  line-height: 1;
}

.qm-stats-label,
.qm-stats-value {
  display: block;
  max-width: 100%;
  letter-spacing: 0;
  white-space: nowrap;
}

.qm-stats-label {
  order: 1;
  overflow: hidden;
  color: #934334;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.qm-stats-value {
  order: 3;
  margin-bottom: 1px;
  color: #20242b;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.1;
}

.qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper {
  --qm-stats-icon-color: #f6ad2f;
  --qm-stats-icon-bg: #fff8e8;
}

.qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper {
  --qm-stats-icon-color: #39c887;
  --qm-stats-icon-bg: #edfbf3;
}

.dark .qm-stats-panel,
html.dark .qm-stats-panel,
body.dark-mode .qm-stats-panel,
html[data-bs-theme='dark'] .qm-stats-panel,
html[data-qm-theme-mode='dark'] .qm-stats-panel {
  --qm-stats-surface: #252329;
  background: var(--qm-stats-surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.dark .qm-stats-grid,
html.dark .qm-stats-grid,
body.dark-mode .qm-stats-grid,
html[data-bs-theme='dark'] .qm-stats-grid,
html[data-qm-theme-mode='dark'] .qm-stats-grid {
  background: var(--qm-stats-surface);
}

.dark .qm-stats-item::after,
html.dark .qm-stats-item::after,
body.dark-mode .qm-stats-item::after,
html[data-bs-theme='dark'] .qm-stats-item::after,
html[data-qm-theme-mode='dark'] .qm-stats-item::after {
  background: rgba(148, 163, 184, 0.16);
}

.dark .qm-stats-label,
html.dark .qm-stats-label,
body.dark-mode .qm-stats-label,
html[data-bs-theme='dark'] .qm-stats-label,
html[data-qm-theme-mode='dark'] .qm-stats-label {
  color: #ed9d8d;
}

.dark .qm-stats-value,
html.dark .qm-stats-value,
body.dark-mode .qm-stats-value,
html[data-bs-theme='dark'] .qm-stats-value,
html[data-qm-theme-mode='dark'] .qm-stats-value {
  color: #f8fafc;
}

.dark .qm-stats-icon-wrapper,
html.dark .qm-stats-icon-wrapper,
body.dark-mode .qm-stats-icon-wrapper,
html[data-bs-theme='dark'] .qm-stats-icon-wrapper,
html[data-qm-theme-mode='dark'] .qm-stats-icon-wrapper {
  --qm-stats-icon-bg: rgba(241, 95, 120, 0.14);
}

.dark .qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper,
html.dark .qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper,
body.dark-mode .qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper,
html[data-bs-theme='dark'] .qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper,
html[data-qm-theme-mode='dark'] .qm-stats-item:nth-child(3n + 2) .qm-stats-icon-wrapper {
  --qm-stats-icon-bg: rgba(246, 173, 47, 0.14);
}

.dark .qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper,
html.dark .qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper,
body.dark-mode .qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper,
html[data-bs-theme='dark'] .qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper,
html[data-qm-theme-mode='dark'] .qm-stats-item:nth-child(3n) .qm-stats-icon-wrapper {
  --qm-stats-icon-bg: rgba(57, 200, 135, 0.14);
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .qm-stats-panel {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .qm-stats-grid {
    padding-right: 5px;
    padding-left: 5px;
  }

  .qm-stats-item {
    padding-right: 3px;
    padding-left: 3px;
  }

  .qm-stats-label {
    font-size: 12px;
  }

  .qm-stats-value {
    font-size: 16px;
  }
}

@media (max-width: 1199.98px) {
  .qm-stats-panel {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .qm-stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 13px;
  }

  .qm-stats-item:nth-child(5n)::after {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .qm-stats-panel {
    display: block;
    border-radius: 10px;
  }

  .qm-stats-brand {
    min-height: 92px;
    padding: 12px 15px;
  }

  .qm-stats-brand {
    -webkit-mask: none;
    mask: none;
  }

  .qm-stats-brand-orbit {
    width: 36px;
    height: 36px;
    margin-bottom: 5px;
    border-width: 4px;
  }

  .qm-stats-brand-orbit svg {
    width: 24px;
    height: 24px;
  }

  .qm-stats-heading {
    font-size: 17px;
  }

  .qm-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 6px 3px 5px;
  }

  .qm-stats-item {
    min-height: 78px;
    padding: 0 5px;
  }

  .qm-stats-item::after {
    height: 36px;
  }

  .qm-stats-item:nth-child(odd)::after {
    display: block;
  }

  .qm-stats-item:nth-child(even)::after {
    display: none;
  }

  .qm-stats-icon-wrapper {
    width: 29px;
    height: 29px;
    margin-top: 2px;
  }

  .qm-stats-icon-wrapper i {
    font-size: 14px;
  }

  .qm-stats-label {
    font-size: 12px;
  }

  .qm-stats-value {
    margin-bottom: 4px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qm-stats-icon-wrapper {
    transition: none;
  }
}
