:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e2e5ea;
  --line-strong: #cfd4dc;
  --ink: #171a1f;
  --ink-2: #4a515c;
  --ink-3: #7b8492;
  --accent: #1f5fd0;
  --accent-soft: #e8f0ff;
  --radius: 8px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: #eef0f3;
  padding: 1px 5px;
  border-radius: 4px;
}

.ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: #171a1f;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.brand-name { font-weight: 600; font-size: 13.5px; }
.spacer { flex: 1; }

.topsearch { position: relative; }
.topsearch .ic {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.topsearch input {
  width: 220px;
  height: 30px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  font: inherit;
  font-size: 12.5px;
}
.topsearch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- home ---------- */
.home {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 24px 64px;
}
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.hero h1 { font-size: 28px; line-height: 1.3; }
.lead { margin-top: 10px; color: var(--ink-2); font-size: 14.5px; max-width: 640px; }
.hero-stats { display: flex; gap: 18px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.hero-stats b { color: var(--ink); font-size: 18px; font-weight: 600; margin-right: 3px; }

.pub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.empty {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 12.5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.pub-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.pub-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.pub-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pub-thumb {
  width: 52px; height: 68px;
  border-radius: 5px;
  border: 1px solid var(--line);
  object-fit: cover;
  object-position: top center;
  background: #f0f2f5;
  flex: none;
}
.pub-card .meta { flex: 1; min-width: 0; }
.pub-card .name { font-weight: 600; font-size: 13.5px; }
.pub-card .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.pub-card .tag {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #c3d8fb;
  color: #1a52b8;
  background: var(--accent-soft);
}

.foot {
  margin-top: 32px;
  color: var(--ink-3);
  font-size: 12px;
}

@media (max-width: 640px) {
  .topsearch input { width: 140px; }
  .hero h1 { font-size: 23px; }
}
