:root {
  color-scheme: light;
  --paper: #fff3f6;
  --sheet: #fffafb;
  --ink: #32132e;
  --muted: #685269;
  --line: #eadce7;
  --berry: #a31757;
  --pink: #ffe1ed;
  --chrome: linear-gradient(166deg, #fff 1%, #d8ccdf 18%, #fffafc 33%, #a690b0 46%, #eee5ee 61%, #fffbff 76%, #c4b2cc 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 84% 58%, #e9def7 0, transparent 51%),
    radial-gradient(ellipse at 13% 30%, #fbd4e5 0, transparent 54%),
    var(--paper);
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 3px; }
button, input { font: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  display: grid;
  grid-template-columns: minmax(18rem, .8fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6.3rem);
  width: min(1160px, calc(100% - 112px));
  min-height: 100svh;
  margin-inline: auto;
  padding-block: 2.5rem;
}

.intro { position: relative; min-width: 0; }
.index-mark {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 0 1.12rem .18rem;
  border: 1px solid #9b5d88;
  border-radius: 13px 18px 13px 18px;
  background: var(--chrome);
  box-shadow: inset 0 1px 2px white, 2px 4px 0 #9d7097, 3px 5px 0 #744465;
  transform: rotate(-11deg);
}
.index-mark span, .index-mark::after, .intro::after {
  position: absolute;
  clip-path: polygon(50% 0, 59% 39%, 100% 50%, 59% 60%, 50% 100%, 41% 60%, 0 50%, 41% 39%);
}
.index-mark span { inset: 7px; background: linear-gradient(140deg, #fe75a8, #a51655 55%, #5e2556); }
.index-mark::after {
  top: -9px;
  right: -12px;
  width: 21px;
  height: 21px;
  background: #fff;
  content: "";
}
.intro::after {
  top: 3.05rem;
  right: .4rem;
  width: clamp(1.8rem, 4vw, 3.65rem);
  height: clamp(1.8rem, 4vw, 3.65rem);
  background: linear-gradient(150deg, #fff 25%, #eb7ab1 48%, #fff 72%);
  transform: rotate(15deg);
  content: "";
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .intro::after { animation: twinkle .7s .18s both; }
  @keyframes twinkle {
    0% { opacity: .4; transform: rotate(15deg) scale(.65); }
    55% { opacity: 1; transform: rotate(23deg) scale(1.13); }
    100% { opacity: 1; transform: rotate(15deg) scale(1); }
  }
}
.intro h1 {
  position: relative;
  z-index: 1;
  color: #84134c;
  font-size: clamp(2.75rem, 5.4vw, 5rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -.054em;
  text-shadow: 0 2px #fff, 0 4px #ffc4db;
}
@supports (background-clip: text) {
  .intro h1 {
    color: transparent;
    background: linear-gradient(180deg, #650d3f 12%, #c12e73 48%, #881546 51%, #451035 89%);
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 1px #fff7fa) drop-shadow(0 3px #f6accb);
  }
}
.intro > p { margin-top: .9rem; color: var(--muted); font-size: .99rem; }
.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 25rem;
  margin-top: 1.55rem;
  padding: 3px;
  border: 1px solid #c397b4;
  border-radius: 11px;
  background: var(--sheet);
  box-shadow: 0 2px 0 #eed2e3, inset 0 1px 3px #e8d1e1;
}
.search:focus-within { border-color: var(--berry); }
.search input { min-width: 0; padding: .6rem .78rem; border: 0; background: transparent; }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline-offset: -3px; }
.search button {
  padding: .56rem .92rem;
  border: 1px solid #8c124a;
  border-radius: 7px;
  color: white;
  background: linear-gradient(#ce417f 0%, #a81758 52%, #8f124b 53%, #ac1859 100%);
  box-shadow: inset 0 1px #f89abc;
  font-size: .9rem;
  font-weight: 700;
}
.search button:hover { background: #9c1553; }

.resource-browser {
  position: relative;
  display: grid;
  grid-template: auto 1fr / 7.3rem minmax(0, 1fr);
  min-height: 21rem;
  min-width: 0;
  padding: 5px;
  border: 1px solid #987d9e;
  border-radius: 15px;
  background: var(--chrome);
  box-shadow: inset 0 0 0 1px #fefaff, 0 3px 0 #aa8aad, 0 14px 27px -13px #826088;
}
.browser-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem 1.05rem;
  border: 1px solid #c4a8be;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(#fffcff, #f1e5f0 55%, #e8d8e9 56%, #f8eff6);
}
.browser-head h2 { color: #631c4b; font-size: .93rem; font-weight: 800; }
.resource-count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .5rem .42rem;
  border: 1px solid #d4bdd1;
  border-top: 0;
  border-right: 0;
  border-bottom-left-radius: 9px;
  background: #f4e9f3;
}
.category-nav a {
  padding: .46rem .65rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.category-nav a:hover { color: var(--ink); background: #ecddec; }
.category-nav [aria-current],
.resource-browser:not([data-ready], :has(.collection:target)) a[href="#ai"],
.resource-browser:not([data-ready]):has(#ai:target) a[href="#ai"],
.resource-browser:not([data-ready]):has(#python:target) a[href="#python"],
.resource-browser:not([data-ready]):has(#php:target) a[href="#php"],
.resource-browser:not([data-ready]):has(#java:target) a[href="#java"],
.resource-browser:not([data-ready]):has(#robotics:target) a[href="#robotics"],
.resource-browser:not([data-ready]):has(#downloads:target) a[href="#downloads"] {
  border-color: #d5a4c1;
  color: #84174f;
  background: linear-gradient(#fff6fa 0%, var(--pink) 77%);
  box-shadow: inset 0 1px white, 0 1px #e8c9de;
}
.browser-content {
  min-width: 0;
  padding: .25rem .85rem .7rem;
  border: 1px solid #d4bdd1;
  border-top: 0;
  border-bottom-right-radius: 9px;
  background: var(--sheet);
}
.collection { display: none; }
.collection:target,
.resource-browser:not(:has(.collection:target)) #ai,
.resource-browser[data-ready] .collection:not([hidden]) { display: block; }
.entry-list { margin: 0; padding: 0; list-style: none; }
.resource-item { position: relative; border-bottom: 1px solid var(--line); }
.resource-item:last-child { border-bottom: 0; }
.entry-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 2.85rem;
  padding: .43rem 1.93rem .43rem .26rem;
}
.entry-link { min-width: 0; color: var(--ink); font-size: .89rem; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.entry-link:hover, .entry-link:focus-visible { color: var(--berry); text-decoration: underline; text-underline-offset: .2em; }
.entry-kind { flex: none; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.entry-note summary {
  position: absolute;
  inset: .47rem 0 auto auto;
  display: grid;
  place-items: center;
  width: 1.82rem;
  height: 1.82rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.entry-note summary::-webkit-details-marker { display: none; }
.entry-note summary::before { content: "+"; font-size: 1.14rem; line-height: 1; }
.entry-note[open] summary::before { content: "−"; }
.entry-note summary:hover { color: var(--berry); background: var(--pink); border-radius: 5px; }
.entry-note p { padding: 0 .35rem .66rem .26rem; color: var(--muted); font-size: .84rem; }

.results-head, .pagination { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.results-head { padding-top: .35rem; }
.results-head h3 { font-size: .92rem; }
.search-status, .pagination { color: var(--muted); font-size: .8rem; }
.search-status { margin: .08rem 0 .35rem; overflow-wrap: anywhere; }
.pagination { justify-content: flex-end; margin-top: .35rem; }
.text-button { padding: .2rem .34rem; border: 0; color: var(--berry); background: transparent; font-size: .82rem; text-decoration: underline; text-underline-offset: .16em; }
.text-button:hover { background: var(--pink); }
.text-button:disabled { opacity: .55; cursor: default; text-decoration: none; }

@media (max-width: 1040px) {
  .page { width: calc(100% - 64px); gap: clamp(1.5rem, 4vw, 3rem); }
}

@media (max-width: 790px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 1.3rem;
    width: min(32rem, calc(100% - 36px));
    padding-block: .85rem;
  }
  .index-mark { width: 36px; height: 36px; margin-bottom: .6rem; border-radius: 9px 12px 9px 12px; }
  .index-mark span { inset: 4px; }
  .index-mark::after { top: -7px; right: -8px; width: 15px; height: 15px; }
  .intro::after { top: 1.7rem; right: 1.1rem; }
  .intro h1 { font-size: clamp(2.35rem, 9vw, 3.35rem); }
  .intro > p { margin-top: .36rem; font-size: .94rem; }
  .search { max-width: none; margin-top: .76rem; }
  .search input { font-size: 1rem; }
  .resource-browser { grid-template: auto auto 1fr / minmax(0, 1fr); min-height: 0; }
  .browser-head { padding: .52rem .72rem; }
  .category-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: .27rem .45rem;
    border: 1px solid #d4bdd1;
    border-top: 0;
    border-radius: 0;
  }
  .category-nav a { padding: .25rem .12rem; font-size: .84rem; text-align: center; }
  .browser-content { padding: .18rem .53rem .33rem; border-radius: 0 0 9px 9px; }
  .entry-line { min-height: 2.56rem; gap: .42rem; }
  .entry-note summary { top: .35rem; }
}

@media (max-width: 360px) and (max-height: 620px) {
  .page { gap: .75rem; padding-block: .45rem; }
  .index-mark { display: none; }
  .intro::after { top: .15rem; }
  .search { margin-top: .6rem; }
  .search input, .search button { padding-block: .42rem; }
  .category-nav a { padding-block: .2rem; }
  .entry-line { min-height: 2.34rem; padding-block: .35rem; }
}
