/* serinreader.com/library: 書籍管理 (members). On top of style.css (the upload page's look). */
:root {
  --warn-soft: #fff4dc;
  --warn: #8a5a00;
  --bad-soft: #fff6f4;
  --bad-line: #f1c6c0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn-soft: #3a2f16;
    --warn: #f3c66b;
    --bad-soft: #34201d;
    --bad-line: #5c2c26;
  }
}
main.wide { max-width: 52rem; }
.top { max-width: 52rem; }
.foot { max-width: 52rem; }
.ok { color: var(--ok); font-weight: 600; }

.syncline { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 10px; }
.failed { background: var(--bad-soft); border-color: var(--bad-line); box-shadow: none; display: flex; gap: 6px 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.failed p { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.tools { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 8px; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.field.grow { flex: 1 1 14rem; }
.field input, .field select, .editor input, .editor select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--card);
  border: 1px solid var(--outline); border-radius: 14px; padding: 8px 12px; min-height: 44px; width: 100%;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field select { min-width: 8.5rem; }
.field input:focus, .field select:focus, .editor input:focus, .editor select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.books { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.book {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 18px;
  display: grid; gap: 8px; min-width: 0;
}
/* On its way out: the book fades, the line saying so (and its 收回) stays readable. */
.book.leaving > :not(.pending) { opacity: 0.6; }
.book .head { display: flex; gap: 4px 10px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.book .name { font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.book .author { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.book .meta { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--body); font-size: 0.9rem; }
.bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 22rem; }
.bar span { display: block; height: 100%; background: var(--bar); border-radius: 999px; }
.chip {
  display: inline-block; border-radius: 999px; padding: 0 10px; font-size: 0.82rem; line-height: 1.8;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; overflow-wrap: anywhere;
}
.chip.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.pending {
  display: flex; gap: 6px 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--warn-soft); color: var(--warn); border-radius: 14px; padding: 8px 12px; font-size: 0.9rem; font-weight: 700;
}
.pending span { overflow-wrap: anywhere; min-width: 0; }
.actions { display: flex; gap: 6px 8px; flex-wrap: wrap; }
.pill {
  font: inherit; font-size: 0.92rem; font-weight: 700; border-radius: 999px; padding: 6px 16px; min-height: 40px;
  border: 1px solid var(--outline); background: var(--card); color: var(--ink); cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.pill:hover { background: var(--tile); }
.pill:focus-visible { border-color: var(--accent); }
.pill.primary { background: var(--pill); color: var(--on-pill); border-color: var(--pill); }
.pill.danger { background: var(--bad); color: var(--on-bad); border-color: var(--bad); }
.pill.primary:hover, .pill.danger:hover { opacity: 0.88; }
.pill.quiet { color: var(--bad); }
.pill:disabled { opacity: 0.5; cursor: default; }
.editor { display: grid; gap: 8px; background: var(--ground); border-radius: 16px; padding: 12px 14px; }
.editor label { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--muted); }
.editor .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.confirm p { margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.book .error { margin: 0; font-size: 0.9rem; }
