:root {
  --bg: #eef3f6;
  --panel: #f7f9fb;
  --line: #dbe3ea;
  --text: #1c2a39;
  --muted: #5e7085;
  --brand: #0d7c95;
  --brand-dark: #0a5e73;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #dce8f0 0%, var(--bg) 120px, var(--bg) 100%);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
}

.app {
  width: min(1760px, 98vw);
  margin: 10px auto 18px;
  display: grid;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #c2ced8;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.net-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9534f;
}

.net-online {
  color: #177245;
  border-color: #9ad8b9;
  background: #eefbf3;
}

.net-online::before {
  background: #1aa65f;
}

.net-checking {
  color: #8a6410;
  border-color: #e2c987;
  background: #fff8e6;
}

.net-checking::before {
  background: #d29c1d;
}

.net-offline {
  color: #9b2e25;
  border-color: #e2b2ad;
  background: #fff2f1;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #c2ced8;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.ghost-btn:hover {
  border-color: #9eb4c7;
}

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

.brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 0.01em;
}

.quad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.quad-grid .panel {
  height: 430px;
  display: flex;
  flex-direction: column;
}

h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.card-title {
  margin: 0 0 10px;
  font-size: 24px;
}

label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 15px;
}

.search-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cfd8e1;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
}

button {
  border: 1px solid #c2ced8;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font-weight: 600;
}

.suggestions {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.suggestion {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #cfd8e1;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.suggestion small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kv {
  margin: 0;
  display: grid;
  gap: 8px;
  padding-left: 0;
}

.kv li {
  list-style: none;
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.kv span {
  color: var(--muted);
  margin-right: 8px;
}

.financing-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.financing-item {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.link {
  color: var(--brand);
  text-decoration: none;
}

.link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.list {
  margin: 8px 0 0;
  padding-left: 0;
  display: grid;
  gap: 6px;
  overflow: auto;
  max-height: 340px;
  padding-right: 4px;
}

.list li {
  list-style: none;
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.rank {
  color: var(--brand);
  font-weight: 700;
  margin-right: 6px;
}

.hidden {
  display: none;
}

.empty {
  color: #b24b39;
}

.test-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #cfd8e1;
  background: #fff;
}

.badge.pass {
  color: #1b6e3f;
  border-color: #b7e1c7;
  background: #effaf3;
}

.badge.fail {
  color: #a33b2c;
  border-color: #efc0b9;
  background: #fff2f0;
}

.test-list {
  margin: 10px 0 0;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.test-item {
  list-style: none;
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.test-item.pass {
  border-color: #b7e1c7;
  background: #f7fff9;
}

.test-item.fail {
  border-color: #efc0b9;
  background: #fff4f2;
}

.test-title {
  font-size: 16px;
  font-weight: 700;
}

.test-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.note ul {
  margin: 6px 0 0;
  color: var(--muted);
}

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

  .brand h1 {
    font-size: 28px;
  }
}

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