:root {
  color-scheme: dark light;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: #0b0f16;
  color: #e8edf6;
  line-height: 1.55;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(64, 148, 255, .22), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(126, 87, 255, .16), transparent 30%),
    #0b0f16;
}

button, input { font: inherit; }

button, a {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.discovery-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(11, 15, 22, .88);
  backdrop-filter: blur(14px);
}

.discovery-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.discovery-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4c8dff, #7d57ff);
  color: white;
  font-size: 15px;
}

.discovery-search-form {
  display: flex;
  flex: 1;
  gap: 8px;
  max-width: 620px;
}

.discovery-search-input {
  min-width: 0;
  flex: 1;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: inherit;
  outline: none;
}

.discovery-search-input:focus { border-color: #6ba1ff; box-shadow: 0 0 0 3px rgba(74, 122, 214, .18); }

.discovery-search-button, .discovery-feed-preview-button, .discovery-feed-copy-button, .discovery-preview-copy-button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #387af6;
  color: white;
  cursor: pointer;
}

.discovery-feed-copy-button, .discovery-preview-copy-button { background: rgba(255, 255, 255, .1); }

button:hover { transform: translateY(-1px); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #8ab5ff; outline-offset: 2px; }

.discovery-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.discovery-category-navigation { margin-bottom: 24px; }
.discovery-category-title { margin: 0 0 10px; color: #98a5ba; font-size: 13px; }
.discovery-category-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }

.discovery-category-button {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: #cbd5e4;
  cursor: pointer;
  white-space: nowrap;
}

.discovery-category-button[aria-pressed="true"] { border-color: #5e8dfb; background: rgba(67, 116, 218, .26); color: white; }

.discovery-results-heading-group {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.discovery-results-title { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.discovery-results-status { margin: 0; color: #98a5ba; font-size: 13px; }
.discovery-results-error { margin: 16px 0 0; color: #ff9c9c; }

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

.discovery-feed-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  background: rgba(255, 255, 255, .045);
}

.discovery-feed-card:hover { border-color: rgba(105, 152, 240, .5); background: rgba(255, 255, 255, .065); }
.discovery-feed-card-header { display: flex; gap: 12px; align-items: center; }

.discovery-feed-initial {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(76, 141, 255, .55), rgba(125, 87, 255, .5));
  font-weight: 700;
}

.discovery-feed-title { margin: 0; font-size: 17px; line-height: 1.3; }
.discovery-feed-website { margin: 3px 0 0; color: #8b99af; font-size: 12px; overflow-wrap: anywhere; }
.discovery-feed-description { display: -webkit-box; min-height: 45px; margin: 13px 0; color: #b8c2d2; font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.discovery-feed-card-footer { display: flex; flex-direction: column; gap: 13px; margin-top: auto; }
.discovery-feed-metadata { display: flex; flex-wrap: wrap; gap: 6px; color: #93a0b5; font-size: 11px; }
.discovery-feed-metadata > :not(button) { padding: 3px 7px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.discovery-feed-public-badge { background: rgba(49, 135, 95, .2) !important; color: #9fe6bf; }
.discovery-feed-tag { border: 0; border-radius: 6px; padding: 3px 7px; background: rgba(255, 255, 255, .05); color: #93a0b5; cursor: pointer; font-size: 11px; }
.discovery-feed-tag[aria-pressed="true"] { background: rgba(67, 116, 218, .34); color: #dbe8ff; }
.discovery-feed-tag:hover { background: rgba(255, 255, 255, .11); color: #dbe8ff; }

.discovery-feed-actions { display: flex; align-items: center; gap: 7px; }
.discovery-feed-actions > * { padding: 8px 10px; border-radius: 9px; font-size: 12px; text-decoration: none; }
.discovery-feed-open-link { border: 1px solid rgba(255, 255, 255, .12); color: #c8d3e4; }

.discovery-empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed rgba(255, 255, 255, .14); border-radius: 14px; color: #93a0b5; text-align: center; }

.discovery-preview-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  border-left: 1px solid rgba(255, 255, 255, .1);
  background: #101622;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .36);
}

.discovery-preview-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.discovery-preview-eyebrow { margin: 0 0 4px; color: #7e93b8; font-size: 12px; }
.discovery-preview-title { margin: 0; font-size: 20px; line-height: 1.3; }
.discovery-preview-site-link { display: inline-block; margin-top: 7px; color: #7eabff; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.discovery-preview-close-button { width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; background: rgba(255, 255, 255, .05); color: inherit; cursor: pointer; }

.discovery-preview-content { flex: 1; overflow-y: auto; padding: 12px 24px; }
.discovery-preview-state { padding: 32px 0; color: #98a5ba; text-align: center; }
.discovery-preview-item { padding: 17px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.discovery-preview-item-title { margin: 0 0 7px; color: #dce6f5; font-size: 15px; }
.discovery-preview-item-title a { color: inherit; text-decoration: none; }
.discovery-preview-item-title a:hover { color: #89b2ff; }
.discovery-preview-item-meta { margin: 0 0 6px; color: #7f8ea5; font-size: 11px; }
.discovery-preview-item-description { display: -webkit-box; margin: 0; color: #a9b5c7; font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

.discovery-preview-footer { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid rgba(255, 255, 255, .08); }
.discovery-preview-copy-status { color: #89d69a; font-size: 12px; }

@media (max-width: 720px) {
  .discovery-header { position: static; align-items: stretch; flex-direction: column; }
  .discovery-search-form { max-width: none; }
  .discovery-results-heading-group { align-items: start; flex-direction: column; }
  .discovery-feed-list { grid-template-columns: 1fr; }
}
