/* ==========================================================================
   网络模块：连通测试 + 本机信息 + 设备信息（设备部分用 device.css）
   ========================================================================== */

.nm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nm-probe {
  padding: 18px;
}

.nm-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.nm-sub {
  margin: 3px 0 0;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.nm-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.nm-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-sunken);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.nm-field:focus-within {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.nm-field svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--color-text-tertiary);
}

.nm-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--text-body);
  outline: none;
}

.nm-go {
  flex: none;
  height: 44px;
  padding: 0 22px;
}

.nm-go:disabled {
  opacity: 0.6;
  cursor: default;
}

.nm-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.nm-chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--text-caption);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.nm-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.nm-result {
  margin-top: 14px;
}

.nm-result:empty {
  display: none;
}

.nm-verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-surface-sunken);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
}

.nm-verdict b {
  font-weight: 600;
  color: var(--color-text-primary);
}

.nm-verdict .hint {
  margin-left: auto;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

.nm-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

.nm-verdict.is-ok .nm-dot {
  background: var(--color-success);
}

.nm-verdict.is-bad .nm-dot {
  background: var(--color-error);
}

.nm-verdict.is-loading .nm-dot {
  background: var(--color-primary);
  animation: nm-pulse 1s ease-in-out infinite;
}

@keyframes nm-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.nm-kv {
  margin-top: 6px;
}

.nm-kv .v.small {
  font-size: var(--text-caption);
  word-break: break-all;
  line-height: 1.5;
}

.nm-geo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.nm-geo.is-empty {
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  border-style: dashed;
}

.nm-geo.is-empty svg {
  width: 15px;
  height: 15px;
}

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

.nm-geo-place {
  display: block;
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.nm-geo-isp {
  display: block;
  margin-top: 2px;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.nm-geo-src {
  flex: none;
  font-size: var(--text-micro);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------- 本机信息 */

.nm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.nm-stat {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-surface-sunken);
}

.nm-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.nm-stat-label svg {
  width: 13px;
  height: 13px;
}

.nm-stat b {
  display: block;
  margin-top: 5px;
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

@media (max-width: 560px) {
  .nm-form {
    flex-direction: column;
  }

  .nm-go {
    width: 100%;
  }

  .nm-verdict {
    flex-wrap: wrap;
  }

  .nm-verdict .hint {
    width: 100%;
    margin-left: 18px;
  }
}

/* 网络模块桌面端双栏：连通测试 + 本机信息并排，设备信息占满底栏 */
@media (min-width: 980px) {
  .nm {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 16px;
    /* 两栏上下沿都对齐：等高拉伸，内部内容再各自铺满 */
    align-items: stretch;
  }
  .nm-device { grid-column: 1 / -1; }
  .nm-probe, .nm-local { padding: 20px; }
  .nm-local { display: flex; flex-direction: column; }
  .nm-local #nm-local-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}
