:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
}

body {
  margin: 0;
  background: #f5f5f7;
  color: #1a1a1a;
}

header {
  background: #fff;
  border-bottom: 1px solid #e5e5e7;
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: 20px;
}

.stats {
  color: #666;
  font-size: 13px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-form input[type="search"] {
  flex: 1 1 260px;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

.filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e0e0e3;
  border-radius: 8px;
}

.filter-inline select {
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.add-link-panel {
  margin: 16px 0;
  padding: 8px 12px;
  background: #f7f7f9;
  border: 1px solid #e0e0e3;
  border-radius: 8px;
}

.add-link-panel > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  padding: 4px 0;
}

.add-link-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-link-form input[type="url"] {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.turnstile-widget {
  min-width: 0;
  display: flex;
  align-items: center;
}

.add-link-form button {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  background: #0a7cff;
  color: #fff;
  cursor: pointer;
}

.add-link-form button:hover { background: #086ce0; }

.add-status {
  margin-top: 8px;
  font-size: 13px;
  color: #555;
}

.add-status.error { color: #b00020; }
.add-status.success { color: #1e7d1e; }

.add-auth-hint {
  margin: 8px 0 4px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff7d6;
  border: 1px solid #f0d879;
  border-radius: 6px;
  color: #6a4b00;
}
.add-auth-hint a { color: #0a5cb0; }

.add-link-form button:disabled {
  background: #b0b0b0;
  cursor: not-allowed;
}

.auth {
  font-size: 13px;
  color: #555;
  margin-left: auto;
}
.auth a { color: #0a5cb0; text-decoration: none; }
.auth a:hover { text-decoration: underline; }

.search-form button[type="submit"] {
  padding: 12px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #0a7cff;
  color: #fff;
  cursor: pointer;
}

.search-form button[type="submit"]:hover {
  background: #0866d6;
}

.status {
  color: #555;
  margin-bottom: 12px;
  font-size: 14px;
}

.results {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.results-table th,
.results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  text-align: left;
}

.results-table thead th {
  background: #f7f7f9;
  color: #333;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 2px solid #e0e0e3;
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.results-table thead th.sortable:hover {
  background: #ecedef;
}

.results-table tbody tr:hover {
  background: #fafbfd;
}

.col-image { width: 56px; }
.col-image img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  display: block;
}

.col-name a {
  color: #111;
  text-decoration: none;
  font-weight: 500;
}
.col-name a:hover { text-decoration: underline; }

.col-price { white-space: nowrap; }
.col-price .current {
  color: #d0021b;
  font-weight: 700;
  margin-right: 6px;
}
.col-price .original {
  color: #999;
  text-decoration: line-through;
  font-size: 12px;
}

.col-discount, .col-status { white-space: nowrap; }
.col-sold { color: #666; white-space: nowrap; }
.col-status.in-stock { color: #2a8f3a; font-weight: 500; }
.col-posted, .col-landings { white-space: nowrap; }
.col-posted.unknown { color: #999; }

.col-landings details.landings {
  display: inline-block;
}
.col-landings details.landings > summary {
  cursor: pointer;
  color: #0a7cff;
  list-style: none;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf3ff;
  font-weight: 600;
  font-size: 12px;
}
.col-landings details.landings > summary::-webkit-details-marker { display: none; }
.col-landings details.landings[open] > summary { background: #d5e7ff; }

.col-landings ul.landings-list {
  list-style: none;
  padding: 6px 0 0 0;
  margin: 4px 0 0 0;
  border-top: 1px dashed #e2e2e5;
  max-width: 460px;
  white-space: normal;
}
.col-landings ul.landings-list li {
  padding: 4px 0;
  border-bottom: 1px dotted #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 12px;
}
.col-landings ul.landings-list li:last-child { border-bottom: none; }
.col-landings .group a { color: #111; text-decoration: none; font-weight: 500; }
.col-landings .group a:hover { text-decoration: underline; }
.col-landings .when { color: #666; }
.col-landings .when.unknown { color: #999; font-style: italic; }
.col-landings .weee-link { color: #0a7cff; text-decoration: none; }
.col-landings .weee-link:hover { text-decoration: underline; }

.col-group a, .col-link a {
  color: #0a7cff;
  text-decoration: none;
}
.col-group a:hover, .col-link a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #eee;
  color: #555;
  white-space: nowrap;
}

.badge.discount { background: #ffe1e6; color: #c00028; }
.badge.sold-out { background: #333; color: #fff; }
