:root {
  --red: #fc3f1d;
  --red-hover: #e23618;
  --red-active: #cc3016;
  --title: #1254d6;
  --title-visited: #6b3fa0;
  --domain: #1a7a34;
  --path: #70757a;
  --muted: #767676;
  --text: #222;
  --line: #e6e6e6;
  --logo-col: 156px;
  --col-gap: 18px;
  --page-pad: 28px;
  --result-col: 640px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  background: #fff;
  color: #161616;
}

body {
  font-family: Arial, Helvetica, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font-family: inherit; }

a { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.logo {
  color: #161616;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

.logo-tld { color: var(--red); }

.logo-home { font-size: 52px; }

.logo-small { font-size: 22px; letter-spacing: -0.04em; }

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22vh 16px 80px;
}

.searchbar {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 0 6px 0 6px;
}

.searchbar:focus-within {
  border-color: #d5d5d5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 0 8px 0 12px;
  color: #111;
}

.searchbar input::placeholder { color: #9aa0a6; }

.searchbar input::-webkit-search-cancel-button,
.searchbar input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.searchbar-home {
  width: min(584px, calc(100vw - 32px));
  margin-top: 28px;
}

.searchbar button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.searchbar button[type="submit"]:hover { background: var(--red-hover); }
.searchbar button[type="submit"]:active { background: var(--red-active); }

.searchbar .clear {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.searchbar .clear:hover { background: #f2f2f2; color: #333; }

.topbar,
.serp { display: none; }

html.mode-serp .home { display: none; }

html.mode-serp .topbar,
html.mode-serp .serp {
  display: grid;
  grid-template-columns: var(--logo-col) minmax(0, var(--result-col));
  column-gap: var(--col-gap);
  align-items: start;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
  max-width: 1120px;
}

html.mode-serp .topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 12px;
  background: #fff;
  border-bottom: 1px solid #f3f3f3;
}

html.mode-serp .serp { padding-top: 14px; padding-bottom: 28px; }

.topbar .searchbar { height: 48px; border-radius: 14px; }
.topbar .searchbar button[type="submit"] { height: 36px; border-radius: 10px; padding: 0 14px; }

.stats,
.message,
.results,
.pager { grid-column: 2; }

.stats {
  margin: 2px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.message {
  margin: 8px 0 16px;
  color: var(--text);
  font-size: 16px;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result { margin: 0 0 26px; }

.result-title {
  display: inline;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--title);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.result-title:visited { color: var(--title-visited); }
.result-title:hover { text-decoration: underline; }

.result-url {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-domain { color: var(--domain); }
.result-path { color: var(--path); }

.result-snippet {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-title mark,
.result-snippet mark {
  background: transparent;
  color: inherit;
  font-weight: 700;
  padding: 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin: 4px 0 12px;
  font-size: 14px;
}

.pager a {
  color: var(--title);
  text-decoration: none;
}

.pager a:hover { text-decoration: underline; }
.pager .current { color: #111; font-weight: 700; }

.footer {
  color: #9a9a9a;
  font-size: 12px;
}

html.mode-home .footer,
html:not(.mode-serp) .footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
}

html.mode-serp .footer { display: none; }

.noscript {
  width: min(584px, calc(100vw - 32px));
  margin: 16px 0 0;
  color: #666;
  font-size: 14px;
  text-align: center;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection { background: #d6e6ff; }

@media (max-width: 720px) {
  .home { padding-top: 14vh; }
  .logo-home { font-size: 36px; }
  .searchbar-home { margin-top: 20px; }

  html.mode-serp .topbar,
  html.mode-serp .serp {
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
    max-width: none;
  }

  .logo-small { padding-top: 8px; }

  .stats,
  .message,
  .results,
  .pager { grid-column: 1; }

  .topbar .searchbar,
  .searchbar button[type="submit"] { min-height: 44px; }

  .result { margin-bottom: 22px; }
  .result-title { font-size: 17px; }
}

@media (max-height: 520px) {
  .home {
    min-height: auto;
    padding-top: 48px;
  }

  html.mode-home .footer,
  html:not(.mode-serp) .footer {
    position: static;
    margin: 28px 0 16px;
  }
}
