/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #222632;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --border: #2a2e3a;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans",
               "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 80px 0 48px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.tagline {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Sections === */
section {
  margin-bottom: 64px;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

.version {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.9rem;
}

/* === Download Grid === */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.download-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.card-icon {
  color: var(--accent);
  margin-bottom: 12px;
}

.download-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.file-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.dl-icon {
  font-size: 1.1rem;
}

/* === Features === */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.feature-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.feature-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Notes === */
.notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.notes h2 {
  text-align: left;
  margin-bottom: 16px;
}

.notes ul {
  list-style: none;
  padding: 0;
}

.notes li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.notes li:last-child {
  border-bottom: none;
}

.notes li strong {
  color: var(--text);
}

.notes code {
  background: rgba(108, 140, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* === Responsive === */
@media (max-width: 600px) {
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 2rem; }
  .download-grid { grid-template-columns: 1fr; }
}

/* ダウンロード前の確認モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.modal h3 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.modal p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.modal p strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 14px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  justify-content: center;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.modal-actions .btn-primary {
  justify-content: center;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.hidden { display: none; }

/* 期間限定の開放など、ダウンロード前に読ませたい告知 */
.notice {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 auto 24px;
  max-width: 640px;
  text-align: left;
}

.notice p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice strong {
  color: var(--text);
}

.notes p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 14px;
}

.note-caution {
  font-size: 0.82rem;
  opacity: 0.85;
}

/* 評価結果などの表。狭い画面では表だけ横スクロールさせ、本文は折り返す */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 14px;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--text);
  font-weight: 600;
}

.data-table td {
  color: var(--text-muted);
}

.data-table td strong,
.data-table th:first-child {
  color: var(--text);
}

.notes a {
  color: var(--accent);
}

.notes a:hover {
  color: var(--accent-hover);
}

/* 引用（開発のきっかけになった発言など） */
.quote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.95rem;
}

/* AIDB本体へ戻る導線。配布ページはAIDBの一部であって独立サイトではない */
.site-nav {
  padding: 16px 0 0;
  font-size: 0.85rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

footer a {
  color: var(--accent);
}

footer a:hover {
  color: var(--accent-hover);
}

.copyright {
  opacity: 0.7;
}
