:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f1ef;
  --text: #1d2125;
  --muted: #59616a;
  --border: #d8dbdd;
  --accent: #2563c9;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --surface-2: #25292e;
    --text: #e6e8ea;
    --muted: #a0a8b0;
    --border: #353a40;
    --accent: #7aa7f5;
    --on-accent: #0f1a2e;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 3px; }

/* ---- トップページ ---- */

.landing main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100%;
  padding: 16px;
}

.intro {
  margin: 0 0 8px;
  font-size: 1.2rem;
  text-align: center;
}

.button {
  display: inline-block;
  min-width: 200px;
  padding: 14px 32px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.secondary { background: transparent; color: var(--accent); }

/* ---- 読書リスト（build-books.mjs が作るページ） ---- */

.books-header,
.books main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
.books-header { padding-top: 16px; }
.books-header h1 { margin: 8px 0 0; font-size: 1.5rem; line-height: 1.4; }
.back { display: inline-block; padding: 8px 0; font-weight: 600; text-decoration: none; }
.books-desc { margin: 4px 0 0; color: var(--muted); }
.books-count { margin: 8px 0 16px; color: var(--muted); font-size: 0.9rem; }

.book-list { list-style: none; margin: 0; padding: 0 0 48px; display: grid; gap: 10px; }

.book {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.book > summary {
  display: block;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.book > summary::-webkit-details-marker { display: none; }
.book-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.book-meta { display: block; color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.book[open] > summary { border-bottom: 1px solid var(--border); }

.book-props {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 16px;
  margin: 0;
  padding: 12px 14px;
  font-size: 0.9rem;
}
.book-props dt { color: var(--muted); }
.book-props dd { margin: 0; overflow-wrap: anywhere; }

.book-notes { padding: 0 14px 12px; overflow-wrap: anywhere; }
.book-notes h3 {
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.book-notes p { margin: 0 0 10px; }
.book-notes ul { margin: 0 0 10px; padding-left: 1.4em; }
.book-notes blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.book-notes details {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-2);
}
.book-notes details > summary { cursor: pointer; font-weight: 600; }
.book-notes details[open] > summary { margin-bottom: 6px; }
