/* 性平教育全球資訊網｜僅在站內搜尋結果頁載入，置於既有網站樣式之後。 */
:is(.gsc-control-cse, .gsc-control-wrapper-cse) {
  --gender-search-accent: #1f677d;
  --gender-search-ink: #18343e;
  --gender-search-muted: #49606a;
  --gender-search-outline: #728c97;
  --gender-search-border: #d5e1e5;
  --gender-search-soft: #edf6f8;
  font-family: inherit;
}

/* 搜尋框與結果共用主內容欄寬度，覆蓋 Google 主題的欄寬上限與左右縮排。 */
[id^="___gcse_"],
.gsc-control-cse,
:is(.gsc-control-cse, .gsc-control-wrapper-cse, [id^="___gcse_"]) :is(
  .gsc-control-wrapper-cse,
  .gsc-control-searchbox-only,
  .gsc-control-searchresults-only,
  .gsc-wrapper,
  .gsc-results-wrapper-visible,
  .gsc-resultsbox-visible,
  .gsc-above-wrapper-area,
  .gsc-results,
  .gsc-expansionArea,
  :is(form, div).gsc-search-box
) {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0;
  max-width: none !important;
  margin-inline: 0 !important;
}

:is(.gsc-control-cse, .gsc-control-wrapper-cse, [id^="___gcse_"]) :is(
  .gsc-control-wrapper-cse,
  .gsc-control-searchbox-only,
  .gsc-control-searchresults-only,
  .gsc-wrapper,
  .gsc-results-wrapper-visible,
  .gsc-resultsbox-visible,
  .gsc-above-wrapper-area,
  .gsc-results,
  .gsc-expansionArea
) {
  padding-inline: 0 !important;
}

.gsc-control-cse {
  padding: clamp(.75rem, 2.5vw, 1.75rem);
  border: 1px solid var(--gender-search-border);
  border-radius: 1rem;
  background: #fff;
  color: var(--gender-search-ink);
}

.gsc-control-cse :is(form, div).gsc-search-box,
.gsc-control-wrapper-cse :is(form, div).gsc-search-box {
  box-sizing: border-box;
  margin: 0 0 1.25rem;
  padding: clamp(.625rem, 2vw, 1rem);
  border: 1px solid #c4dce4;
  border-radius: .875rem;
  background: var(--gender-search-soft);
}

form.gsc-search-box table.gsc-search-box {
  width: 100%;
  margin: 0;
}

form.gsc-search-box td.gsc-input {
  padding-inline-end: .5rem;
}

form.gsc-search-box .gsc-input-box {
  box-sizing: border-box;
  min-height: 3rem;
  padding: .15rem .5rem;
  border: 1px solid var(--gender-search-outline, #728c97);
  border-radius: .625rem;
  background-color: #fff;
}

form.gsc-search-box .gsc-input-box:focus-within {
  border-color: var(--gender-search-accent, #1f677d);
  outline: 2px solid var(--gender-search-accent, #1f677d);
  outline-offset: 1px;
}

form.gsc-search-box input.gsc-input {
  min-height: 2.5rem !important;
  min-width: 0;
  color: var(--gender-search-ink, #18343e);
  font: inherit !important;
  font-size: 1rem !important;
  line-height: 1.4 !important;
}

form.gsc-search-box button.gsc-search-button-v2 {
  box-sizing: border-box;
  min-width: 3.25rem;
  height: 3rem !important;
  margin: 0;
  padding: .625rem .875rem !important;
  border: 1px solid #174e5e;
  border-radius: .625rem;
  background-color: var(--gender-search-accent, #1f677d);
  color: #fff;
  line-height: 1 !important;
  cursor: pointer;
}

form.gsc-search-box button.gsc-search-button-v2:hover {
  background-color: #174e5e;
}

form.gsc-search-box button.gsc-search-button-v2 svg {
  width: 1.125rem;
  height: 1.125rem;
  vertical-align: middle;
  fill: currentColor;
}

:is(.gsc-control-cse, .gsc-control-wrapper-cse)
  :is(button, a, [tabindex]):focus-visible {
  outline: 2px solid #174e5e;
  outline-offset: 2px;
}

.gsc-control-cse .gsc-above-wrapper-area {
  margin-block-end: .75rem;
  padding-block: .5rem;
  border-color: var(--gender-search-border);
}

.gsc-control-cse .gsc-result-info {
  padding-inline-start: 0;
  color: var(--gender-search-muted);
  font-size: .875rem;
  line-height: 1.5;
}

.gsc-control-cse .gsc-webResult.gsc-result {
  box-sizing: border-box;
  width: 100%;
  max-width: none !important;
  margin: 0 0 .625rem;
  padding: clamp(.75rem, 2vw, 1.1rem);
  border: 1px solid var(--gender-search-border);
  border-radius: .75rem;
  background-color: #fff;
}

.gsc-control-cse .gsc-webResult.gsc-result:focus-within {
  border-color: var(--gender-search-accent);
}

.gsc-control-cse .gsc-webResult.gsc-result .gs-title {
  height: auto;
  max-height: none;
  overflow: visible;
  color: #174e5e;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gsc-control-cse .gsc-webResult.gsc-result a.gs-title {
  text-decoration: underline !important;
  text-underline-offset: .18em;
}

.gsc-control-cse .gsc-webResult.gsc-result a.gs-title:visited {
  color: #634279;
}

.gsc-control-cse .gsc-webResult.gsc-result .gs-title b {
  color: inherit;
  font-size: inherit;
}

.gsc-control-cse .gsc-webResult.gsc-result .gs-snippet {
  margin-block-start: .375rem;
  color: var(--gender-search-ink);
  font-size: .9375rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.gsc-control-cse .gsc-webResult.gsc-result .gs-visibleUrl {
  color: var(--gender-search-muted);
  font-size: .8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.gsc-control-cse .gsc-cursor-box {
  margin: 1.125rem 0 .375rem;
}

.gsc-control-cse .gsc-cursor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .375rem;
}

.gsc-control-cse .gsc-cursor .gsc-cursor-page {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: .25rem .375rem;
  border: 1px solid var(--gender-search-outline);
  border-radius: .625rem;
  background: #fff;
  color: #174e5e;
  font-size: .9375rem;
  line-height: 1.2;
  text-decoration: none;
}

.gsc-control-cse .gsc-cursor .gsc-cursor-page:hover {
  background: var(--gender-search-soft);
  text-decoration: underline;
}

.gsc-control-cse .gsc-cursor .gsc-cursor-current-page,
.gsc-control-cse .gsc-cursor .gsc-cursor-page[aria-current="page"] {
  border-color: #174e5e;
  background: #174e5e;
  color: #fff;
  font-weight: 700;
}

.gsc-control-cse .gsc-cursor .gsc-cursor-current-page:hover,
.gsc-control-cse .gsc-cursor .gsc-cursor-page[aria-current="page"]:hover {
  background: #174e5e;
}

.gsc-control-cse :is(.gs-no-results-result, .gs-error-result) .gs-snippet {
  padding: .875rem 1rem;
  border: 1px solid var(--gender-search-border);
  border-radius: .75rem;
  background: var(--gender-search-soft);
  color: var(--gender-search-ink);
  line-height: 1.6;
}

@media (max-width: 480px) {
  .gsc-control-cse {
    padding: .625rem;
    border-radius: .75rem;
  }

  form.gsc-search-box td.gsc-input {
    padding-inline-end: .375rem;
  }

  form.gsc-search-box button.gsc-search-button-v2 {
    min-width: 2.75rem;
    padding-inline: .625rem !important;
  }

  .gsc-control-cse .gsc-cursor-box {
    margin-block-start: .875rem;
  }
}
