:root {
  /* 与 ui.hipoit.com（HmUI）对齐的设计变量 */
  --brand: #00a4a6;
  --brand-deep: #007274;
  --brand-soft: #e9f7f7;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #1f2329;
  --ink-2: #4a5058;
  --muted: #8a9099;
  --line: #e7e9ec;
  --line-2: #f0f2f5;
  --fill: #f4f5f7;
  --good: #00a4a6;
  --good-soft: #e9f7f7;
  --warn: #ed7b2f;
  --warn-soft: #fdf1e8;
  --bad: #d54941;
  --bad-soft: #fbeceb;
  --radius: 8px;
  --radius-s: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #eaf8f8 0, rgba(245, 247, 248, 0) 470px);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------------- 顶栏 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 64px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 27px; width: auto; display: block; }
.brand-divider { width: 1px; height: 16px; background: var(--line); }
.brand-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: .2px;
}
.ghost-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 6px 14px; border-radius: var(--radius-s); font-size: 13px; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------- 主体 ---------------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

.hero {
  padding: 52px 0 8px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 700;
  color: var(--ink);
}
.hero h1 .hl { color: var(--brand); }
.hero .sub {
  max-width: 660px; margin: 0 auto 30px;
  color: var(--ink-2); font-size: 15px;
}

/* 搜索区 */
.search-box { max-width: 720px; margin: 0 auto; text-align: left; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--fill); border-radius: var(--radius-s); margin-bottom: 14px;
  border: 1px solid var(--line-2);
}
.seg-btn {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 20px; border-radius: 4px; font-size: 13.5px; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.seg-btn:hover { color: var(--brand); }
.seg-btn.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

.input-row {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 6px 6px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 164, 166, .12);
}
.input-icon { color: var(--muted); font-size: 16px; }
.input-row input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 15px; padding: 10px 4px; color: var(--ink); font-family: inherit;
}
.input-row input::placeholder { color: #b3b8bf; }
#submitBtn {
  border: 0; border-radius: var(--radius-s);
  background: var(--brand);
  color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 24px; cursor: pointer; font-family: inherit;
  transition: background .15s; white-space: nowrap;
}
#submitBtn:hover { background: var(--brand-deep); }
#submitBtn:disabled { opacity: .6; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 12.5px; margin: 12px 2px 0; }

.msg {
  max-width: 720px; margin: 16px auto 0; text-align: left;
  padding: 11px 14px; border-radius: var(--radius-s);
  background: var(--bad-soft); color: #b03a33; font-size: 13.5px;
  border: 1px solid #f3d3d0;
}

/* ---------------- 加载 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.loading-card {
  max-width: 720px; margin: 32px auto 0;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px 16px;
  box-shadow: var(--shadow);
}
.spinner {
  grid-row: span 2;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #e9f7f7; border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.loading-text p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.loading-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-indeterminate {
  grid-column: 1 / -1; height: 3px; margin-top: 14px;
  background: var(--line-2); border-radius: 2px; overflow: hidden;
}
.bar-indeterminate i {
  display: block; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }

/* ---------------- 结果 ---------------- */
.result { margin-top: 32px; scroll-margin-top: 84px; }

.overview {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  padding: 28px 30px; align-items: start;
  box-shadow: var(--shadow);
}
.gauge { text-align: center; }
.gauge-ring { position: relative; width: 172px; height: 172px; margin: 0 auto; }
.gauge svg { width: 172px; height: 172px; display: block; }
.gauge-mid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none;
}
.gauge-mid b { font-size: 42px; line-height: 1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.gauge-mid span { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.gauge-cap { margin-top: 8px; font-size: 13px; color: var(--ink-2); }

.overview-right { min-width: 0; }
.url-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.url-line a { color: var(--brand); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.url-line a:hover { text-decoration: underline; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 3px; font-size: 11.5px;
  background: var(--fill); color: var(--ink-2); white-space: nowrap;
}

.score-rows { display: grid; gap: 14px; }
.score-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 12px; }
.score-row .name { font-size: 13.5px; color: var(--ink-2); }
.score-row .track { display: block; height: 6px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.score-row .fill { display: block; height: 100%; border-radius: 2px; width: 0; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.score-row .val { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* 截图 */
.shot-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 22px; align-items: center;
  width: max-content; max-width: 100%; margin: 0 auto;
}
.shot-meta { max-width: 220px; }
.shot-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.shot-desc { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.shot {
  max-width: 190px; max-height: 270px;
  object-fit: cover; object-position: top center;
  border-radius: 4px; border: 1px solid var(--line);
  display: block; cursor: zoom-in;
}

/* 区块 */
.block { margin-top: 26px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 0 0 12px;
}
.block-head h2 {
  margin: 0; font-size: 16px; letter-spacing: -.2px; font-weight: 700;
  display: flex; align-items: center;
}
.block-head h2::before {
  content: ""; width: 3px; height: 15px; background: var(--brand);
  border-radius: 2px; margin-right: 9px; display: inline-block;
}
.block-head .cap { color: var(--muted); font-size: 12.5px; }

/* 指标卡 */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.metric::after {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
}
.metric.green::after { background: var(--good); }
.metric.orange::after { background: var(--warn); }
.metric.red::after { background: var(--bad); }
.metric.gray::after { background: #c6c9cf; }
.metric h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.metric .v { font-size: 23px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.metric .v.green { color: var(--good); }
.metric .v.orange { color: var(--warn); }
.metric .v.red { color: var(--bad); }
.metric .v.gray { color: var(--muted); }
.metric p { margin: 7px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }

/* 列表 */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  cursor: pointer; transition: background .15s;
}
.item-head:hover { background: #fafcfc; }
.item-head .chev { color: #a6abb3; font-size: 11px; transition: transform .2s; flex: none; }
.item.open .item-head .chev { transform: rotate(90deg); }
.item-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.badges { display: flex; gap: 6px; flex: none; }
.badge {
  font-size: 11.5px; padding: 2px 8px; border-radius: 3px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge.time { background: var(--warn-soft); color: #a8561a; }
.badge.bytes { background: var(--brand-soft); color: var(--brand-deep); }
.item-body {
  display: none; padding: 0 18px 16px 41px;
  color: var(--ink-2); font-size: 13px; line-height: 1.7;
}
.item.open .item-body { display: block; }
.item-body .muted { color: var(--muted); }

.diag-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px;
}
.diag-row:last-child { border-bottom: 0; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot.green { background: var(--good); }
.dot.orange { background: var(--warn); }
.dot.red { background: var(--bad); }
.dot.gray { background: #c6c9cf; }
.diag-row .t { flex: 1; min-width: 0; color: var(--ink); }
.diag-row .val { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.passed {
  padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.tag {
  font-size: 12px; color: var(--brand-deep); background: var(--brand-soft);
  padding: 3px 9px; border-radius: 3px;
}
.passed-more { display: contents; }
.actions-inline { margin-top: 10px; text-align: right; }

/* 操作按钮 */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.btn-primary, .btn-line {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-s); font-size: 13.5px; cursor: pointer;
  text-decoration: none; font-family: inherit; transition: .15s;
}
.btn-primary { border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-line { border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }
.btn-line.small { padding: 7px 14px; font-size: 12.5px; }

.warn {
  margin-top: 18px; padding: 11px 14px; border-radius: var(--radius-s);
  background: var(--warn-soft); border: 1px solid #f6e0cd; color: #a8561a; font-size: 13px;
}

/* 说明区 */
.explain { margin: 54px 0 40px; padding: 32px 0 0; border-top: 1px solid var(--line); }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.explain-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px 22px; transition: border-color .15s, box-shadow .15s;
}
.explain-item:hover { border-color: #cfeeed; box-shadow: var(--shadow); }
.ico {
  width: 34px; height: 34px; border-radius: 4px; background: var(--brand-soft);
  display: grid; place-items: center; color: var(--brand); margin-bottom: 14px;
}
.ico svg { width: 18px; height: 18px; }
.explain-item h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.explain-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.foot {
  border-top: 1px solid var(--line); padding: 20px 22px 30px;
  text-align: center; color: var(--muted); font-size: 12.5px;
  background: #fff;
}

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(31, 35, 41, .55);
  display: grid; place-items: center; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-inner {
  position: relative; background: #fff; border-radius: var(--radius);
  max-width: 860px; max-height: 88vh; overflow: auto; padding: 32px 32px 26px;
  box-shadow: var(--shadow-2);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--brand); }
.modal-body h3 { margin: 0 0 10px; font-size: 16px; }
.modal-inner img { max-width: 100%; border-radius: 4px; border: 1px solid var(--line); }
.modal-inner h4 { margin: 18px 0 6px; font-size: 14px; }
.modal-inner h4::before {
  content: ""; display: inline-block; width: 3px; height: 12px;
  background: var(--brand); border-radius: 2px; margin-right: 8px; vertical-align: -1px;
}
.modal-inner p { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }

/* 响应式 */
@media (max-width: 860px) {
  .overview { grid-template-columns: 1fr; padding: 24px; gap: 18px; }
  .gauge-ring { width: 140px; height: 140px; }
  .gauge svg { width: 140px; height: 140px; }
  .gauge-mid b { font-size: 34px; }
  .gauge-mid span { font-size: 10.5px; margin-top: 2px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .explain-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  main { padding: 0 16px; }
  .nav-inner { padding: 0 16px; height: 56px; }
  .brand-logo { height: 22px; }
  .hero { padding-top: 34px; }
  .hero .sub { font-size: 14px; margin-bottom: 22px; }
  .input-row { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .input-icon { display: none; }
  .input-row input { width: 100%; flex: 1 1 100%; }
  #submitBtn { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 14px; }
  .metric .v { font-size: 19px; }
  .score-row { grid-template-columns: 78px 1fr 38px; }
  .loading-card { grid-template-columns: auto 1fr; padding: 18px; }
  .loading-meta { display: none; }
  .shot-card { flex-direction: column; gap: 12px; width: 100%; }
  .shot-meta { max-width: 100%; text-align: center; }
  .item-head { padding: 13px 14px; }
  .item-body { padding: 0 14px 14px 31px; }
  .modal-inner { padding: 26px 18px 20px; }
}

/* ---------------- 最近查询 ---------------- */
.recent { margin: 8px 0 46px; }
.recent-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 0 0 14px;
}
.recent-head h2 {
  margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px;
  display: flex; align-items: center;
}
.recent-head h2::before {
  content: ""; width: 3px; height: 15px; background: var(--brand);
  border-radius: 2px; margin-right: 9px; display: inline-block;
}
.recent-head .cap { color: var(--muted); font-size: 12.5px; }

.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recent-card {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 12px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.recent-card:hover {
  border-color: #bfe6e5; box-shadow: var(--shadow); transform: translateY(-1px);
}
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rc-host {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-dev { font-size: 11px; color: var(--muted); background: var(--fill); padding: 1px 7px; border-radius: 3px; flex: none; }
.rc-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rc-cell { display: flex; flex-direction: column; align-items: flex-start; }
.rc-cell b { font-size: 15px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.rc-cell i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.rc-time { margin-top: 8px; font-size: 11.5px; color: #a6abb3; }

@media (max-width: 860px) {
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .recent-grid { grid-template-columns: 1fr; }
  .recent { margin-bottom: 34px; }
}
