:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --fg: #1d1d1f;
  --muted: #86868b;
  --subtle: #6e6e73;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
  --accent: #2AABEE;
  --accent-soft: rgba(42, 171, 238, 0.12);
  --accent-line: rgba(42, 171, 238, 0.28);
  --brand: #2AABEE;
  --brand-soft: rgba(42, 171, 238, 0.10);
  --brand-line: rgba(42, 171, 238, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.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;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}
body { min-height: 100vh; }
a { color: var(--brand); text-decoration: none; font-weight: 560; }
a:hover { text-decoration: underline; }

/* —— shell (FOMO width) —— */
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 88px;
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 24px); padding: 28px 0 64px; }
}

/* —— hero —— */
.hero { margin-bottom: 22px; }
.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.brand-mark {
  width: 40px;
  height: 40px;
  margin-top: 0;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.08);
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--fg);
}
.brand .sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

/* FOMO pill topnav — sits top-right */
.topnav {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.055);
  border-radius: 980px;
  padding: 5px;
  flex-shrink: 0;
}
.nav-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  border-radius: 980px;
  padding: 11px 20px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--fg); }
.nav-tab.active {
  background: #fff;
  color: var(--fg);
  font-weight: 780;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.08);
}
.nav-tab .n {
  margin-left: 6px;
  opacity: 0.45;
  font-weight: 600;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.nav-tab.active .n { opacity: 0.7; color: var(--brand); }

@media (max-width: 640px) {
  .topnav { width: 100%; }
  .nav-tab { flex: 1; padding: 10px 12px; font-size: 0.92rem; text-align: center; }
}

/* tools row under hero */
.hero-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 18px;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}
.search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 980px;
  padding: 11px 16px 11px 38px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--fg);
  box-shadow: var(--shadow);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.search::placeholder { color: var(--muted); }
.search:focus {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.16), var(--shadow);
}
.tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.meta-line {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sort-pill {
  background: rgba(0, 0, 0, 0.055);
  border-radius: 980px;
  padding: 4px;
}
.sort-pill select {
  appearance: none;
  border: none;
  background: #fff;
  color: var(--fg);
  border-radius: 980px;
  padding: 9px 34px 9px 14px;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 3px 10px rgba(0,0,0,0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%86868b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
}

/* stats cards removed — counts live in footer meta line */

/* —— topic chips —— */
.topics-row { margin-bottom: 16px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(0,0,0,0.045);
  color: var(--subtle);
  border-radius: 980px;
  padding: 8px 13px;
  font-size: 0.8rem;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
}
.chip:hover { color: var(--fg); background: rgba(0,0,0,0.07); }
.chip.active {
  background: var(--fg);
  color: #fff;
  border-color: transparent;
}
.chip .n {
  margin-left: 5px;
  opacity: 0.55;
  font-weight: 500;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.chip.active .n { opacity: 0.75; }

/* —— board list (FOMO table panel) —— */
.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board-head {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 110px minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 110px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.row:last-child { border-bottom: none; }
.row:hover { background: rgba(0, 0, 0, 0.015); }

@media (max-width: 860px) {
  .board-head { display: none; }
  .row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "title members action";
    gap: 10px 10px;
    padding: 14px 14px;
    align-items: center;
  }
  .row-title { grid-area: title; align-items: center; }
  .row-title-text { min-width: 0; }
  .row-members {
    grid-area: members;
    text-align: right;
    font-size: 0.88rem;
  }
  .row-members span { display: none; }
  .row-blurb { display: none; }
  .row-action { grid-area: action; align-self: center; }
  .row-action .btn.ghost { display: none; }
  .row-user { display: none; }
}
@media (max-width: 420px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title action"
      "members action";
  }
  .row-members { text-align: left; padding-left: 52px; }
}

.row-title { min-width: 0; display: flex; align-items: flex-start; gap: 12px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(145deg, #5ac8fa 0%, #2AABEE 55%, #0077b5 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}
.avatar.kind-group { background: linear-gradient(145deg, #ffb340 0%, #ff9500 55%, #c46a00 100%); }
.avatar.kind-bot { background: linear-gradient(145deg, #64d2ff 0%, #2AABEE 55%, #5856d6 100%); }
.avatar.has-img { background: #e8e8ed; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.avatar .avatar-fallback {
  display: none;
  position: relative;
  z-index: 0;
}
.avatar:not(.has-img) .avatar-fallback { display: inline; }
.row-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-user {
  margin: 3px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.row-user .verified { color: var(--brand); font-size: 0.7rem; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 980px;
  background: rgba(0,0,0,0.04);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 550;
  white-space: nowrap;
}
.pill.topic {
  background: rgba(0,0,0,0.04);
  color: var(--subtle);
}
.pill.audience {
  background: rgba(42, 171, 238, 0.10);
  color: #0a7ab8;
  font-weight: 600;
}

.row-members {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row-members span {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.row-blurb {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--subtle);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.row-action {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  border-radius: 980px;
  padding: 8px 13px;
  font-size: 0.78rem;
  font-weight: 650;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); }
.btn.primary {
  background: var(--fg);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.btn.primary:hover { background: #000; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding-left: 6px;
  padding-right: 6px;
  font-weight: 550;
  font-size: 0.74rem;
}
.btn.ghost:hover { color: var(--fg); }


/* —— search highlight (FOMO-clean) —— */
mark.hl {
  background: rgba(42, 171, 238, 0.18);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.row:hover mark.hl {
  background: rgba(42, 171, 238, 0.26);
}
.pill.topic mark.hl {
  background: rgba(42, 171, 238, 0.22);
  padding: 0 1px;
}
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
}

.footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}
.footer p { margin: 0; }
.footer-line {
  display: block;
}
.footer a { color: var(--brand); font-weight: 560; }

/* submit收录 */
.submit-btn {
  display: inline-flex;
  align-items: center;
  appearance: none;
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 980px;
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.submit-btn:hover {
  text-decoration: none;
  background: rgba(42, 171, 238, 0.18);
  border-color: var(--brand);
  color: #0a7ab8;
}
@media (max-width: 640px) {
  .submit-btn { padding: 8px 12px; font-size: 0.76rem; }
  .tools-right { flex-wrap: wrap; justify-content: flex-end; }
}

.pill.recent {
  background: var(--brand-soft);
  color: var(--brand);
}
