:root {
  color-scheme: light dark;
  --bg: #f6f5fa;
  --paper: #fff;
  --ink: #241d34;
  --muted: #635c72;
  --line: #dfdbe8;
  --accent: #5131ad;
  --accent-bg: #eae1ff;
  --yellow: #f6e178;
  --dot: #dcd4ef;
  --shadow: #4a318110;
  --violet: #e9e0ff; --violet-ink: #5435a6;
  --blue: #deecff; --blue-ink: #295c9e;
  --green: #d9f0e5; --green-ink: #236d57;
  --yellow-tile: #ffedaa; --yellow-ink: #67450a;
  --pink: #f6e0eb; --pink-ink: #863659;
  font: 16px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191623;
    --paper: #242030;
    --ink: #f4effb;
    --muted: #baafca;
    --line: #3e354f;
    --accent: #c9b4ff;
    --accent-bg: #3b2a5c;
    --yellow: #f6e178;
    --dot: #392e50;
    --shadow: #0002;
    --violet: #433064; --violet-ink: #decbff;
    --blue: #253d59; --blue-ink: #c5ddff;
    --green: #214739; --green-ink: #abedd4;
    --yellow-tile: #544621; --yellow-ink: #ffeba6;
    --pink: #54364c; --pink-ink: #ffd3e9;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}
body::before {
  position: absolute;
  inset: 0 0 auto;
  height: 21rem;
  background: radial-gradient(circle, var(--dot) 0.8px, transparent 1.1px) 0 0 / 15px 15px;
  mask-image: linear-gradient(#000, transparent);
  content: "";
  pointer-events: none;
  z-index: -1;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(100% - 64px, 1080px); margin: auto; }
.top, .intro, .footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.top { padding: 28px 0 0; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; }
.mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--yellow); color: #302349; font-size: 23px; line-height: 1;
  transform: rotate(-7deg);
}
.home, .footer { font-size: .875rem; color: var(--muted); }
.home:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.intro { padding: 48px 0 40px; align-items: flex-end; }
h1 { margin: 0; font-size: clamp(3.4rem, 7.1vw, 6.05rem); line-height: .97; letter-spacing: -.105em; font-weight: 830; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 11px; font-size: 1.04rem; font-weight: 720; }
.search {
  display: flex; gap: 11px; align-items: center; width: min(100%, 405px); height: 50px; padding: 0 13px 0 16px;
  margin: 0 0 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 3px 8px var(--shadow);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.search input { min-width: 0; flex: 1; color: var(--ink); background: transparent; border: 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.magnifier { width: 13px; height: 13px; border: 1.7px solid var(--muted); border-radius: 50%; position: relative; margin-right: 2px; }
.magnifier::after { content: ""; width: 6px; height: 1.7px; background: var(--muted); position: absolute; right: -4px; bottom: -2px; transform: rotate(47deg); }
kbd { padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: .83rem; }
.pin { color: var(--accent); font-size: 1.16em; margin-right: 4px; }
.favorites { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.favorite {
  min-width: 0; display: flex; flex-direction: column; align-items: start; gap: 4px;
  padding: 13px 14px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 2px 5px var(--shadow); transition: transform .16s ease, border-color .16s ease;
}
.favorite:hover { transform: translateY(-2px); border-color: var(--accent); }
.favorite .tile-icon { margin-bottom: 4px; width: 37px; height: 35px; font-size: 1.21rem; border-radius: 10px; }
.name { font-size: .95rem; font-weight: 690; line-height: 1.32; overflow-wrap: anywhere; }
.meta { font-size: .79rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.tile-icon { display: grid; flex: none; width: 32px; height: 32px; place-items: center; border-radius: 8px; font-size: 1.04rem; line-height: 1; font-weight: 700; }
.violet { background: var(--violet); color: var(--violet-ink); }
.blue { background: var(--blue); color: var(--blue-ink); }
.green { background: var(--green); color: var(--green-ink); }
.yellow { background: var(--yellow-tile); color: var(--yellow-ink); }
.pink { background: var(--pink); color: var(--pink-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 24px 0 15px; }
.filters button, .empty button {
  appearance: none; border: 1px solid var(--line); background: var(--paper); border-radius: 100px;
  padding: 5px 12px; min-height: 34px; font-size: .875rem; cursor: pointer;
}
.filters button:hover, .empty button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { color: var(--accent); background: var(--accent-bg); border-color: transparent; font-weight: 660; }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; align-items: start; }
.group { background: var(--paper); border-radius: 14px; border: 1px solid var(--line); padding: 13px 8px 8px; }
.group h2 { margin: 0 8px 6px; }
.group ul { list-style: none; padding: 0; margin: 0; }
.entry { display: flex; gap: 9px; align-items: center; min-height: 50px; padding: 5px 8px; border-radius: 9px; }
.entry:hover, .entry:focus-visible { background: var(--bg); }
.entry-text { min-width: 0; display: grid; gap: 2px; }
.entry .note { margin-left: auto; flex: none; color: var(--muted); font-size: .75rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 0 48px; }
.footer { justify-content: space-between; padding: 19px 0 30px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 900px) {
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .favorites { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .favorite { position: relative; padding: 10px 7px 10px 48px; min-height: 62px; justify-content: center; gap: 3px; }
  .favorite .tile-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); margin: 0; width: 31px; height: 31px; font-size: 1rem; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .top { padding-top: 17px; }
  .intro { display: grid; gap: 22px; align-items: start; padding: 38px 0 23px; }
  .search { width: 100%; }
  .search kbd { display: none; }
  .favorites { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .groups { grid-template-columns: 1fr; gap: 10px; }
  .filters { padding-top: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
.filters .group-link {
  display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border: 1px solid var(--line);
  background: var(--paper); border-radius: 100px; font-size: .875rem;
}
.filters .group-link:hover { border-color: var(--accent); }
.footer span:last-child { margin-left: auto; }
