:root {
  color-scheme: light dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  font-size: 16px;
  --bg: #f5f6fb;
  --panel: rgba(255, 255, 255, 0.8);
  --border: rgba(15, 23, 42, 0.12);
  --text: #101828;
  --muted: #475467;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #edf2ff 0%, #f8fafc 100%);
  color: var(--text);
  min-height: 100vh;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.page-header,
.page-footer {
  padding: 2.5rem 0 2rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 2.7vw, 2.8rem);
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0 0;
  padding: 0;
}

.meta > div {
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.95rem;
}

.meta dt {
  font-weight: 600;
  color: var(--accent);
}

.meta dd {
  margin: 0;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.8rem;
  backdrop-filter: blur(18px);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.field input,
.field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.reset-button {
  align-self: start;
  margin-top: 1.9rem;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reset-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.summary-card {
  flex: 1 1 180px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.summary-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-card strong {
  font-size: 1.6rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrapper {
  max-height: 70vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 900px;
}

thead {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  z-index: 5;
}

thead th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  cursor: pointer;
  user-select: none;
}

thead th.sort-asc::after,
thead th.sort-desc::after {
  content: '';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-50%) rotate(45deg);
}

thead th.sort-desc::after {
  transform: translateY(-50%) rotate(-135deg);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

thead th:nth-child(7),
thead th:nth-child(8),
tbody td:nth-child(7),
tbody td:nth-child(8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

tbody a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

tbody a:hover {
  text-decoration: underline;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.dofollow {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.badge.nofollow {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.badge.unknown {
  background: rgba(148, 163, 184, 0.25);
  color: #334155;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.page-footer {
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .meta {
    flex-direction: column;
    gap: 0.7rem;
  }
}
