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

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

a {
  color: #bf0000;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  padding: 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.5rem;
  color: #333;
}

header h1 a {
  color: #333;
}

/* Main content wrapper */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

/* Affiliate notice */
.affiliate-notice {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #856404;
}

/* Genre list (index page) */
.genre-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.genre-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  display: flex;
  align-items: stretch;
}

.genre-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.genre-card a {
  display: flex;
  align-items: stretch;
  color: inherit;
  flex: 1;
}

.genre-card-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  flex-shrink: 0;
}

.genre-card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.genre-card-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.25rem;
}

.genre-card-count {
  font-size: 0.85rem;
  color: #666;
}

/* Product list (ranking page) */
.product-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.product-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
}

.product-rank {
  background-color: #bf0000;
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.product-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
}

.product-name {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-shop {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #bf0000;
  margin-bottom: 0.5rem;
}

.product-review {
  font-size: 0.85rem;
  color: #666;
}

.product-card-body {
  padding: 0 1rem 1rem 1rem;
}

.product-button {
  display: inline-block;
  background-color: #bf0000;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  width: 100%;
  text-align: center;
}

.product-button:hover {
  background-color: #8b0000;
  text-decoration: none;
}

/* Footer */
footer {
  background-color: #f0f0f0;
  border-top: 1px solid #ddd;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

footer p {
  margin-bottom: 1rem;
}

footer a {
  color: #bf0000;
}

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

/* Responsive */
@media (min-width: 480px) {
  .genre-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .genre-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .genre-card-image {
    width: 150px;
    height: 150px;
  }
}
