.search-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent 0 20px, rgba(122, 82, 26, .08) 20px 21px, transparent 21px),
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(124, 72, 28, .035) 34px 35px),
    linear-gradient(180deg, #efe2c2 0%, #f2e6cb 100%);
  color: #22160d;
}

.search-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h, 92px) + 28px) 16px 24px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .58) 52%, rgba(0, 0, 0, .86)),
    radial-gradient(circle at 72% 24%, rgba(214, 181, 93, .14), transparent 34%),
    #050605;
  color: #f4ead4;
}

.search-hero::after {
  content: "";
  position: absolute;
  inset: 12px 18px 18px;
  border: 1px solid rgba(214, 181, 93, .14);
  pointer-events: none;
}

.search-hero-inner,
.search-results-wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, 100% - 32px);
  margin: 0 auto;
}

.search-hero-inner {
  display: grid;
  gap: 16px;
}

.search-head {
  display: grid;
  gap: 8px;
  max-width: 780px;
}

.search-kicker,
.search-label,
.search-summary,
.search-filter,
.search-result-date,
.search-result-access,
.search-result-tags,
.search-section-kicker,
.search-entry-card span {
  font-family: "JetBrains Mono", monospace;
}

.search-kicker {
  color: rgba(214, 181, 93, .84);
  font-size: .68rem;
  letter-spacing: .24em;
}

.search-head h1 {
  margin: 0;
  color: #fff7df;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.72rem, 3.8vw, 2.82rem);
  font-weight: 500;
  letter-spacing: .045em;
  line-height: 1.12;
}

.search-head p {
  max-width: 720px;
  margin: 0;
  color: rgba(244, 234, 212, .68);
  font-size: .84rem;
  font-weight: 300;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.search-workbench {
  display: grid;
  gap: 10px;
  padding: clamp(13px, 2vw, 18px);
  border: 1px solid rgba(214, 181, 93, .26);
  background: rgba(8, 9, 8, .78);
  box-shadow: 0 24px 62px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px);
}

.search-form {
  display: grid;
  gap: 8px;
}

.search-label {
  color: rgba(244, 234, 212, .62);
  font-size: .6rem;
  font-weight: 300;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.search-input,
.search-submit,
.search-filter {
  min-height: 42px;
  border-radius: 0;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(244, 234, 212, .24);
  background: rgba(255, 250, 238, .08);
  color: #fff7df;
  font: inherit;
  font-size: .86rem;
  font-weight: 300;
  padding: 0 15px;
  outline: none;
}

.search-input:focus {
  border-color: rgba(214, 181, 93, .72);
  box-shadow: inset 0 -2px 0 rgba(214, 181, 93, .32);
}

.search-input::placeholder {
  color: rgba(244, 234, 212, .42);
  font-weight: 300;
}

.search-submit,
.search-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(214, 181, 93, .44);
  background: rgba(214, 181, 93, .12);
  color: #f8e9b8;
  cursor: pointer;
  font-weight: 400;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.search-submit {
  min-width: 104px;
  padding: 0 20px;
  border-color: rgba(214, 181, 93, .68);
  background: linear-gradient(180deg, #d9bd6b 0%, #b28a35 100%);
  color: #120e08;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: .84rem;
  letter-spacing: .08em;
  box-shadow: inset 0 1px 0 rgba(255, 248, 221, .42), 0 10px 24px rgba(0, 0, 0, .24);
}

.search-submit:hover,
.search-submit:focus-visible,
.search-filter:hover,
.search-filter.is-active {
  border-color: rgba(214, 181, 93, .82);
  background: rgba(214, 181, 93, .22);
  color: #fff7dc;
}

.search-submit:hover,
.search-submit:focus-visible {
  background: linear-gradient(180deg, #f0d786 0%, #c49a3e 100%);
  color: #080705;
  outline: none;
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.search-filter {
  min-height: 32px;
  padding: 0 11px;
  font-size: .62rem;
  letter-spacing: .08em;
}

.search-summary {
  color: rgba(244, 234, 212, .56);
  font-size: .68rem;
  line-height: 1.6;
}

.search-results-wrap {
  padding: 22px 0 72px;
}

.search-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid rgba(122, 82, 26, .18);
  background: rgba(122, 82, 26, .18);
}

.search-entry-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px 16px;
  background: rgba(255, 250, 238, .66);
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.search-entry-card:hover,
.search-entry-card:focus-visible {
  background: rgba(255, 252, 246, .92);
  outline: none;
  transform: translateY(-1px);
}

.search-entry-card span {
  color: rgba(122, 82, 26, .72);
  font-size: .58rem;
  letter-spacing: .18em;
}

.search-entry-card b {
  color: #16100a;
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

.search-entry-card em {
  color: rgba(35, 25, 16, .64);
  font-size: .82rem;
  font-style: normal;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.search-results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(122, 82, 26, .2);
}

.search-section-kicker {
  display: block;
  margin-bottom: 5px;
  color: rgba(122, 82, 26, .68);
  font-size: .58rem;
  letter-spacing: .22em;
}

.search-results-head h2 {
  margin: 0;
  color: #16100a;
  font-family: "Noto Serif SC", serif;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.search-results-head > span {
  color: rgba(35, 25, 16, .5);
  font-family: "JetBrains Mono", monospace;
  font-size: .82rem;
}

.search-results {
  display: grid;
  gap: 7px;
}

.search-result {
  display: grid;
  gap: 5px;
  padding: 13px 16px 14px;
  border: 1px solid rgba(122, 82, 26, .18);
  border-left: 3px solid rgba(122, 82, 26, .5);
  background: rgba(255, 250, 238, .72);
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.search-result[data-kind="section"] {
  border-left-color: rgba(184, 148, 31, .72);
}

.search-result[data-kind="page"],
.search-result[data-kind="lecture"],
.search-result[data-kind="service"] {
  border-left-color: rgba(95, 117, 84, .72);
}

.search-result:hover,
.search-result:focus-visible {
  border-color: rgba(122, 82, 26, .32);
  background: rgba(255, 252, 246, .94);
  box-shadow: 0 12px 30px rgba(68, 45, 22, .08);
  outline: none;
  transform: translateY(-1px);
}

.search-result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.search-result-date {
  min-width: 0;
  color: rgba(35, 25, 16, .52);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-access {
  justify-self: end;
  max-width: 44vw;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid rgba(122, 82, 26, .18);
  background: rgba(122, 82, 26, .08);
  color: rgba(35, 25, 16, .62);
  font-size: .52rem;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-access[data-access="essential"],
.search-result-access[data-access="professional"] {
  border-color: rgba(184, 148, 31, .24);
  background: rgba(214, 181, 93, .14);
  color: rgba(93, 67, 20, .82);
}

.search-result-access[data-access="institutional"],
.search-result-access[data-access="section"] {
  border-color: rgba(38, 76, 96, .2);
  background: rgba(38, 76, 96, .08);
  color: rgba(31, 63, 82, .8);
}

.search-result-score {
  display: none;
}

.search-result h3 {
  margin: 0;
  color: #16100a;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(.98rem, 1.7vw, 1.12rem);
  font-weight: 600;
  letter-spacing: .045em;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.search-result p {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: rgba(35, 25, 16, .68);
  font-family: "Noto Serif SC", serif;
  font-size: .84rem;
  line-height: 1.56;
  overflow-wrap: anywhere;
}

.search-hit {
  display: inline;
  padding: 0 .08em;
  background: rgba(214, 181, 93, .24);
  color: #16100a;
  box-shadow: inset 0 -1px 0 rgba(122, 82, 26, .34);
}

.search-result-snippet {
  border-left: 2px solid rgba(122, 82, 26, .26);
  padding-left: 10px;
  color: rgba(35, 25, 16, .76);
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.search-result-tags span {
  min-height: 0;
  max-width: 100%;
  padding: 3px 7px;
  background: rgba(122, 82, 26, .09);
  color: rgba(35, 25, 16, .58);
  font-size: .5rem;
  line-height: 1.25;
  letter-spacing: .055em;
  overflow-wrap: anywhere;
}

.search-empty {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: center;
  padding: 20px;
  border: 1px dashed rgba(122, 82, 26, .24);
  background: rgba(255, 250, 238, .58);
  color: rgba(35, 25, 16, .7);
}

.search-empty b {
  color: #16100a;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
}

.search-empty p {
  margin: 0;
  line-height: 1.7;
}

.search-service-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 24px;
  border: 1px solid rgba(122, 82, 26, .18);
  background: rgba(122, 82, 26, .18);
}

.search-service-strip a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 18px;
  background: rgba(38, 29, 18, .92);
  color: rgba(244, 234, 212, .88);
  font-family: "Noto Serif SC", serif;
  font-size: .92rem;
  letter-spacing: .04em;
  text-decoration: none;
}

.search-service-strip a::after {
  content: "→";
  color: rgba(214, 181, 93, .82);
}

.search-service-strip a:hover,
.search-service-strip a:focus-visible {
  color: #fff7df;
  outline: none;
}

@media (max-width: 860px) {
  .search-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .search-hero {
    padding: calc(var(--nav-h, 74px) + 10px) 12px 12px;
  }

  .search-hero::after {
    inset: 10px;
  }

  .search-hero-inner,
  .search-results-wrap {
    width: min(100% - 24px, 1080px);
  }

  .search-head h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .search-kicker,
  .search-head p {
    display: none;
  }

  .search-workbench {
    margin-top: 0;
    padding: 11px;
    border-radius: 8px;
  }

  .search-label {
    display: none;
  }

  .search-field {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-submit,
  .search-filter {
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 400 !important;
  }

  .search-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .search-filter {
    min-height: 40px;
    padding: 0 8px;
    font-size: .58rem !important;
    letter-spacing: .04em;
    text-align: center;
  }

  .search-summary {
    min-height: 20px;
    font-size: .66rem;
  }

  .search-results-wrap {
    padding-top: 22px;
    padding-bottom: calc(var(--m-bottom-nav-h, 66px) + env(safe-area-inset-bottom, 0px) + 18px);
  }

  .search-entry-grid,
  .search-service-strip {
    grid-template-columns: 1fr;
  }

  .search-entry-grid {
    display: none !important;
  }

  .search-entry-card {
    min-height: 90px;
    padding: 13px 14px;
  }

  .search-result {
    padding: 13px 12px;
    border-radius: 8px;
  }

  .search-result-top {
    gap: 5px;
  }

  .search-result h3,
  .search-result p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .search-result h3 {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .search-result p {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .search-result-tags span:nth-child(n+4) {
    display: none;
  }

  .search-service-strip a {
    min-height: 48px;
    border-radius: 8px;
    font-size: .84rem;
  }
}

@media (max-width: 640px) {
  .search-hero {
    padding: calc(var(--nav-h, 64px) + 10px) 0 12px !important;
  }

  .search-head h1 {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  .search-kicker,
  .search-head p,
  .search-label,
  .search-entry-grid {
    display: none !important;
  }

  .search-workbench {
    margin-top: 0 !important;
    padding: 11px !important;
  }

  .search-filter {
    min-height: 40px !important;
  }

  .search-results-wrap {
    padding-top: 12px !important;
  }
}
