:root {
  color-scheme: light;
  --paper: #f0ecdf;
  --ink: #303c2c;
  --muted: #68705f;
  --line: #a9b09b;
  --panel: #f8f6ed;
  --accent: #52634a;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; position: relative; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("./assets/paper.jpg") repeat;
  background-size: 480px 480px;
  filter: grayscale(1);
  opacity: .62;
  mix-blend-mode: multiply;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

header, main { width: min(1080px, calc(100% - 72px)); margin-inline: auto; }
header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { font: 20px Georgia, "Songti SC", serif; }
.back { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; }
.back svg { width: 15px; height: 15px; }

.mast {
  height: 138px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 3px double var(--line);
  overflow: hidden;
}
.mast::after {
  content: "";
  position: absolute;
  inset: -35px -20px -40px 48%;
  background: url("./assets/botanical.jpg") right 44% / cover;
  mix-blend-mode: multiply;
  opacity: .75;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
  pointer-events: none;
}
.mast-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 9px; font: 10px Georgia, serif; letter-spacing: .2em; }
h1 { margin: 0; font: 500 44px/1.2 "Songti SC", "STSong", Georgia, serif; letter-spacing: .09em; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 0; }
.filters { display: flex; gap: 20px; flex-wrap: wrap; }
.filters button { padding: 6px 0; background: none; border: 0; border-bottom: 1px solid transparent; font-size: 12px; }
.filters button[aria-pressed="true"] { border-bottom-color: var(--ink); }
.search { display: flex; align-items: center; gap: 9px; max-width: 210px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.search svg { width: 16px; height: 16px; flex-shrink: 0; }
.search input { width: 100%; min-width: 0; background: none; border: 0; font-size: 12px; }
.search input::placeholder { color: var(--muted); }

.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0 0 24px;
}
.catalog > li { min-width: 0; }
.tool {
  display: block;
  position: relative;
  height: 100%;
  min-height: 106px;
  padding: 13px 16px 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 76%, transparent);
}
.tool-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: var(--muted); }
.number { font: italic 11px Georgia, serif; }
.category { font-size: 10px; }
.tool h2 { margin: 0 20px 4px 0; font: 600 18px/1.5 "Songti SC", "STSong", Georgia, serif; overflow-wrap: anywhere; }
.description { margin: 0; padding-right: 12px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.arrow { position: absolute; right: 13px; top: 45px; width: 16px; height: 16px; }
.tool:hover { background: var(--panel); border-color: var(--ink); }
.empty { margin: 0; padding: 30px 0; font-size: 13px; color: var(--muted); }
footer { padding: 14px 0 24px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }

@media (max-width: 600px) {
  header, main { width: calc(100% - 36px); }
  header { height: 58px; }
  .brand { font-size: 18px; }
  .back { font-size: 11px; }
  .mast { height: 112px; }
  .mast::after { inset: -15px -30px -10px 41%; opacity: .65; }
  .eyebrow { font-size: 9px; margin-bottom: 8px; }
  h1 { font-size: 35px; }
  .toolbar { flex-direction: column-reverse; align-items: stretch; gap: 13px; padding: 15px 0; }
  .search { max-width: none; padding: 6px 0; }
  .filters { gap: 18px; }
  .filters button { font-size: 11px; padding: 5px 0; }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-bottom: 20px; }
  .tool { min-height: 105px; padding: 12px 12px 13px; }
  .tool-top { margin-bottom: 7px; }
  .tool h2 { margin-right: 12px; font-size: 16px; letter-spacing: 0; }
  .description { font-size: 10px; padding-right: 0; }
  .arrow { width: 12px; height: 12px; right: 9px; top: 42px; }
  footer { font-size: 9px; padding: 12px 0 18px; }
}
