* {
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background: #f6f6ef;
  color: #333;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  color: #888;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: underline;
}

h1 {
  margin: 0;
  color: #ff6600;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover {
  text-decoration: none;
}

.download-link {
  padding: 8px 16px;
  background: #ff6600;
  color: white;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
}

.download-link:hover {
  background: #e55c00;
  text-decoration: none;
  color: white;
}

.tagline {
  color: #888;
  font-size: 14px;
  margin: 0;
}

.search-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input[type="text"] {
  padding: 10px;
  width: 300px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.search-form button {
  padding: 10px 20px;
  background: #ff6600;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.search-form button:hover {
  background: #e55c00;
}

.search-form a {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
}

.search-form a:hover {
  text-decoration: underline;
}

.stats {
  color: #666;
  margin-bottom: 15px;
  font-size: 14px;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stats-row .stats {
  margin-bottom: 0;
}

.mobile-filters {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #444;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.filter-btn.active {
  background: #ff6600;
  border-color: #ff6600;
  color: white;
}

.filter-arrow {
  opacity: 0.7;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #ff6600;
  color: white;
  font-weight: 500;
}

.sort-arrow {
  color: white;
  text-decoration: none;
  opacity: 0.7;
  margin-left: 4px;
}

.sort-arrow:hover {
  opacity: 1;
  text-decoration: none;
}

tr:hover {
  background: #f9f9f9;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.author {
  font-weight: 500;
  color: #333;
}

.link {
  word-break: break-all;
}

.clicks {
  color: #666;
  font-size: 13px;
  text-align: center;
}

.likes {
  color: #666;
  font-size: 13px;
  text-align: center;
}

.like-cell {
  text-align: center;
}

.heart-btn {
  background: transparent;
  border: 1px solid #ff69b4;
  font-size: 20px;
  cursor: pointer;
  color: #ff69b4;
  padding: 4px 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.heart-btn:hover {
  background: #fff4fb;
  color: #ff69b4;
}

.heart-btn.liked {
  background: #ff69b4;
  color: #fff;
}


.pagination {
  margin-top: 20px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  text-decoration: none;
}

.pagination a:hover {
  background: #f0f0f0;
  text-decoration: none;
}

.pagination .current {
  background: #ff6600;
  color: white;
  border-color: #ff6600;
}

.pagination .disabled {
  color: #999;
  pointer-events: none;
}

footer {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
}

.footer-dot {
  color: #666;
}

.footer-link {
  color: #666;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-github {
  display: flex;
  align-items: center;
  opacity: 0.6;
}

.footer-github:hover {
  opacity: 1;
  text-decoration: none;
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  h1 {
    font-size: 22px;
  }

  .header-links {
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
  }

  .download-link {
    margin-left: auto;
  }

  .search-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .search-form {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-form input[type="text"] {
    width: 100%;
  }

  .mobile-filters {
    display: flex;
  }

  .stats-row {
    align-items: flex-start;
  }

  table {
    display: block;
    background: transparent;
    box-shadow: none;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
  }

  th {
    font-weight: 500;
  }

  tr {
    display: block;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    padding-right: 12px;
  }

  .link {
    word-break: break-word;
  }

  .link a {
    display: block;
    text-align: right;
  }

  .link::before {
    white-space: nowrap;
  }

  .likes,
  .clicks,
  .like-cell {
    text-align: right;
  }

  .like-cell {
    padding-top: 10px;
  }

  .like-cell::before {
    content: "";
  }

  .like-cell .heart-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ff69b4;
    border-radius: 6px;
    background: transparent;
    color: #ff69b4;
    font-size: 20px;
  }

  .like-cell .heart-btn.liked {
    background: #ff69b4;
    color: #fff;
  }

  .pagination {
    justify-content: center;
  }

  footer {
    flex-wrap: wrap;
    text-align: center;
  }
}

@media (min-width: 520px) and (max-width: 720px) {
  .stats-row {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .mobile-filters {
    flex-wrap: nowrap;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  th {
    white-space: nowrap;
  }
}
