* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  color: #222;
  background: #fafafa;
  line-height: 1.5;
}
.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; padding-bottom: 1rem;
}
.site-title { font-weight: 700; text-decoration: none; color: #222; }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.site-header nav a { text-decoration: none; color: #0366d6; }
.user-info { color: #666; font-size: 0.9rem; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: none; padding: 0;
  color: #0366d6; cursor: pointer; font: inherit;
}

main.container { padding-top: 2rem; padding-bottom: 3rem; }

h1 { margin-top: 0; }

.form { display: flex; flex-direction: column; gap: 1rem; max-width: 360px; }
.form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: #333; }
.form input {
  padding: 0.5rem; font-size: 1rem;
  border: 1px solid #ccc; border-radius: 4px;
}
.form button {
  padding: 0.6rem 1rem; font-size: 1rem;
  background: #0366d6; color: #fff; border: none; border-radius: 4px;
  cursor: pointer;
}
.form button:hover { background: #024ea4; }

.error {
  background: #fde2e1; color: #8a1f1c;
  padding: 0.75rem 1rem; border-radius: 4px;
  margin-bottom: 1rem; max-width: 360px;
}

.site-footer { border-top: 1px solid #e5e5e5; margin-top: 2rem; padding: 1rem 0; color: #888; }

/* Page header with action button */
.page-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.button, a.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #0366d6; color: #fff;
  text-decoration: none; border-radius: 4px;
  border: none; font: inherit; cursor: pointer;
}
.button:hover, a.button:hover { background: #024ea4; }

.form.wide { max-width: 560px; }
.form textarea {
  padding: 0.5rem; font-size: 1rem;
  border: 1px solid #ccc; border-radius: 4px;
  font-family: inherit;
}
.form select {
  padding: 0.5rem; font-size: 1rem;
  border: 1px solid #ccc; border-radius: 4px;
  background: #fff;
}
.form small { color: #888; font-size: 0.8rem; }
.form .req { color: #c00; }
.form-actions { display: flex; gap: 1rem; align-items: center; }
.hint { color: #666; font-size: 0.95rem; margin-top: -0.5rem; }

/* Book list */
.book-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}
.book-card a {
  display: block; text-decoration: none; color: inherit;
}
.book-cover {
  display: block; width: 100%; aspect-ratio: 2/3;
  object-fit: cover; border-radius: 4px;
  background: #e5e5e5;
}
.book-cover.placeholder { background: linear-gradient(135deg,#e5e5e5,#cfcfcf); }
.book-cover.large { width: 220px; }
.book-meta { margin-top: 0.5rem; }
.book-title { font-weight: 600; }
.book-lang { color: #888; font-size: 0.85rem; }

/* Book detail (show page) */
.book-detail {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2rem;
}
.book-detail-cover img,
.book-detail-cover .book-cover {
  display: block;
  width: 160px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  background: #e5e5e5;
}
.book-detail-title { margin: 0 0 0.25rem; font-size: 1.5rem; line-height: 1.3; }
.book-detail-authors { margin: 0 0 0.5rem; color: #444; font-size: 1rem; }
.book-detail-lang {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.15rem 0.6rem;
  background: #eef3f8;
  color: #555;
  font-size: 0.8rem;
  border-radius: 999px;
}
.book-detail-actions { margin-top: 1rem; }

.book-meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0;
}
.book-meta-list dt { color: #888; font-size: 0.85rem; }
.book-meta-list dd { margin: 0; font-size: 0.95rem; }

.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card-title { margin: 0 0 0.75rem; font-size: 1.05rem; color: #333; }

.edition-list { list-style: none; padding: 0; margin: 0; }
.edition-list li { padding: 0.25rem 0; }

.reading-form { max-width: none; }
.reading-form input[type="date"] { max-width: 200px; }
.reading-form textarea { width: 100%; }

.back-link { margin-top: 1.5rem; }

@media (max-width: 560px) {
  .book-detail { grid-template-columns: 1fr; gap: 1.25rem; }
  .book-detail-cover img,
  .book-detail-cover .book-cover { width: 140px; }
}

/* Status banner */
.banner {
  padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem;
}
.banner-pending { background: #fff4d1; color: #6b5000; }
.banner-rejected { background: #fde2e1; color: #8a1f1c; }
