:root {
  --blue-900: #1e3a8a;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-blue: 0 8px 24px rgba(59, 130, 246, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-700);
  text-decoration: none;
}

.logo span {
  color: var(--orange-500);
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav a {
  color: var(--gray-600);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.header-nav a:hover {
  color: var(--blue-600);
  background: var(--blue-50);
}

.header-nav a.active {
  color: var(--blue-700);
  background: var(--blue-100);
  font-weight: 500;
}

/* Main */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: 2.25rem;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.hero p {
  color: var(--gray-500);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  background: #fff;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--blue-100);
}

.search-box button {
  padding: 14px 28px;
  background: var(--orange-500);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.search-box button:hover {
  background: var(--orange-600);
  transform: translateY(-1px);
}

/* Content */
.content {
  margin-top: 8px;
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  font-size: 0.95rem;
  cursor: pointer;
  background: #fff;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--blue-600);
  border-color: var(--blue-300);
  background: var(--blue-50);
}

.tab.active {
  background: var(--blue-500);
  color: #fff;
  border-color: var(--blue-500);
  font-weight: 500;
}

/* Category section */
.category-section {
  margin-bottom: 36px;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-100);
}

.category-title .icon {
  font-size: 1.4rem;
}

.category-title .count {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 400;
  margin-left: auto;
}

/* Links grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  transition: all 0.2s;
}

.link-card:hover {
  border-color: var(--blue-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
}

.link-card:active {
  transform: translateY(-1px);
}

.link-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--blue-50);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-url {
  font-size: 0.75rem;
  color: var(--blue-500);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* Footer */
.footer {
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding: 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.footer a {
  color: var(--blue-700);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--orange-500);
}

.divider {
  margin: 0 12px;
  color: var(--gray-300);
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    height: 56px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .header-nav a {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .main {
    padding: 24px 16px 40px;
  }

  .hero {
    padding: 24px 0 20px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

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

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .divider {
    display: none;
  }
}
