:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #5f6c7b;
  --line: #d8dde5;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --field: #ffffff;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(24px, 2.8vw, 36px);
  min-height: 68px;
  padding: 0 72px;
  background: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

.brand img {
  width: 40px;
  height: 40px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(28px, 3.4vw, 44px);
  min-width: 0;
  white-space: nowrap;
}

.topnav a {
  color: #1f2329;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.topnav a:visited {
  color: #1f2329;
}

.topnav a:hover {
  color: var(--accent);
}

.topnav a:focus {
  color: #1f2329;
  outline: 0;
}

.topnav a:focus-visible {
  color: #1f2329;
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 5px;
  border-radius: 4px;
}

.home {
  min-height: calc(100vh - 68px);
}

.search-panel {
  width: min(700px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(132px, 20vh, 220px) 0 56px;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.hero-logo {
  width: 56px;
  height: 56px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 31px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
}

.search-form {
  position: relative;
  width: min(680px, 100%);
  margin-top: 42px;
}

.search-box {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding-left: 0;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(24, 33, 47, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.search-provider-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  width: 108px;
  margin-left: 16px;
  border-right: 1px solid #edf0f5;
}

.search-provider-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.search-provider-label {
  color: #3c4656;
  font: 500 15px/1 var(--font-ui);
  white-space: nowrap;
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding-left: 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
}

.search-input::placeholder {
  color: #9aa3af;
}

.search-button {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 2px 0 8px;
  border: 0;
  border-radius: 10px;
  color: #536071;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.search-button:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.search-button svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
}

.bookmark-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-top: 24px;
  padding: 0 11px;
  color: #8c8c8c;
  background: #f5f5f5;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.bookmark-tip kbd {
  min-width: 21px;
  padding: 2px 5px;
  color: #6f7782;
  background: #ffffff;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  font: 500 11px/1 var(--font-ui);
  text-align: center;
}

.bookmark-plus {
  color: #8b95a3;
}

.scholar-intro {
  width: min(640px, 100%);
  margin-top: 64px;
  text-align: center;
}

.scholar-intro h2 {
  color: #1f2329;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
}

.scholar-intro-copy {
  width: min(600px, 100%);
  margin: 12px auto 0;
  color: #646a73;
  font-size: 14px;
  line-height: 1.6;
}

.scholar-intro-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.scholar-intro-points span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  color: #586069;
  background: #f1f2f4;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 48px rgba(24, 33, 47, 0.12);
  max-height: min(360px, calc(100vh - 180px));
  overflow-y: auto;
}

.suggestions button {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.suggestions button:hover,
.suggestions button:focus {
  outline: 0;
  background: #eef4ff;
}

.captcha-overlay[hidden] {
  display: none;
}

.captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.captcha-card {
  position: relative;
  width: min(320px, 100%);
  padding: 24px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.captcha-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 0;
  color: #8c8c8c;
  background: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.captcha-close:hover {
  opacity: 1;
}

.captcha-close:focus-visible {
  outline: 0;
  opacity: 1;
}

.captcha-close svg {
  width: 12px;
  height: 12px;
}

.captcha-close path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.captcha-title {
  margin: 0 0 20px;
  color: #1f2329;
  font-size: 15px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
}

.captcha-slider-wrapper {
  position: relative;
  width: 100%;
}

.slider-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 244px;
  max-width: 100%;
  height: 40px;
  overflow: hidden;
  background-color: #f5f5f7;
  border: 1px solid #e5e8eb;
  border-radius: 6px;
  touch-action: none;
  user-select: none;
}

.slider-text {
  z-index: 1;
  color: #8f959e;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.slider-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background-color: rgba(22, 119, 255, 0.06);
}

.slider-handler {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
  padding: 0;
  color: #1f2329;
  background: #ffffff;
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: grab;
  touch-action: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.slider-handler:hover {
  background-color: #fafafa;
  border-color: #1677ff;
}

.slider-handler:active {
  background-color: #f0f0f0;
  cursor: grabbing;
}

.slider-handler:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -2px;
}

.slider-handler svg {
  width: 14px;
  height: 14px;
}

.slider-handler path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.captcha-overlay--dragging .slider-handler,
.captcha-overlay--loading .slider-handler {
  color: var(--accent);
  border-color: #1677ff;
}

.captcha-overlay--success .slider-bg {
  background-color: rgba(22, 163, 74, 0.08);
}

.captcha-overlay--success .slider-text {
  color: #16794c;
}

.captcha-overlay--failed .slider-bg {
  background-color: rgba(244, 63, 94, 0.08);
}

.captcha-overlay--failed .slider-text {
  color: #b42318;
}

@media (max-width: 720px) {
  .topbar {
    gap: 18px;
    min-height: auto;
    padding: 14px 18px;
    align-items: flex-start;
  }

  .brand {
    width: 38px;
    height: 38px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .topnav {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 12px 18px;
    white-space: normal;
  }

  .topnav a {
    font-size: 14px;
    line-height: 1.2;
  }

  .search-panel {
    padding-top: 82px;
  }

  .hero-brand {
    gap: 12px;
  }

  .hero-logo {
    width: 48px;
    height: 48px;
  }

  h1 {
    font-size: 26px;
  }

  .search-form {
    margin-top: 32px;
  }

  .search-box {
    min-height: 54px;
    padding-left: 18px;
  }

  .search-input,
  .search-button {
    height: 52px;
  }

  .search-button {
    width: 52px;
    margin-left: 6px;
  }

  .bookmark-tip {
    margin-top: 20px;
  }

  .scholar-intro {
    margin-top: 44px;
  }

  .scholar-intro h2 {
    font-size: 18px;
  }

  .scholar-intro-copy {
    font-size: 13px;
  }

  .scholar-intro-points {
    gap: 8px;
  }

  .scholar-intro-points span {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
  }
}
