* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --bg2:       #181c27;
  --bg3:       #1e2333;
  --border:    #2a2f42;
  --text:      #e8eaf0;
  --muted:     #7b82a0;
  --accent:    #6c8fff;
  --accent-h:  #8ba3ff;
  --gold:      #c9a84c;
  --read-bg:   #12161f;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px 24px;
  min-height: 100vh;
}

.container {
  max-width: 580px;
  margin: 0 auto;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.header-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(108,143,255,0.3));
}

.header-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #e8eaf0 30%, #6c8fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.header-owner {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.header-count {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
}

.header-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 9px 12px;
  background: var(--bg2);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

/* ── Search ── */
.search-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.5;
}

.search-input-wrap input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  background: #ffffff;
  border: 1.5px solid #ffffff;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #111111;
  outline: none;
  transition: border-color 0.2s;
  caret-color: #000000;
  caret-width: 3px;
}

.search-input-wrap input::placeholder {
  color: #999;
}

.search-input-wrap input:focus {
  border-color: var(--accent);
  background: #ffffff;
}

.search-box button {
  align-self: flex-end;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.search-box button:hover { background: var(--accent-h); }
.search-box button:active { transform: scale(0.97); }
.search-box button:disabled { opacity: 0.5; cursor: default; }

/* ── Checkbox ── */
.checkboxes {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}

.show-read-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.show-read-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Parsed info ── */
.parsed-info {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 7px 12px;
  background: var(--bg2);
  border-radius: 8px;
}
.parsed-info.hidden { display: none; }

/* ── Results ── */
.results-summary {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.results-summary.hidden { display: none; }

.results { display: flex; flex-direction: column; gap: 10px; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Book card ── */
.book-card {
  background: var(--bg2);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.book-card:hover {
  border-color: var(--accent);
  background: var(--bg3);
}

.book-card.book-read {
  background: var(--read-bg);
  border-color: var(--border);
  opacity: 0.65;
}

.read-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
  font-weight: 500;
}

.book-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.3;
}

.book-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.book-meta .genre-tag {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--accent);
}

.book-summary {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #a0a8c0;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 9px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.book-link:hover {
  background: var(--accent);
  color: #fff;
}
