/* ==================== 
   起点中文网风格样式
   ==================== */

/* 通用工具类 */
.hidden { display: none !important; }

/* 桌面端隐藏移动端元素 */
.hamburger-btn,
.mobile-search-btn {
  display: none;
}

/* 移动端隐藏桌面搜索框（在768px以下） */

/* CSS变量 */
:root {
  --primary-color: #bf2c24;
  --primary-hover: #a5251e;
  --secondary-color: #3f5a93;
  --bg-color: #f7f5f0;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e0ddd5;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --header-height: 60px;
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'LXGW WenKai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==================== 
   头部导航
   ==================== */
.header {
  background: linear-gradient(135deg, #bf2c24 0%, #d4534b 100%);
  box-shadow: 0 2px 10px rgba(191, 44, 36, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-item {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 4px 4px 4px 16px;
  width: 280px;
  transition: var(--transition);
}

.search-box:focus-within {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--secondary-color);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.search-btn:hover {
  background: #2d4570;
}

.upload-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.upload-btn:hover {
  background: rgba(255,255,255,0.3);
}

.admin-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  transition: var(--transition);
}

.admin-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
}

/* ==================== 
   主要内容区
   ==================== */
.main-content {
  padding-top: var(--header-height);
  min-height: 100vh;
  min-height: 100dvh;
}

/* 轮播横幅 */
.hero-banner {
  background: linear-gradient(135deg, #3f5a93 0%, #5a7ab8 50%, #7a9ad8 100%);
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-size: 42px;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-content p {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
}

/* 书籍区域 */
.books-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-left: 16px;
}

.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 2px;
}

.view-toggle {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
  transition: var(--transition);
}

.toggle-btn:hover,
.toggle-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* 书籍网格 */
.books-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.books-grid.list-view {
  grid-template-columns: 1fr;
}

/* 作者网格容器 */
.author-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

/* 作者页面 - 选中作者的书籍列表区 */
.author-books-area {
  margin-top: 8px;
}

#authorBooksContainer {
  margin-top: 16px;
}

#authorPagination {
  margin-top: 16px;
}

/* 作者网格项（列表样式） */
.author-grid-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.author-grid-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.author-grid-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3f5a93, #5a7ab8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-grid-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar-letter {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.author-grid-info {
  flex: 1;
  min-width: 0;
}

.author-grid-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-grid-count {
  font-size: 11px;
  color: var(--text-muted);
}

.author-grid-arrow {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.author-grid-item:hover .author-grid-arrow {
  color: var(--primary-color);
}

/* 书籍卡片 */
.book-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.book-cover {
  position: relative;
  padding-top: 140%;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  overflow: hidden;
}

.book-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.book-card:hover .book-cover img {
  transform: scale(1.05);
}

.book-cover-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 48px;
}

.vip-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.book-info {
  padding: 16px;
}

.book-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-author {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.book-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.book-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(191, 44, 36, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(191, 44, 36, 0.15);
}

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.book-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-color);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* 列表视图样式 */
.books-grid.list-view .book-card {
  display: flex;
  padding: 16px;
}

.books-grid.list-view .book-cover {
  width: 120px;
  padding-top: 0;
  height: 168px;
  border-radius: 8px;
  flex-shrink: 0;
}

.books-grid.list-view .book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.books-grid.list-view .book-title {
  font-size: 18px;
  white-space: normal;
  margin-bottom: 8px;
}

.books-grid.list-view .book-author {
  font-size: 14px;
}

.books-grid.list-view .book-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
}

/* ==================== 
   分类
   ==================== */
/* 作者列表容器（与首页books-grid宽度一致） */
.author-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 分类/系列卡片网格 */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.category-card:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(191,44,36,0.08), rgba(191,44,36,0.03));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(191,44,36,0.15);
}

.category-card.active {
  background: linear-gradient(135deg, var(--primary-color), #c73e36);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(191,44,36,0.35);
}

.category-card.active .cat-name {
  color: #fff;
}

.category-card.active .cat-count {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
}

.cat-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(191,44,36,0.1);
  border-radius: 50%;
  flex-shrink: 0;
}

.category-card.active .cat-icon {
  background: rgba(255,255,255,0.2);
}

.cat-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ==================== 
   排行榜
   ==================== */
.rank-tabs {
  display: flex;
  gap: 8px;
}

.rank-tab {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.rank-tab.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.rank-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}

.rank-number {
  width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-cover {
  width: 48px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-cover .book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 20px;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-author {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rank-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 详情页标签 */
.detail-series {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.detail-series a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.detail-series a:hover {
  text-decoration: underline;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.detail-tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(191, 44, 36, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(191, 44, 36, 0.2);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.detail-tag:hover {
  background: var(--primary-color);
  color: #fff;
}

.author-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
}

.author-link:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

/* ==================== 
   模态框
   ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease;
}

.modal-large {
  max-width: 700px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(191, 44, 36, 0.02);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-area p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.select-file-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.select-file-btn:hover {
  background: var(--primary-hover);
}

.upload-progress {
  padding: 16px 0;
}

.upload-progress.hidden {
  display: none;
}

/* 批量上传进度列表 */
.batch-progress-list {
  max-height: 360px;
  overflow-y: auto;
}

.batch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.batch-item:last-child {
  border-bottom: none;
}

.batch-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  margin-right: 12px;
}

.batch-status {
  flex-shrink: 0;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.batch-status.pending {
  color: var(--text-muted);
  background: #f0f0f0;
}

.batch-status.uploading {
  color: #e67e22;
  background: #fef3e2;
}

.batch-status.success {
  color: #27ae60;
  background: #e8f8f0;
}

.batch-status.error {
  color: #e74c3c;
  background: #fde8e8;
}

.batch-status.skipped {
  color: #95a5a6;
  background: #f5f5f5;
}

/* 书籍详情 */
.book-detail {
  display: flex;
  gap: 24px;
}

.book-detail-cover {
  width: 180px;
  flex-shrink: 0;
}

.book-detail-cover img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.book-detail-info {
  flex: 1;
}

.book-detail-info h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.book-detail-info .author {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 15px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-meta .detail-likes {
  color: #e74c3c;
}

.book-detail-info .description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  font-size: 14px;
}

.book-detail-actions {
  display: flex;
  gap: 12px;
}

.book-detail-actions .btn {
  padding: 12px 32px;
  font-size: 15px;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: 2px solid #e0ddd5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
}

.like-btn:hover {
  border-color: #e74c3c;
  background: #fff5f5;
}

.like-btn.liked {
  border-color: #e74c3c;
  background: #fff0f0;
}

.like-icon {
  font-size: 18px;
}

.like-count {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== 
   底部
   ==================== */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.7);
  padding: 40px 24px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.footer-logo {
  font-size: 24px;
}

.footer-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-info p {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 32px;
  padding: 16px 0;
  width: 100%;
}

.pagination-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.page-btn {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 16px;
  }

  .nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 70px 20px 20px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: left 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
  }

  .nav.open {
    left: 0;
    display: flex;
  }

  .nav-item {
    color: var(--text-primary);
    font-size: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
  }

  .nav-item:hover,
  .nav-item.active {
    color: var(--primary-color);
    background: rgba(191,44,36,0.05);
  }

  .nav-item.active::after {
    display: none;
  }

  /* 汉堡菜单按钮 */
  .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    gap: 5px;
    border-radius: 6px;
    transition: background 0.2s;
  }

  .hamburger-btn:hover {
    background: rgba(255,255,255,0.15);
  }

  .hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* 移动端导航遮罩 */
  .mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    transition: opacity 0.3s ease;
  }

  /* 移动端搜索按钮 */
  .mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    transition: background 0.2s;
  }

  .mobile-search-btn:hover {
    background: rgba(255,255,255,0.25);
  }

  /* 移动端搜索栏 */
  .mobile-search-bar {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 999;
  }

  .mobile-search-bar input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
  }

  .mobile-search-bar input:focus {
    border-color: var(--primary-color);
  }

  .search-box {
    width: 200px;
  }
}

/* 平板：每行3列 */
@media (max-width: 1024px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .author-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .books-section {
    padding: 32px 20px;
  }

  .book-card .book-actions {
    flex-direction: column;
    gap: 4px;
  }

  .book-card .book-actions .btn {
    font-size: 12px;
    padding: 5px 10px;
  }
}

/* 手机：每行2列 */
@media (max-width: 768px) {
  /* 显示移动端专用元素 */
  .hamburger-btn,
  .mobile-search-btn {
    display: flex;
  }

  /* 隐藏桌面搜索框 */
  #desktopSearch {
    display: none;
  }

  /* 压缩用户区域按钮 */
  .user-area {
    gap: 4px;
  }

  .user-area .btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .author-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .author-grid-item {
    padding: 10px 12px;
  }

  .author-grid-avatar {
    width: 38px;
    height: 38px;
  }

  .author-avatar-letter {
    font-size: 15px;
  }

  .author-grid-name {
    font-size: 13px;
  }

  .books-section {
    padding: 24px 16px;
  }
  
  /* 排行榜标签横向滚动 */
  .rank-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    gap: 8px;
  }

  .rank-tabs::-webkit-scrollbar {
    display: none;
  }

  .rank-tab {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 14px;
    white-space: nowrap;
  }
  
  /* 模态框移动端优化 */
  .modal-content {
    max-width: 95%;
    margin: 0 auto;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    animation: slideUp 0.3s ease;
  }

  .modal-small {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .modal {
    align-items: flex-end;
    background: rgba(0,0,0,0.4);
  }

  /* 分类标签优化 */
  .category-grid {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap !important;
    padding-bottom: 8px;
  }

  .category-grid::-webkit-scrollbar {
    display: none;
  }

  .category-card {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 底部优化 */
  .site-footer {
    text-align: left;
    padding-left: 20px;
    padding-right: 20px;
  }

  .footer-brand {
    justify-content: flex-start;
  }
  
  .search-box {
    display: none;
  }
  
  .hero-banner {
    padding: 40px 16px;
  }

  .hero-content h1 {
    font-size: 22px;
  }
  
  .hero-content p {
    font-size: 14px;
  }
  
  .book-detail {
    flex-direction: column;
  }
  
  .book-detail-cover {
    width: 120px;
    margin: 0 auto;
  }

  .header-inner {
    padding: 0 12px;
  }

  .nav {
    gap: 0;
  }

  .nav-item {
    font-size: 12px;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .logo-text {
    font-size: 16px;
  }

  .logo-icon img {
    height: 24px !important;
  }

  .main-content {
    padding-top: 56px;
  }

  .section-header {
    margin-bottom: 16px;
  }

  .section-header h2 {
    font-size: 16px;
  }

  .book-card .book-actions {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
  }

  .book-card .book-actions .btn {
    font-size: 11px;
    padding: 6px 8px;
    width: 100%;
    min-height: 30px;
  }

  .book-card .book-info {
    padding: 10px;
  }

  .book-title {
    font-size: 13px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .book-author {
    font-size: 11px;
    margin-top: 2px;
  }

  .book-tags {
    display: none;
  }

  .book-meta {
    font-size: 11px;
    margin-top: 4px;
  }

  /* 移动端卡片VIP标记 */
  .book-card .vip-badge {
    font-size: 10px;
    padding: 3px 6px;
    top: 6px;
    right: 6px;
  }

  /* 移动端卡片封面加载占位 */
  .book-cover .cover-placeholder {
    font-size: 10px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
  }

  .page-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  .page-info {
    font-size: 12px;
  }

  .footer-inner {
    padding: 0 16px;
  }

  .site-footer {
    padding: 24px 16px 16px;
    margin-top: 24px;
  }

  .rank-item {
    padding: 10px;
    gap: 10px;
  }

  .rank-title {
    font-size: 13px;
  }

  .rank-author {
    font-size: 11px;
  }

  .rank-meta {
    font-size: 11px;
  }

  .category-grid {
    gap: 8px;
  }

  .category-card {
    padding: 6px 12px;
  }

  .cat-icon {
    font-size: 14px;
    width: 24px;
    height: 24px;
  }

  .cat-name {
    font-size: 13px;
  }

  .cat-count {
    font-size: 11px;
    padding: 1px 6px;
  }

  .author-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .author-grid-item {
    padding: 8px 10px;
  }

  .author-grid-avatar {
    width: 34px;
    height: 34px;
  }

  .author-avatar-letter {
    font-size: 14px;
  }

  .author-grid-name {
    font-size: 12px;
  }

  .author-grid-count {
    font-size: 12px;
  }
}

/* 小手机 */
@media (max-width: 480px) {
  .books-grid {
    gap: 8px;
  }

  /* 书籍卡片触摸优化 */
  .book-card {
    min-height: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .book-card:active {
    transform: scale(0.97);
  }

  .book-cover {
    padding-top: 135%;
  }
  
  /* 确保移动端按钮有足够点击区域 */
  .hamburger-btn,
  .mobile-search-btn {
    width: 40px;
    height: 40px;
  }

  .header-actions {
    gap: 6px;
  }

  .author-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .author-grid-item {
    padding: 10px 14px;
  }

  .books-section {
    padding: 16px 10px;
  }

  .book-card .book-info {
    padding: 6px;
  }

  .book-title {
    font-size: 13px;
  }

  .book-author {
    font-size: 12px;
  }

  .book-meta {
    font-size: 12px;
  }

  .hero-banner {
    padding: 28px 12px;
  }

  .hero-content h1 {
    font-size: 18px;
  }

  .hero-content p {
    font-size: 12px;
  }

  .nav-item {
    font-size: 11px;
    padding: 4px 6px;
  }

  .logo-text {
    font-size: 14px;
  }

  .header-inner {
    padding: 0 8px;
  }

  .section-header h2 {
    font-size: 14px;
  }

  .rank-number {
    font-size: 14px;
    min-width: 24px;
  }

  .rank-cover {
    width: 36px;
    height: 48px;
  }
}

/* 极小屏手机 */
@media (max-width: 360px) {
  .books-grid {
    gap: 6px;
  }

  .books-section {
    padding: 12px 8px;
  }

  .book-card .book-info {
    padding: 4px;
  }

  .book-title {
    font-size: 12px;
  }

  .book-author {
    font-size: 11px;
  }

  .book-meta {
    font-size: 11px;
  }

  .book-card .book-actions .btn {
    font-size: 10px;
    padding: 4px 6px;
    min-height: 28px;
  }

  .section-header h2 {
    font-size: 13px;
  }

  .section-header {
    margin-bottom: 10px;
  }

  .logo-text {
    font-size: 13px;
  }

  .header-inner {
    padding: 0 4px;
  }

  .hamburger-btn,
  .mobile-search-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .user-area .btn {
    padding: 4px 6px;
    font-size: 11px;
  }

  .hero-banner {
    padding: 20px 10px;
  }

  .hero-content h1 {
    font-size: 16px;
  }

  .hero-content p {
    font-size: 11px;
  }

  .rank-item {
    padding: 8px;
    gap: 8px;
  }

  .rank-number {
    font-size: 12px;
    min-width: 20px;
  }

  .rank-cover {
    width: 32px;
    height: 42px;
  }

  .rank-title {
    font-size: 12px;
  }

  .rank-author,
  .rank-meta {
    font-size: 10px;
  }

  .category-card {
    padding: 4px 10px;
    font-size: 12px;
  }
}

/* ===== 移动端通用优化 ===== */

/* 禁止长按选择/弹出菜单 */
@media (max-width: 768px) {
  body {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
  }

  /* 所有按钮增加触控反馈 */
  .btn:active,
  .nav-item:active,
  .rank-tab:active,
  .category-card:active,
  .author-grid-item:active,
  .search-result-item:active {
    opacity: 0.7;
    transform: scale(0.97);
  }

  /* 移动端触控目标最小 44px */
  .hamburger-btn,
  .mobile-search-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .search-btn,
  .close-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .page-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .detail-actions .btn {
    min-height: 44px;
  }

  /* 底部安全区域适配 */
  .site-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .modal-content {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  /* 阅读器工具栏安全区域 */
  .reader-header {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .reader-footer {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  /* 移动端导航菜单安全区域 */
  .nav {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  /* 移动端搜索栏 */
  .mobile-search-bar {
    top: 56px;
  }

  /* 页面加载过渡 */
  .main-content {
    animation: fadeIn 0.2s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* 排行榜列表触摸优化 */
  .rank-item:active {
    background: rgba(191,44,36,0.05);
    transform: scale(0.98);
  }

  /* 搜索结果触摸优化 */
  .search-result-item {
    -webkit-tap-highlight-color: transparent;
  }

  .search-result-item:active {
    background: var(--bg-color);
  }

  /* 书籍详情操作按钮触摸优化 */
  .detail-actions .btn:active {
    transform: scale(0.96);
  }
}

/* ===== 用户认证样式 ===== */
.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name-link {
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: inline-block;
}

.user-name-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.user-vip-badge {
  background: linear-gradient(135deg, #ffd700, #ffb800);
  color: #333;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}

/* 小模态框 */
.modal-small {
  max-width: 360px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(191, 44, 36, 0.1);
}

.form-error {
  color: #f44336;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* VIP提示模态框 */
.vip-prompt-content {
  text-align: center;
  padding: 16px 0;
}

.vip-prompt-content .vip-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.vip-prompt-content p {
  font-size: 16px;
  margin-bottom: 8px;
}

.vip-prompt-content .vip-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

.vip-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* ==================== 
   独立书籍详情页
   ==================== */

/* 面包屑导航 */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--secondary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb-sep {
  margin: 0 8px;
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* 书籍详情区域 */
.book-detail-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.detail-loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-error {
  text-align: center;
  padding: 80px 24px;
}

.detail-error-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.detail-error p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* 详情布局 */
.detail-layout {
  display: flex;
  gap: 40px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.detail-cover-col {
  width: 280px;
  flex-shrink: 0;
}

.detail-cover-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.detail-cover-img {
  width: 100%;
  display: block;
}

.detail-cover-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 80px;
}

.detail-vip-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.detail-info-col {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.detail-author {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.detail-author .author-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
}

.detail-author .author-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.detail-desc {
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.detail-desc h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.detail-desc p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 16px;
  border-radius: 8px;
}

/* 推荐区域 */
.recommend-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .detail-layout {
    flex-direction: column;
    padding: 24px;
  }

  .detail-cover-col {
    width: 200px;
    margin: 0 auto;
  }

  .detail-title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .detail-layout {
    padding: 16px;
    gap: 20px;
  }

  .detail-cover-col {
    width: 160px;
  }

  .detail-title {
    font-size: 20px;
  }

  .detail-meta {
    font-size: 13px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .detail-tags {
    gap: 6px;
    flex-wrap: wrap;
  }

  .detail-tag {
    font-size: 11px;
    padding: 3px 10px;
  }

  .detail-actions {
    flex-direction: column;
    gap: 10px;
  }

  .detail-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 15px;
    min-height: 44px;
  }

  .detail-likes {
    font-size: 14px;
  }

  .detail-desc h3 {
    font-size: 16px;
  }

  .detail-desc p {
    font-size: 14px;
    line-height: 1.7;
  }

  .breadcrumb {
    padding: 16px 16px 0;
    font-size: 13px;
  }

  .book-detail-section {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .detail-cover-col {
    width: 140px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-desc p {
    font-size: 14px;
  }
}

/* ==================== 
   搜索结果
   ==================== */
.search-result-count {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  display: flex;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: default;
}

.search-result-item:hover {
  box-shadow: var(--shadow-hover);
}

.search-result-cover {
  width: 100px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  cursor: pointer;
}

.search-result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.search-result-item:hover .search-result-cover img {
  transform: scale(1.05);
}

.search-result-cover .book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 36px;
}

.search-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-result-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.search-result-title:hover {
  color: var(--primary-color);
}

.search-result-author {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.search-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-highlight {
  background: #fff3cd;
  color: #856404;
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.search-result-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
}

.search-result-actions .btn {
  padding: 6px 16px;
  font-size: 12px;
  white-space: nowrap;
}

/* 搜索筛选栏 */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-filter-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.search-filter-select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--card-bg);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.search-filter-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(191, 44, 36, 0.1);
}

.search-loading {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 15px;
}

/* 搜索结果响应式 */
@media (max-width: 768px) {
  .search-result-item {
    flex-direction: column;
    gap: 12px;
  }

  .search-result-cover {
    width: 80px;
    height: 112px;
  }

  .search-result-title {
    font-size: 15px;
  }

  .search-result-actions {
    flex-direction: row;
    gap: 8px;
  }

  .search-filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ==================== 
   评分评论系统
   ==================== */
.review-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.review-section-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-left: 14px;
}

.review-section-header h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 2px;
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-average {
  font-size: 28px;
  font-weight: 700;
  color: #f59e0b;
}

.rating-stars-display {
  display: inline-flex;
  align-items: center;
}

.rating-count {
  font-size: 14px;
  color: var(--text-muted);
}

/* 星级样式 */
.review-stars {
  display: inline-flex;
  gap: 2px;
  color: #f59e0b;
}

.review-stars .star {
  transition: transform 0.15s;
}

.review-stars .star.filled {
  color: #f59e0b;
}

.review-stars .star:not(.filled) {
  color: #ddd;
}

.review-stars[style*="cursor:pointer"] .star:hover {
  transform: scale(1.2);
}

/* 评论表单 */
.review-form {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.review-form-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.review-form-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.review-form-stars label {
  font-size: 14px;
  color: var(--text-secondary);
}

.review-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: var(--transition);
  box-sizing: border-box;
}

.review-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(191, 44, 36, 0.1);
}

.review-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.review-char-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* 验证码样式 */
.review-captcha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f9f9f9;
  border-radius: 8px;
}
.review-captcha label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}
.review-captcha label span {
  font-weight: 600;
  color: #333;
}
.captcha-input {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.password-strength {
  margin-top: 6px;
}
.strength-bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-fill {
  height: 100%;
  width: 0;
  transition: all 0.3s;
  border-radius: 2px;
}
.strength-fill.weak { width: 33%; background: #ff4d4f; }
.strength-fill.medium { width: 66%; background: #faad14; }
.strength-fill.strong { width: 100%; background: #52c41a; }
.strength-text {
  font-size: 12px;
  color: #999;
}
.strength-text.weak { color: #ff4d4f; }
.strength-text.medium { color: #faad14; }
.strength-text.strong { color: #52c41a; }
.review-captcha-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

/* 已评价状态 */
.review-done {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.review-done-stars {
  margin-bottom: 8px;
}

.review-done-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.review-done-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* 评论列表 */
.review-list-header {
  margin-bottom: 16px;
}

.review-list-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.review-item:hover {
  box-shadow: var(--shadow-hover);
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary-color), #5a7ab8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
  min-width: 0;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.review-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-date {
  font-size: 12px;
  color: var(--text-muted);
}

.review-rating {
  margin-bottom: 6px;
}

.review-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.review-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 详情页内评分评论 */
.detail-review-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.detail-review-section .review-section {
  padding: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .review-section {
    padding: 16px;
  }

  .review-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .rating-summary {
    align-self: flex-start;
  }

  .review-form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .review-form-actions .btn {
    width: 100%;
  }

  .detail-review-section {
    padding: 0 16px 24px;
  }
}

/* ==================== 
   推荐系统样式
   ==================== */
.recommend-carousel {
  position: relative;
  overflow: hidden;
}

.recommend-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  display: none;
}

.recommend-row.active {
  display: grid;
}

.recommend-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.recommend-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.recommend-nav-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(191, 44, 36, 0.05);
}

.recommend-dots {
  display: flex;
  gap: 8px;
}

.recommend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.recommend-dot.active {
  background: var(--primary-color);
  width: 24px;
  border-radius: 4px;
}

/* 推荐区域响应式 */
@media (max-width: 1024px) {
  .recommend-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .recommend-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .recommend-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* ==================== 
   分享功能样式
   ==================== */
.share-book-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.share-book-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.share-book-author {
  font-size: 14px;
  color: var(--text-secondary);
}

.share-options {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.share-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.share-option:hover {
  border-color: var(--primary-color);
  background: rgba(191, 44, 36, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.share-option-icon {
  font-size: 32px;
}

.share-option-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.share-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-link-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-color);
  outline: none;
}

.share-link-input:focus {
  border-color: var(--primary-color);
}

.share-link-row .btn {
  flex: 0 0 auto;
  padding: 10px 20px;
  white-space: nowrap;
}

.share-card-preview {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
}

.share-card {
  width: 320px;
  background: linear-gradient(135deg, #bf2c24 0%, #d4534b 50%, #e8796f 100%);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(191, 44, 36, 0.3);
}

.share-card-cover {
  width: 140px;
  height: 186px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background: #fff;
}

.share-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.share-card-info {
  text-align: center;
  color: #fff;
}

.share-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.share-card-author {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.share-card-progress {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 2px;
}

.share-card-site {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
}

/* ==================== 
   阅读时长榜样式
   ==================== */
.reader-rank-item {
  cursor: default;
}

.reader-rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary-color), #5a7ab8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 分享模态框响应式 */
@media (max-width: 768px) {
  .share-options {
    flex-direction: column;
    gap: 10px;
  }

  .share-card {
    width: 260px;
    padding: 16px;
  }

  .share-card-cover {
    width: 100px;
    height: 133px;
  }
}

/* ==================== 
   VIP专区样式
   ==================== */
.vip-banner {
  background: linear-gradient(135deg, #92400e, #d97706, #f59e0b);
  border-radius: 16px;
  padding: 40px 32px;
  margin-bottom: 32px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.vip-banner::before {
  content: '👑';
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 120px;
  opacity: 0.15;
  transform: rotate(15deg);
}

.vip-banner-content h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.vip-banner-content p {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.vip-banner-content .btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  font-size: 15px;
  padding: 10px 28px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.vip-banner-content .btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}
