:root {
  color-scheme: light dark;
  --bg: #faf8f5;
  --fg: #1c1a17;
  --accent: #a8471e;
  --muted: #7a736a;
  --card: #ffffff;
  --border: #e7e1d8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --fg: #f3efe8;
    --card: #221f19;
    --border: #34302a;
    --muted: #a89f92;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}
header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
h1 { margin-bottom: 0.2rem; }
.subtitle { color: var(--muted); margin-top: 0; }
input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--fg);
  font-size: 1rem;
}
#filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
#filter-bar select,
#filter-bar input {
  flex: 1 1 140px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--fg);
  font-size: 0.9rem;
}
#filter-bar button { flex: 0 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.8rem 1rem;
  margin-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.card .meta { color: var(--muted); font-size: 0.85rem; }
.card-info { flex: 1; min-width: 0; }
.cover-thumb {
  width: 40px;
  height: 58px;
  object-fit: cover;
  border-radius: 0.2rem;
  flex-shrink: 0;
  background: var(--border);
}
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.detail-cover {
  max-width: 160px;
  border-radius: 0.4rem;
  float: right;
  margin: 0 0 1rem 1rem;
}
.detail-meta-table { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 1rem; }
.detail-meta-table div { margin: 0.1rem 0; }
#detail-description { clear: both; }
.buy-links { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.buy-link {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.price { font-weight: 600; white-space: nowrap; }
.price.on-sale { color: var(--accent); }
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
section { margin-top: 1.5rem; }
footer { color: var(--muted); font-size: 0.8rem; }
