:root {
  --bg-page: #f3f5fb;
  --bg-card: #ffffff;
  --line: #e6e9f2;
  --text-main: #252b3a;
  --text-sub: #697589;
  --blue: #4968f5;
  --blue-bg: #e8edff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  background: var(--bg-page);
}

.max-wrap {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
}

.top-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.theme-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.theme-item {
  padding: 8px 6px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-main);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.theme-item:hover {
  color: var(--blue);
}

.theme-item.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.brand {
  color: var(--text-main);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.search-box input {
  width: 252px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 14px;
}

.layout {
  margin-top: 18px;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.main-panel {
  padding: 24px 34px;
  width: 100%;
}

.filters {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  width: 100%;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-label {
  width: 42px;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 34px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  flex: 1;
  min-width: 0;
}

.chip {
  min-height: 34px;
  border: 0;
  border-radius: 17px;
  padding: 0 14px;
  font-size: 15px;
  line-height: 1;
  color: var(--text-main);
  background: transparent;
  cursor: pointer;
}

.chip:hover {
  background: #f4f6fd;
}

.chip.is-active {
  color: var(--blue);
  background: var(--blue-bg);
}

.chip-empty {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--text-sub);
  font-size: 14px;
}

.result-meta {
  margin-top: 14px;
  color: var(--text-sub);
  font-size: 14px;
}

.book-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.book-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.book-cover {
  width: 106px;
  height: 148px;
  border-radius: 6px;
  border: 1px solid #d8deef;
  background: linear-gradient(140deg, #b0c0f5 0%, #dbe4ff 45%, #f6f8ff 100%);
  box-shadow: 0 8px 20px rgba(67, 102, 211, 0.2);
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-content h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 600;
}

.book-content a {
  color: var(--text-main);
  text-decoration: none;
}

.book-content a:hover {
  color: var(--blue);
}

.book-content p {
  margin: 0 0 8px;
}

.publisher {
  font-size: 14px;
  color: var(--text-sub);
}

.status {
  display: inline-block;
  padding: 5px 10px;
  border: 1px dashed #b9c4ea;
  border-radius: 999px;
  font-size: 12px;
  color: #4f618f;
}

.empty-state {
  margin-top: 12px;
  border: 1px dashed #cdd5ef;
  border-radius: 8px;
  padding: 14px;
  color: var(--text-sub);
  font-size: 13px;
}

.detail {
  margin-top: 18px;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.detail-main {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
}

.detail-main h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.35;
}

.detail-cover {
  width: 180px;
  height: 252px;
}

.geo-answer,
.toc {
  margin-top: 18px;
}

.toc {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  background: #f8f9fc;
}

@media (max-width: 980px) {
  .max-wrap {
    width: calc(100% - 20px);
  }

  .nav-row {
    min-height: 54px;
  }

  .theme-item {
    font-size: 14px;
    padding: 9px 7px;
  }

  .search-box input {
    width: 160px;
    height: 34px;
    font-size: 13px;
  }

  .main-panel {
    padding: 16px 12px;
  }

  .page-title {
    font-size: 28px;
    margin-bottom: 14px;
  }

  .filter-row {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
  }

  .filter-label {
    width: auto;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
  }

  .chip,
  .chip-empty {
    min-height: 32px;
    font-size: 13px;
    padding: 0 10px;
  }

  .result-meta {
    font-size: 12px;
    margin-top: 10px;
  }

  .book-card {
    grid-column: span 1;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .book-cover {
    width: 70px;
    height: 96px;
  }

  .book-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .publisher {
    font-size: 12px;
  }

  .book-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .detail {
    padding: 16px 12px;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    width: 120px;
    height: 168px;
  }
}
