:root {
  color: #172033;
  background: #eef3f7;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eef3f7;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbfd 0, #eef3f7 340px),
    #eef3f7;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

#app {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: #5e6a7a;
}

.error {
  color: #a83f3f;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #426a89;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: #121b2b;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.scanStamp {
  min-width: 230px;
  display: grid;
  gap: 5px;
  justify-items: end;
  color: #657184;
  font-size: 13px;
}

.scanStamp strong {
  color: #172033;
  font-size: 15px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  min-height: 82px;
  padding: 15px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(35, 52, 74, 0.06);
}

.stat span {
  color: #657184;
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 9px;
  color: #111827;
  font-size: 27px;
  line-height: 1;
}

.probeBanner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #ccd8e4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(35, 52, 74, 0.05);
}

.probeBanner div {
  display: grid;
  gap: 4px;
}

.probeBanner strong {
  color: #172033;
  font-size: 14px;
}

.probeBanner span {
  color: #657184;
  font-size: 12px;
}

.probeBanner.active {
  border-color: #9ac6e3;
  background: #f5fbff;
}

.probeBanner.done {
  border-color: #a9d9c0;
  background: #f5fbf7;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(148px, 180px)) repeat(2, max-content);
  gap: 10px;
  align-items: end;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(35, 52, 74, 0.07);
}

.searchBox,
.selectBox {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.searchBox span,
.selectBox span {
  color: #5e6a7a;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #c9d6e2;
  border-radius: 6px;
  background: #fbfdff;
  color: #172033;
  padding: 0 12px;
}

input:focus,
select:focus {
  outline: 2px solid #68a7d8;
  outline-offset: 1px;
}

button,
.button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:focus-visible,
.button:focus-visible {
  outline: 2px solid #68a7d8;
  outline-offset: 2px;
}

.primary {
  background: #176b87;
  color: #ffffff;
  font-weight: 800;
}

.primary:hover {
  background: #125c75;
}

.secondary {
  background: #e6edf4;
  color: #243244;
  font-weight: 750;
}

.secondary:hover {
  background: #dbe6ef;
}

.secondary.ghost {
  background: #f4f7fa;
  color: #596579;
}

.resultHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 12px;
}

.resultHeader h2 {
  color: #121b2b;
  font-size: 22px;
}

.resultHeader p {
  color: #657184;
  font-size: 14px;
}

.siteGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.siteCard {
  min-height: 282px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(35, 52, 74, 0.07);
}

.siteCard:hover {
  border-color: #b9c9d8;
  box-shadow: 0 18px 40px rgba(35, 52, 74, 0.11);
}

.cardHead {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.monogram {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #22765d;
  color: #ffffff;
  font-weight: 850;
}

.cardHead h3 {
  overflow: hidden;
  color: #121b2b;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardHead p {
  margin-top: 4px;
  overflow: hidden;
  color: #657184;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metaLine {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metaLine span {
  min-height: 24px;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3f7;
  color: #5e6a7a;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metaLine .ok {
  background: #ddf4e7;
  color: #176148;
}

.metaLine .warn {
  background: #fff0d7;
  color: #8a5a12;
}

.metaLine .checking {
  background: #e7f1fb;
  color: #176b87;
}

.primaryLink {
  overflow-wrap: anywhere;
  color: #176b87;
  font-weight: 850;
  text-decoration: none;
}

.primaryLink:hover,
.domainList a:hover {
  text-decoration: underline;
}

.domainList {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.domainList a {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f3f7fa;
  color: #39485b;
  font-size: 12px;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.usageLine {
  min-height: 18px;
  color: #657184;
  font-size: 12px;
}

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

.actions .button,
.actions button {
  flex: 1;
}

.empty {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #ffffff;
  color: #657184;
  text-align: center;
  box-shadow: 0 12px 28px rgba(35, 52, 74, 0.06);
}

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

  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .siteGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #app {
    width: min(100% - 20px, 1500px);
    padding-top: 18px;
  }

  h1 {
    font-size: 32px;
  }

  .topbar,
  .resultHeader,
  .probeBanner {
    display: grid;
  }

  .scanStamp {
    min-width: 0;
    justify-items: start;
  }

  .stats,
  .toolbar,
  .siteGrid {
    grid-template-columns: 1fr;
  }

  .siteCard {
    min-height: 0;
  }
}
