* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #222; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin-bottom: 2px; }
.subtitle { color: #666; margin-bottom: 20px; font-size: 14px; }

.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 2px solid #ddd; border-radius: 8px; font-size: 16px; outline: none; min-width: 0; }
.search-bar input:focus { border-color: #2563eb; }
.search-bar button { padding: 10px 20px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; white-space: nowrap; }
.search-bar button:hover { background: #1d4ed8; }

#search-status { color: #666; margin-bottom: 10px; font-size: 13px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 24px; }
table { width: 100%; min-width: 600px; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
th, td { padding: 8px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid #eee; }
th { background: #fafafa; font-weight: 600; color: #555; white-space: nowrap; }
th:last-child, td:last-child { text-align: center; padding-right: 12px; }

.book-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-link { color: #2563eb; text-decoration: none; }
.title-link:hover { text-decoration: underline; }

.fmt { text-transform: uppercase; font-weight: 500; white-space: nowrap; }
.pub { font-size: 11px; color: #666; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sz { white-space: nowrap; color: #666; font-size: 12px; }
.src { font-size: 11px; white-space: nowrap; }
.dl-info-http { color: #16a34a; }
.dl-info-browser { color: #b45309; }
.dl-info-none { color: #9ca3af; }

.dl-btn { padding: 5px 10px; background: #2563eb; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; min-width: 70px; white-space: nowrap; }
.dl-btn:hover { background: #1d4ed8; }
.dl-btn:disabled { background: #999; cursor: default; }
.dl-progress { background: #f59e0b !important; }
.dl-done { background: #16a34a !important; }
.dl-fail { background: #dc2626 !important; }
.dl-aa { background: #6b7280 !important; text-decoration: none; display: inline-block; text-align: center; }
.dl-aa:hover { background: #4b5563 !important; }

h2 { font-size: 18px; margin-bottom: 10px; }

.job-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #fff; border-radius: 6px; margin-bottom: 6px; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.05); flex-wrap: wrap; }
.job-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 100px; }
.job-status { font-weight: 500; font-size: 12px; }
.status-done { color: #16a34a; }
.status-failed { color: #dc2626; }
.status-downloading { color: #2563eb; }
.status-scraping { color: #9333ea; }
.status-queued { color: #888; }
.job-progress { color: #2563eb; font-weight: 600; font-size: 12px; }
.job-dl { color: #16a34a; font-weight: 600; text-decoration: none; font-size: 12px; }
.job-dl:hover { text-decoration: underline; }
.job-error { color: #dc2626; font-size: 11px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-aa { color: #2563eb; font-size: 11px; text-decoration: none; white-space: nowrap; }
.job-aa:hover { text-decoration: underline; }

.empty { color: #999; font-style: italic; font-size: 13px; }


/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.page-btn { padding: 6px 14px; background: #f0f0f0; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; font-size: 13px; }
.page-btn:hover { background: #e0e0e0; }
.page-info { font-size: 13px; color: #666; }

/* Mobile adjustments */
@media (max-width: 640px) {
  .container { padding: 10px; }
  h1 { font-size: 18px; }
  .search-bar { flex-direction: column; }
  .search-bar button { width: 100%; }
  th, td { padding: 6px 8px; font-size: 12px; }
  .book-title { max-width: 140px; }
  .pub { display: none; }
  .job-row { gap: 6px; padding: 6px 10px; }
}
