/* 首页 Banner */
.hero-section {
  padding: 38px 0 26px;
  background:
    radial-gradient(circle at top left, rgba(255, 159, 67, 0.22), transparent 30%),
    linear-gradient(180deg, #fff8f3 0%, #f7f7f7 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 34px;
  align-items: center;
  min-height: 360px;
}

.hero-left {
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  padding: 7px 15px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #fff0e7;
  color: #ff6b35;
  font-size: 14px;
  font-weight: 700;
}

.hero-left h1 {
  margin: 0 0 18px;
  color: #222;
  font-size: 44px;
  line-height: 1.2;
  font-weight: 900;
}

.hero-left p {
  max-width: 620px;
  margin: 0 0 24px;
  color: #666;
  font-size: 16px;
  line-height: 1.9;
}

.search-box {
  display: flex;
  width: 620px;
  max-width: 100%;
  height: 52px;
  padding: 6px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.12);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0 18px;
  font-size: 15px;
  color: #333;
  background: transparent;
}

.search-box button {
  width: 110px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b35, #ff9f43);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #777;
  font-size: 13px;
}

.hero-right {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.featured-card {
  display: flex;
  gap: 20px;
  width: 420px;
  max-width: 100%;
  padding: 22px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(255, 107, 53, 0.16);
  transform: rotate(1deg);
}

.featured-cover {
  width: 140px;
  height: 190px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 159, 67, 0.88));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 24px;
  letter-spacing: 6px;
  font-weight: 800;
  overflow: hidden;
}

.featured-info {
  min-width: 0;
}

.featured-info h3 {
  font-size: 26px;
  margin: 8px 0 10px;
  color: #222;
  font-weight: 900;
}

.featured-info p {
  color: #666;
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 14px;
}

.featured-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #999;
  font-size: 13px;
  margin-bottom: 18px;
}

/* 分类入口 */
.category-section {
  padding: 24px 0 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-title-row h2 {
  margin: 0;
  color: #222;
  font-size: 28px;
  font-weight: 900;
}

.section-title-row a {
  color: #ff6b35;
  font-size: 15px;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.category-item,
.category-card {
  display: block;
  min-height: 132px;
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
  transition: 0.2s;
}

.category-item:hover,
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(255, 107, 53, 0.12);
}

.category-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #fff4ed;
  color: #ff6b35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.category-item h3,
.category-card h3 {
  margin: 0 0 8px;
  color: #222;
  font-size: 20px;
  font-weight: 900;
}

.category-item p,
.category-card p {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* 主体布局 */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
  padding-bottom: 50px;
}

.main-content {
  min-width: 0;
}

.book-section {
  margin-bottom: 34px;
}

/* 小说卡片区域：自动适应，一行能放几个就放几个，但每张卡片保持统一 */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* 小说卡片 */
.book-card {
  height: 210px;
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
  transition: 0.2s;
  overflow: hidden;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}

.book-cover {
  width: 112px;
  height: 148px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff6b35, #ffb35c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 4px;
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
}

.book-info {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.book-info h3 {
  margin: 0 0 6px;
  color: #222;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 900;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-info h3:hover {
  color: #ff6b35;
}

.book-author {
  margin: 0 0 6px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-desc {
  margin: 0 0 8px;
  color: #666;
  font-size: 13px;
  line-height: 1.55;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 28px;
  margin-top: auto;
  margin-bottom: 10px;
  overflow: hidden;
}

.book-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f6f6f6;
  color: #888;
  font-size: 13px;
  white-space: nowrap;
}

.book-stats {
  display: flex;
  gap: 10px;
  color: #999;
  font-size: 12px;
  margin-bottom: 10px;
}

.book-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.book-actions button,
.book-actions a {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.preview-btn {
  min-width: 58px;
  background: #fff5ed;
  color: #ff6b35;
}

.book-actions button {
  min-width: 80px;
  background: #f2f2f2;
  color: #333;
}

.read-btn {
  background: #ff6b35;
  color: #fff;
}

/* 右侧榜单 */
.side-panel {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rank-card {
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rank-header h3 {
  margin: 0;
  color: #222;
  font-size: 20px;
  font-weight: 900;
}

.rank-header span {
  color: #ff9f43;
  font-size: 12px;
  font-weight: 800;
}

.rank-list {
  display: flex;
  flex-direction: column;
}

.rank-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-num {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f1f1f1;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.rank-item:nth-child(1) .rank-num {
  background: #ff6b35;
  color: #fff;
}

.rank-item:nth-child(2) .rank-num {
  background: #ff9f43;
  color: #fff;
}

.rank-item:nth-child(3) .rank-num {
  background: #ffc069;
  color: #fff;
}

.rank-info {
  min-width: 0;
}

.rank-info h4,
.rank-title {
  min-width: 0;
  color: #222;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info p,
.rank-count,
.rank-value {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
}

/* 响应式适配 */
@media (max-width: 1200px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-right {
    justify-content: flex-start;
  }

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

  .side-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}

/* 平板、较窄横屏 */
@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* 手机端 */
@media (max-width: 768px) {
  .hero-section {
    padding: 24px 0 18px;
  }

  .hero-inner {
    display: block;
    min-height: auto;
  }

  .hero-left h1 {
    font-size: 30px;
    line-height: 1.25;
    margin-bottom: 14px;
  }

  .hero-left p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 18px;
  }

  .search-box {
    width: 100%;
    height: 48px;
  }

  .search-box input {
    min-width: 0;
    font-size: 14px;
  }

  .search-box button {
    width: 86px;
    font-size: 14px;
  }

  .hero-tags {
    gap: 8px;
    margin-top: 14px;
  }

  .hero-tags span {
    font-size: 12px;
    padding: 5px 10px;
  }

  .hero-right {
    margin-top: 20px;
  }

  .featured-card {
    width: 100%;
    transform: none;
    gap: 14px;
    padding: 16px;
  }

  .featured-cover {
    width: 105px;
    height: 145px;
    font-size: 20px;
  }

  .featured-info h3 {
    font-size: 24px;
    margin-top: 4px;
  }

  .featured-info p {
    font-size: 13px;
    line-height: 1.7;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .main-layout {
    display: block;
    margin-top: 24px;
  }

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

  .book-card {
    height: auto;
    min-height: 190px;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .book-cover {
    width: 96px;
    height: 132px;
    font-size: 19px;
  }

  .book-info h3 {
    font-size: 20px;
  }

  .book-desc {
    -webkit-line-clamp: 2;
  }

  .side-panel {
    margin-top: 26px;
    display: flex;
  }
}

@media (max-width: 420px) {
  .hero-left h1 {
    font-size: 28px;
  }

  .featured-card {
    align-items: center;
  }

  .featured-cover {
    width: 96px;
    height: 132px;
  }

  .featured-info h3 {
    font-size: 22px;
  }

  .book-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .book-cover {
    width: 92px;
    height: 126px;
  }

  .book-actions {
    gap: 6px;
  }

  .book-actions button,
  .book-actions a {
    padding: 0 11px;
    font-size: 12px;
  }

  .header-actions .register-btn {
    display: none;
  }
}

.hero-tags a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.hero-tags a:hover {
  color: #ff6b35;
}

/* 首页搜索框下方推荐词 */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-tags a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-width: 72px;
  border-radius: 999px;
  background: #fff;
  color: #666;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.hero-tags a:hover {
  color: #ff6b35;
  background: #fff2e8;
  transform: translateY(-1px);
}