/* Base */
:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #24304d;
  --color-text-muted: #666666;
  --color-border: #e0e0e0;
  --color-primary: #007cba;
  --color-primary-dark: #005f8f;
  --color-accent: #ff6900;
  --color-accent-dark: #d95a00;
  --color-success: #00d084;
  --color-notice-bg: #fff3cd;
  --color-notice-border: #fcb900;
  --color-notice-text: #856404;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --container-width: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.container {
  width: min(var(--container-width), calc(100% - 2rem));
  margin: 0 auto;
}

/* Header / footer */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.site-footer {
  margin-top: 2.5rem;
  padding: 2.5rem 0;
  text-align: center;
  color: #ffffff;
  background: #2c3862;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.5rem;
  opacity: 0.8;
  font-size: 0.875rem;
}

/* Shared UI */
.notice {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-notice-border);
  border-radius: var(--radius-sm);
  background: var(--color-notice-bg);
}

.notice p {
  margin: 0;
  color: var(--color-notice-text);
  font-size: 0.875rem;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.button:hover,
.button:focus-visible {
  background: var(--color-primary-dark);
}

.button--accent {
  background: var(--color-accent);
}

.button--accent:hover,
.button--accent:focus-visible {
  background: var(--color-accent-dark);
}

/* Sections */
main section {
  margin-top: 2.5rem;
}

main h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 2.5vw, 2.625rem);
  line-height: 1.2;
}

.hero {
  padding-top: 0.5rem;
  padding-bottom: 2.5rem;
}

.hero p {
  max-width: 50rem;
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.ranking > h2,
.comparison > h2,
.guide > h2 {
  font-size: 2rem;
}

.ranking {
  padding-bottom: 2.5rem;
}

.comparison {
  padding-bottom: 2.5rem;
}

/* Product cards */
.product-list {
  display: grid;
  gap: 1rem;
}

.product-card {
  display: grid;
  grid-template-columns: 60px 100px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.product-card__image {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__rank {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-primary);
}

.product-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

.spec-list div {
  margin: 0;
}

.spec-list dt {
  font-weight: 700;
}

.spec-list dd {
  margin: 0;
  color: var(--color-text-muted);
}

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.score {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--color-success);
  color: #ffffff;
  font-weight: 700;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #eef5fb;
}

th,
td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

/* Guide */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.guide-card {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.guide-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.guide-card p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .product-card {
    grid-template-columns: 48px 80px 1fr;
  }

  .product-card__image {
    width: 80px;
    height: 80px;
  }

  .product-card__actions {
    grid-column: 1 / -1;
  }

  .spec-list,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container-width), calc(100% - 1rem));
  }

  main section {
    margin-top: 2rem;
  }

  .product-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem 1.25rem;
    padding: 1.25rem;
    align-items: start;
  }

  .product-card__rank {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.5rem;
    text-align: center;
    min-width: 2.25rem;
    padding-top: 0.25rem;
  }

  .product-card__image {
    grid-column: 2;
    grid-row: 1;
    width: 88px;
    height: 88px;
    max-width: none;
    justify-self: start;
    flex-shrink: 0;
  }

  .product-card__content {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 0.25rem;
    border-top: 1px solid var(--color-border);
  }

  .product-card__content h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
  }

  .product-card__actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
  }

  .product-card__actions .button {
    display: block;
    text-align: center;
  }

  .spec-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
  }

  .spec-list dt {
    font-size: 0.8125rem;
  }

  .spec-list dd {
    font-size: 0.8125rem;
  }

  .product-card__meta {
    gap: 0.5rem;
    font-size: 0.8125rem;
  }

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

  th,
  td {
    padding: 0.75rem;
  }
}