:root {
  color-scheme: light dark;
  font: 15px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: #f6f8f6;
  --surface: #fff;
  --ink: #1d2b26;
  --muted: #50625a;
  --line: #d9e2dd;
  --accent: #135347;
  --hero: #e6f1ec;
  --action: #edf5f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #141a18;
    --surface: #1c2421;
    --ink: #ecf4ee;
    --muted: #bac9c0;
    --line: #394741;
    --accent: #a0e1cb;
    --hero: #222f2a;
    --action: #263a32;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(calc(100% - 40px), 1100px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-content, .site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
}
.header-content { justify-content: space-between; min-height: 64px; padding-block: 8px; }
.brand { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 700; }
.site-header a { text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
main { padding-block: 24px 48px; }
.intro { padding: clamp(20px, 5vw, 42px); background: var(--hero); border: 1px solid var(--line); border-radius: 20px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); letter-spacing: -.03em; line-height: 1.2; }
.intro p { margin: 10px 0 20px; color: var(--muted); }
.source, .tools, .card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
button, .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--action);
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
:is(button, .download):hover { border-color: var(--accent); }
#copy-status { color: var(--muted); overflow-wrap: anywhere; }
.catalog-section { margin-top: 24px; }
.tools { justify-content: space-between; margin-bottom: 14px; }
.tools input {
  min-height: 44px;
  width: min(100%, 430px);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
#count, #status, .meta { color: var(--muted); font-size: 13px; }
#count { margin: 0; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 14px; }
article {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow-wrap: anywhere;
}
article h2 { margin: 0; font-size: 18px; line-height: 1.35; }
article p { margin: 0; }
.card-actions { justify-content: space-between; border-top: 1px solid var(--line); margin-top: auto; padding-top: 10px; }
.card-actions > a { min-height: 42px; display: inline-flex; align-items: center; }
