/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: #f4f5f7;
  color: #1a2a3a;
  line-height: 1.6;
  min-width: 320px;
}

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2d44 50%, #2a4060 100%);
  color: #fff;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #c0c0c0, #e8e8e8, #c0c0c0);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.site-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.site-header .subtitle {
  font-size: 13px;
  color: #a0b4c8;
  letter-spacing: 0.04em;
}

/* ===== Language Toggle ===== */
.lang-toggle {
  margin-top: 10px;
}
.lang-btn {
  background: transparent;
  color: #a0b4c8;
  border: 1px solid #a0b4c8;
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 3px;
  border-radius: 3px;
}
.lang-btn:hover {
  color: #fff;
  border-color: #fff;
}
.lang-btn.active {
  background: #fff;
  color: #1b2d44;
  border-color: #fff;
  font-weight: 600;
}

/* ===== Navigation (header) ===== */
.site-header nav {
  margin-top: 12px;
}
.site-header nav a {
  color: #a0b4c8;
  text-decoration: none;
  font-size: 13px;
  margin: 0 10px;
  transition: color 0.2s;
}
.site-header nav a:hover {
  color: #fff;
}
.site-header nav a.current {
  color: #fff;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 2px;
}

/* ===== Main ===== */
.site-main {
  max-width: 100%;
  padding: 20px 16px 32px;
}

/* ===== Filter Box ===== */
.filter-box {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 13px;
}
.filter-box .filter-row {
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-box .filter-row:last-child { margin-bottom: 0; }
.filter-box .filter-note {
  font-size: 11px;
  color: #888;
  margin-left: 94px;
  margin-bottom: 2px;
}
.filter-box .filter-label {
  font-weight: 700;
  color: #1a2a3a;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 2px;
}
.filter-box .filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.filter-box label {
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 0;
  transition: color 0.15s;
}
.filter-box label:hover { color: #2a6496; }
.filter-box label.maker-badge {
  color: #fff;
  padding: 4px 8px 3px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.filter-box label.maker-badge:hover { color: #fff; opacity: 0.8; }
.filter-box input[type="checkbox"] {
  margin-right: 3px;
  margin-bottom: 1px;
  accent-color: #1b2d44;
}

/* ===== Table Wrapper ===== */
.table-wrapper {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  background: #fff;
  max-height: calc(100vh - 220px);
}

/* ===== Table ===== */
table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
  min-width: 1600px;
}
thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
th {
  background: linear-gradient(180deg, #1b2d44 0%, #0d1b2a 100%);
  color: #e8e8e8;
  padding: 8px 6px;
  border: 1px solid #2a4060;
  white-space: nowrap;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
  text-align: center;
}
th[data-sort] {
  cursor: pointer;
  transition: background 0.15s;
}
th[data-sort]:hover {
  background: linear-gradient(180deg, #2a4060 0%, #1b2d44 100%);
}
.sort-indicator { color: #c0c0c0; }
td {
  border: 1px solid #d0d5dd;
  padding: 5px 6px;
  vertical-align: top;
  white-space: nowrap;
  text-align: center;
}
/* 車名列は左寄せ */
td:nth-child(2) { text-align: left; }
/* メーカー列は左寄せ */
td:nth-child(1) { text-align: left; font-weight: 600; font-size: 12px; }

tbody tr:nth-child(even) { background: #f8f9fb; }
tbody tr:hover { background: #e8edf4; }

a { color: #1a5fa0; text-decoration: none; }
a:hover { text-decoration: underline; color: #0d3b6e; }

/* ===== Grade Tooltip ===== */
.grade-tip { position: relative; cursor: pointer; }
.grade-tip .tip-box {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 20;
  background: #ffffee;
  border: 1px solid #999;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  text-align: left;
}
.grade-tip:hover .tip-box { display: block; }

/* ===== Notes ===== */
.notes {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 12px;
  color: #555;
  line-height: 1.8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2d44 100%);
  color: #a0b4c8;
  text-align: center;
  padding: 20px 24px;
  margin-top: 32px;
  font-size: 12px;
}
.site-footer nav {
  margin-bottom: 8px;
}
.site-footer nav a {
  color: #a0b4c8;
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.2s;
}
.site-footer nav a:hover { color: #fff; }
.site-footer .copyright {
  color: #6a7a8a;
  font-size: 11px;
}

/* ===== Legal Pages (disclaimer / privacy) ===== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.legal-content h2 {
  font-size: 22px;
  color: #1a2a3a;
  border-bottom: 3px solid #1b2d44;
  padding-bottom: 8px;
  margin-bottom: 24px;
}
.legal-content h3 {
  font-size: 16px;
  color: #1b2d44;
  margin: 24px 0 8px;
  padding-left: 12px;
  border-left: 4px solid #2a6496;
}
.legal-content p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}
.legal-content ul {
  margin: 8px 0 16px 24px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}
.legal-content .updated {
  text-align: right;
  font-size: 12px;
  color: #888;
  margin-top: 32px;
}
.legal-content .back-link {
  display: inline-block;
  margin-top: 24px;
  color: #1a5fa0;
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header { padding: 20px 16px 18px; }
  .site-header h1 { font-size: 20px; }
  .filter-box { padding: 10px 12px; }
  .filter-box .filter-row { flex-direction: column; }
  .filter-box .filter-label { min-width: auto; margin-bottom: 2px; }
  .site-main { padding: 12px 8px 24px; }
  .legal-content { padding: 20px 16px 32px; }
}
