:root {
  --bg: #ffffff;
  --sidebar: #f6f6f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: #e6e6e8;
  --chip: #f2f2f4;
  --blue: #0071e3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  color-scheme: light;
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button, input, a { font: inherit; color: inherit; }

button, .card, .primary { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.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;
}

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 20px 14px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--line-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
}

.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1d1d1f;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.brand strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
}

.nav-block { display: grid; gap: 6px; }

.tags-block { margin-top: 22px; }

.nav-label {
  margin: 0;
  padding: 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subnav {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 16px;
}

.chip.sub {
  min-height: 32px;
  padding-left: 12px;
  color: #6e6e73;
  font-size: 13px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3a3a3c;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.chip .nav-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #6e6e73;
  flex: none;
}

.chip .nav-icon svg { display: block; }

.chip .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ececef;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.chip[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.chip[aria-pressed="true"] .nav-icon { color: var(--ink); }

.chip[aria-pressed="true"] .count {
  background: #1d1d1f;
  color: #fff;
}

.side-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.side-status::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #30b34a;
  flex: none;
}

.workspace {
  min-height: 100vh;
  margin-left: 248px;
  padding: 28px 32px 48px;
  background: #fff;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.search { position: relative; }

.search input {
  width: 280px;
  height: 40px;
  padding: 0 58px 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f5f5f7;
  color: var(--ink);
}

.search input::placeholder { color: #aeaeb2; }

.search input:focus {
  background: #fff;
  border-color: #d2d2d7;
  outline: none;
}

.search kbd {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: #aeaeb2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.search input:not(:placeholder-shown) + kbd { display: none; }

.primary {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: #1d1d1f;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.primary:hover { background: #000; }

.panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.panel-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-tools:not(:has(:not([hidden]))) { display: none; }

.subfilters {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.subfilters[hidden] { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.pill .count {
  color: #86868b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pill[aria-pressed="true"] {
  background: #1d1d1f;
  border-color: #1d1d1f;
  color: #fff;
}

.pill[aria-pressed="true"] .count { color: rgba(255, 255, 255, 0.72); }

.text-button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.groups { display: grid; gap: 28px; }

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.group h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.group-head .count {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
}

a.card {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.card.is-static { cursor: default; }

.card.is-compact {
  gap: 6px;
  padding: 12px;
}

.card.is-compact .icon,
.card.is-compact .icon img {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.card.is-compact h3 { font-size: 15px; }

.card.is-compact .desc {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #6e6e73;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.cat-tag[data-category="AI工具"] { color: #1d4f91; background: rgba(0, 113, 227, 0.1); }
.cat-tag[data-category="办公效率"] { color: #3d5a94; background: rgba(70, 100, 180, 0.12); }
.cat-tag[data-category="搜索引擎"] { color: #0f6e78; background: rgba(15, 140, 150, 0.12); }
.cat-tag[data-category="设计素材"] { color: #6d4ca3; background: rgba(120, 80, 200, 0.12); }
.cat-tag[data-category="开发建站"] { color: #1b6b42; background: rgba(48, 179, 74, 0.12); }
.cat-tag[data-category="外贸工具"] { color: #9a4d16; background: rgba(230, 126, 34, 0.14); }
.cat-tag[data-category="学习资料"] { color: #3d4f9a; background: rgba(70, 90, 190, 0.12); }
.cat-tag[data-category="其他"] { color: #6e6e73; background: rgba(0, 0, 0, 0.05); }
.cat-tag[data-category="模型API"] { color: #1d4f91; background: rgba(0, 113, 227, 0.1); }
.cat-tag[data-category="会员充值"] { color: #8a5a12; background: rgba(200, 140, 30, 0.14); }
.cat-tag[data-category="智能体工具"] { color: #5b3d8a; background: rgba(120, 80, 200, 0.12); }
.cat-tag[data-category="AI对话"] { color: #0f5f9a; background: rgba(0, 122, 200, 0.1); }
.cat-tag[data-category="AI绘图"] { color: #9a3d78; background: rgba(200, 70, 140, 0.1); }
.cat-tag[data-category="AI视频"] { color: #9a3b3b; background: rgba(180, 60, 60, 0.1); }
.cat-tag[data-category="AI编程"] { color: #1b6b42; background: rgba(48, 179, 74, 0.12); }

.icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  background: var(--mark, #e8e8ed);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.letter {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.icon img {
  position: absolute;
  inset: 0;
  width: 36px;
  height: 36px;
  padding: 6px;
  object-fit: contain;
  background: #fff;
}

.icon.has-icon .letter { opacity: 0; }

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  color: var(--faint);
  font-size: 12px;
}

.tag, .badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6e6e73;
}

.badge { color: var(--blue); }

.host { color: var(--faint); }

.empty { padding: 28px 4px 8px; color: var(--muted); }

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

noscript {
  display: block;
  margin: 16px;
  color: var(--ink);
}

@media (max-width: 860px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .brand,
  .nav-label,
  .side-status { display: none; }

  .nav-block,
  .tags-block {
    width: 100%;
    margin: 0;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }

  .nav-group { display: contents; }

  .subnav {
    display: flex;
    flex: 1 0 100%;
    gap: 8px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .subnav::-webkit-scrollbar { display: none; }

  .nav-list::-webkit-scrollbar { display: none; }

  .chip {
    width: auto;
    flex: none;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line-strong);
    padding: 0 12px;
  }

  .chip[aria-pressed="true"] {
    background: #1d1d1f;
    color: #fff;
    box-shadow: none;
  }

  .chip[aria-pressed="true"] .nav-icon,
  .chip[aria-pressed="true"] .count { color: #fff; }

  .chip[aria-pressed="true"] .count { background: rgba(255, 255, 255, 0.16); }

  .workspace {
    margin-left: 0;
    padding: 20px 16px 40px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  h1 { font-size: 30px; }

  .header-actions { width: 100%; }

  .search { flex: 1; }

  .search input { width: 100%; }

  .search kbd { display: none; }

  .panel { padding: 0; border: 0; border-radius: 0; }

  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  a.card { transition: none; }
  a.card:hover { transform: none; }
}
