:root {
  --bg: #fafaf8;
  --fg: #1a1a18;
  --muted: #5c5c56;
  --line: #e6e4dc;
  --accent: #2f4f4f;
  --accent-soft: #e8efef;
  --surface: #ffffff;
  --focus: #1d4e4e;
  --max: 1080px;
  --sidebar: 11.5rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--fg); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--fg); color: #fff; padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: 0.65rem; }
.brand-link {
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand-link:hover { color: var(--accent); }
.brand-sub { color: var(--muted); font-size: 0.85rem; }

.search { flex: 1; min-width: 14rem; max-width: 28rem; }
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--fg);
}
.search input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: transparent;
  background: #fff;
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 2rem;
}

.sidebar { position: sticky; top: 4.5rem; align-self: start; }
.nav-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.cat-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.cat-list a {
  display: block;
  padding: 0.28rem 0;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cat-list a:hover { color: var(--accent); }
.cat-list a.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.filters { display: grid; gap: 0.4rem; }
.check {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.check input { margin-top: 0.25rem; accent-color: var(--accent); }

.main-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.muted { margin: 0; color: var(--muted); }
.count {
  margin: 0.85rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.tool-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.65rem 0.5rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tool-table td {
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tool-table tr.row {
  cursor: pointer;
}
.tool-table tr.row:hover td { background: #f3f2ec; }
.tool-table tr.row:focus-within td { background: var(--accent-soft); }

.name-cell { font-weight: 600; min-width: 7rem; }
.name-cell a {
  color: inherit;
  text-decoration: none;
}
.name-cell a:hover { color: var(--accent); text-decoration: underline; }
.one-liner { color: var(--fg); max-width: 28rem; }
.pricing {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 14rem; }
.tag {
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: var(--surface);
}

.empty { color: var(--muted); margin-top: 1.5rem; }
.hidden { display: none !important; }

.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.35rem 1.4rem 1.5rem;
}
.detail-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.detail-back:hover { color: var(--accent); }
.detail h1 {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.detail .lead {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
}
.meta {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0;
  font-size: 0.95rem;
}
.meta dt { color: var(--muted); margin: 0; }
.meta dd { margin: 0; }
.detail-actions { margin-top: 1.35rem; }
.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn:hover { background: var(--fg); border-color: var(--fg); color: #fff; }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .sidebar { position: static; }
  .cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
  }
  .cat-list a { border: 0; }
  .tool-table th:nth-child(4),
  .tool-table td:nth-child(4) { display: none; }
}
