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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #f6f8fc 0%, #eef2f8 100%);
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  box-shadow: 0 1px 8px rgba(30, 60, 110, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: #e85d43;
  white-space: nowrap;
}

.logo span { color: #1f2937; font-size: 15px; font-weight: 500; }

.search-bar {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 260px;
}

.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d7dee9;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
  border-color: #e85d43;
  box-shadow: 0 0 0 3px rgba(232, 93, 67, 0.12);
}

.primary-btn {
  background: #e85d43;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.primary-btn:hover { background: #d94f36; }
.primary-btn:active { transform: scale(0.97); }

main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.book-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(30, 60, 110, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 60, 110, 0.12);
}

.cover-wrap { flex-shrink: 0; }

.cover {
  width: 74px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef1f6;
  display: block;
}

.cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa4b2;
  font-size: 12px;
}

.book-body { min-width: 0; }

.book-name {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.book-count {
  font-size: 12px;
  color: #e85d43;
  margin-top: 2px;
}

.book-desc {
  font-size: 12px;
  color: #8a93a2;
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.state {
  padding: 60px 20px;
  text-align: center;
  color: #6b7280;
  font-size: 15px;
}

.state.error { color: #d94f36; }

.detail-header {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(30, 60, 110, 0.06);
}

.back-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 0 12px;
}

.back-btn:hover { color: #e85d43; }

.detail-header h2 { font-size: 22px; margin-bottom: 8px; }

.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #6b7280; }

.detail-desc {
  margin-top: 12px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.7;
}

.download-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.hint { font-size: 12px; color: #9aa4b2; }

.range-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.range-box input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.range-box button {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #1f2937;
}

.range-box button:hover { border-color: #e85d43; color: #e85d43; }

.chapter-header {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 2px;
}

.chapter-item {
  background: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(30, 60, 110, 0.06);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.chapter-item:hover { background: #fdf1ee; color: #e85d43; }

.chapter-item.vip { color: #b0b8c6; }
.chapter-item.vip:hover { color: #d94f36; }

.vip-tag {
  font-size: 10px;
  background: #fff0ed;
  color: #e85d43;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}

.progress { margin: 20px 0 10px; }

.progress-track {
  height: 8px;
  background: #e5e9f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e85d43, #f0a14a);
  border-radius: 99px;
  transition: width 0.3s;
}

.progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}

.foot {
  text-align: center;
  font-size: 12px;
  color: #9aa4b2;
  padding: 24px 16px;
}
