:root {
  --bg: #f5f7fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --card-hover: #ffffff;
  --text: #1f2733;
  --text-muted: #6b7688;
  --text-faint: #9aa4b4;
  --border: #e4e8f0;
  --border-strong: #d4dae6;
  --accent: #4f6ef7;
  --accent-soft: #edf1ff;
  --accent-hover: #3d5ae6;
  --green: #16a34a;
  --shadow-sm: 0 1px 2px rgba(24, 39, 75, 0.04), 0 2px 8px rgba(24, 39, 75, 0.04);
  --shadow-md: 0 8px 24px rgba(24, 39, 75, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 460px; height: 460px; background: #d9e2ff; top: -180px; right: -120px; }
.orb-2 { width: 380px; height: 380px; background: #e5ddff; top: 320px; left: -180px; }

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 64px 20px 34px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 10px rgba(79, 110, 247, 0.25));
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.5px;
  font-weight: 800;
  background: linear-gradient(120deg, #1f2733 20%, #4f6ef7 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-muted); margin-top: 10px; font-size: 15px; }
.hero-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.badge-source { color: var(--accent); }

.search-wrap {
  position: relative;
  margin-top: 28px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  opacity: 0.7;
}
#searchInput {
  width: 100%;
  padding: 15px 48px 15px 48px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
#searchInput::placeholder { color: var(--text-faint); }
#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.12);
}
.clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--bg-soft);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  font-size: 13px;
}
.clear-btn.show { display: block; }
.clear-btn:hover { background: var(--border-strong); color: var(--text); }

main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}
.copy-all-btn {
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
  white-space: nowrap;
}
.copy-all-btn:hover { border-color: var(--accent); color: var(--accent); }

.grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(90deg, var(--accent-soft), rgba(237, 241, 255, 0.25));
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.card-title { font-size: 16px; font-weight: 700; }
.card-count { margin-left: auto; font-size: 12px; color: var(--text-faint); }

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
  padding: 14px 18px 16px;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s;
}
.link-row:hover { background: var(--accent-soft); border-color: #dbe3ff; }
.link-main {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}
.link-favicon {
  width: 22px; height: 22px; border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.link-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-host {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-main:hover .link-name { color: var(--accent); }
.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn.copied { background: var(--green); color: #fff; border-color: var(--green); }
.note-row {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

mark { background: #fff3bf; color: inherit; border-radius: 3px; padding: 0 2px; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-emoji { font-size: 42px; margin-bottom: 10px; }
.empty-state p { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state span { font-size: 14px; }

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 28px 20px 40px;
  color: var(--text-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: 5px; }

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #1f2733;
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .hero { padding: 44px 16px 26px; }
  main { padding: 0 14px 44px; }
  .link-list { grid-template-columns: 1fr; }
  .card-head { padding: 11px 14px; }
  .link-list { padding: 12px 14px 14px; }
  #searchInput { padding: 13px 42px 13px 42px; font-size: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .copy-all-btn { width: 100%; }
}
