:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #18272d;
  background: #f4f6f5;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --muted: #576764;
  --border: #dce4e0;
  --accent: #005c52;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, p, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #197770; outline-offset: 3px; }

.wrap {
  width: calc(100% - 72px);
  max-width: 1080px;
  margin: 0 auto;
}

.top { background: #fff; border-bottom: 1px solid var(--border); }
.top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 71px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #32544f;
  background: #fff;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-link:hover { border-color: #8aada5; background: #f1f7f5; }
.main { padding: 54px 0 64px; }
.intro { margin-bottom: 27px; }

.mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .06em;
}

.mode span { width: 7px; height: 7px; border-radius: 50%; background: #1a8777; }
.intro h1 {
  margin-top: 11px;
  font-size: 2.5rem;
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -.045em;
}
.intro-description { margin-top: 12px; color: var(--muted); line-height: 1.6; }

.device-page, .probe-page {
  --muted: #484848;
  --border: #ddd;
  --accent: #171717;
  color: #171717;
  background: #f5f5f5;
}

.result-intro { margin-bottom: 23px; text-align: center; }
.result-intro h1 {
  margin: 18px 0 5px;
  font-size: 1.625rem;
  line-height: 1.25;
  letter-spacing: .12em;
}
.device-details { display: grid; gap: 12px; width: 91%; max-width: 580px; margin: 0 auto; }
.device-details .panel, .probe-content .panel { padding: clamp(13px, 2.8vw, 22px); border-color: #b5a56d; }
.result-card { container-type: inline-size; }
.result-code div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: .9375rem;
  font-weight: 700;
}
.result-code dt { flex: none; }
.result-code dd {
  min-width: 0;
  padding: 2px 8px;
  background: #e5e5e5;
  font-family: inherit;
  overflow-wrap: anywhere;
}
.result-text { width: fit-content; max-width: 100%; }
.result-copy {
  margin-top: 10px;
  font-size: clamp(.75rem, calc(4.4vw - 2px), 1.125rem);
  font-size: clamp(.75rem, 5.05cqi, 1.125rem);
  line-height: 1.65;
}
.result-copy p + p { margin-top: 3px; }
.result-copy strong { font-size: 1.28em; }
.result-card .result-count { margin-top: 13px; padding-top: 10px; }
.result-card .result-count span:last-child { margin-left: auto; }
.result-card .result-count strong { text-decoration: underline; }

.device-photo { position: relative; max-width: 800px; margin: 27px auto 0; }
.device-photo-image { display: block; width: 100%; height: auto; }
.device-qr {
  position: absolute;
  top: 18%;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.device-qr span { writing-mode: vertical-rl; font-size: clamp(.625rem, 1.35vw, .875rem); line-height: 1.15; }
.device-qr img { display: block; width: clamp(49px, 14vw, 115px); height: auto; }

.panel { min-width: 0; padding: 25px; background: #fff; border: 1px solid var(--border); border-radius: 11px; }
.panel h2 { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; line-height: 1.35; }
.product-card h2 { font-size: 1.2rem; }
.record-list { display: grid; gap: 5px; margin-top: 6px; }
.record-list div {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-size: clamp(.9375rem, 3.5vw, 1.125rem);
  line-height: 1.45;
}

.record-list dt { flex: none; }
.record-list dd { min-width: 0; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .025em; }
.icon { position: relative; display: inline-block; flex: none; border-radius: 6px; }
.icon--brand { width: 32px; height: 32px; background: #005c52; color: #fff; }
.icon--brand i { position: absolute; inset: 8px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon--brand i::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  border-radius: 1px;
}

.admin-main { max-width: 680px; }
.form-panel { display: grid; gap: 19px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .9375rem; font-weight: 650; }
.field input {
  min-width: 0;
  min-height: 46px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #aebfbb;
  border-radius: 6px;
  background: #fcfdfd;
  color: #18272d;
}
.field input[aria-invalid="true"] { border-color: #aa392e; }
.field-error { color: #97281f; font-size: .875rem; }
.form-actions { margin-top: 2px; }
.save {
  min-height: 45px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: .9375rem;
  font-weight: 650;
  cursor: pointer;
}
.save:hover { background: #00483f; }
.notice {
  margin-bottom: 13px;
  padding: 12px 16px;
  border: 1px solid #a7cfc2;
  border-radius: 7px;
  color: #06574a;
  background: #eaf6f1;
  line-height: 1.5;
}
.notice--error { border-color: #e8b8ad; color: #97281f; background: #fff3f0; }

@media (max-width: 630px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { min-height: 60px; }
  .main { padding: 35px 0 40px; }
  .intro { margin-bottom: 20px; }
  .panel { padding: 19px; }
}

@media (max-width: 360px) {
  .wrap { width: calc(100% - 24px); }
}

.top-nav { display: flex; align-items: center; gap: 7px; }
.admin-nav { display: flex; gap: 7px; margin-bottom: 14px; }
.admin-nav a {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-weight: 650;
}
.admin-nav a[aria-current="page"] { border-color: #9dc7bb; background: #e4f3ec; color: var(--accent); }

.probe-content { width: 91%; max-width: 580px; margin: 0 auto; }
.result-brand { display: block; width: 106px; height: auto; margin: 0 auto; filter: grayscale(1); }

.result-count {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: .875rem;
}
.result-count strong { color: var(--accent); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.probe-content .product-card { margin-top: 12px; }

.probe-catalog { margin-top: 17px; }
.probe-models {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 22px 4px;
  list-style: none;
  margin: 0;
  padding: 0 0 24px;
}
.probe-model { position: relative; display: grid; justify-items: center; gap: 1px; min-width: 0; text-align: center; line-height: 1.25; }
.probe-model:nth-child(5n + 2), .probe-model:nth-child(5n + 4) { top: 14px; }
.probe-model:nth-child(5n + 3) { top: 24px; }
.probe-model-image {
  display: grid;
  place-items: center;
  width: min(100%, 64px);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #eee;
}
.probe-model-image img { display: block; width: 88%; height: auto; }
.probe-model strong { margin: 4px 0 1px; color: var(--accent); font-size: .875rem; font-variant-numeric: tabular-nums; }
.probe-model-layer { color: #353535; font-size: .75rem; white-space: nowrap; }

@media (max-width: 360px) {
  .top-nav .nav-link { padding-inline: 7px; font-size: .8125rem; }
}

.admin-list { position: relative; }
.admin-main .intro h1, .admin-list .intro h1 { font-size: 1.8rem; }
.admin-page { min-height: 100vh; }
.logout { position: absolute; top: 54px; right: 0; }
.field-help { color: var(--muted); font-size: .875rem; line-height: 1.5; }
input[readonly] { background: #eef1ef; }
.list-toolbar { display: flex; justify-content: space-between; gap: 14px; margin: 24px 0 16px; flex-wrap: wrap; }
a.save { display: inline-flex; align-items: center; justify-content: center; }
.list-search { display: flex; gap: 7px; }
.list-search input { width: min(48vw, 260px); min-width: 0; border: 1px solid #aebfbb; border-radius: 6px; padding: 8px 12px; font: inherit; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.records-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.records-table th, .records-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.records-table th { background: #edf2ef; white-space: nowrap; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table small { display: block; margin-top: 6px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.admin-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 650; }
.row-actions { white-space: nowrap; }
.row-actions .nav-link { min-height: 36px; padding-inline: 9px; font-size: .8125rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; }
.qr-panel { display: grid; justify-items: center; gap: 12px; }
.record-qr { width: min(100%, 320px); height: auto; }
.verification-link { overflow-wrap: anywhere; font-size: .9375rem; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; border: 0; }
@media (max-width: 630px) {
  .logout { top: 35px; }
}
