/* ===== COMPONENTS CSS — 浅色主题适配 ===== */

/* ===== CATEGORY TABS (工具导航) ===== */
.category-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  font-family: inherit;
  white-space: nowrap;
}

.category-tab:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.category-tab.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

.category-tab__count {
  font-size: 0.6875rem;
  opacity: 0.7;
}

/* ===== TOOLS GRID ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Tool card */
.tool-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--dur-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--brand-blue-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tool-card__favicon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.tool-card__name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.tool-card__category {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  align-self: flex-start;
}

.tool-card__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.tool-card__tags {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.tool-card__tag {
  font-size: 0.6875rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue-border);
}

.tool-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.tool-card__pricing {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
}

.tool-card__pricing--free {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.tool-card__pricing--freemium {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.tool-card__pricing--paid {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.tool-card__pricing--open-source {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.tool-card__verified {
  font-size: 0.75rem;
  color: var(--color-success);
}

/* ===== NEWS CARDS ===== */
.news-card {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: all .15s;
  text-decoration: none;
  color: inherit;
}
.news-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-decoration: none;
}
.news-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.news-source-badge {
  font-size: .6875rem;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 99px;
  border: 1px solid;
}
.news-time {
  font-size: .625rem;
  color: var(--text-muted);
  margin-left: auto;
}
.news-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}
.news-summary {
  font-size: .75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}
.news-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.news-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.news-score {
  font-size: .6875rem;
  font-weight: 600;
  color: var(--brand);
}
.news-score__arrow { color: var(--success); }
.skeleton-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.skeleton-line {
  background: linear-gradient(90deg,var(--bg-tertiary),var(--bg-secondary),var(--bg-tertiary));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.empty-state {
  text-align: center;
  padding: 60px;
  color: var(--text-tertiary);
}

/* ===== NEWS TICKER BAR ===== */
.news-ticker-bar {
  background: var(--brand-blue-light);
  border-top: 1px solid var(--brand-blue-border);
  border-bottom: 1px solid var(--brand-blue-border);
  padding: var(--space-2) var(--content-padding);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  overflow: hidden;
  max-width: var(--max-width);
  margin: 0 auto;
}

.news-ticker-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

.news-ticker-inner {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 24px;
}

.news-ticker-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.news-ticker-item__source {
  font-weight: 600;
  color: var(--brand-blue);
  margin-right: var(--space-2);
}

/* ===== ABOUT GRID ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.about-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}

.about-card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

.about-card__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.about-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== SOURCE STATUS GRID ===== */
.source-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.source-status-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.source-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-status-dot--ok { background: var(--color-success); }
.source-status-dot--error { background: var(--color-danger); }
.source-status-dot--unknown { background: var(--text-muted); }

/* ===== SORT SELECT ===== */
.sort-select {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color var(--dur-fast);
}

.sort-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* ===== SECTION CONTROLS ===== */
.section-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ===== WEBSITE LINK ===== */
.website-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  transition: color var(--dur-fast);
}

.website-link:hover {
  color: var(--brand-blue);
}

/* Responsive for components */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

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

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

  .category-tabs {
    gap: var(--space-1);
  }

  .category-tab {
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
  }
}
