/* BookDetailComponent专用样式 */

/* 章节网格布局 */
.chapters-grid {
  display: block;
  width: 100%;
  padding: 0.5rem;
  max-height: 600px;
  overflow-y: auto;
}

.chapters-grid > * {
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* PC端章节卡片样式 - 增强区别 */
.pc-chapter-card {
  position: relative;
  overflow: visible;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 120px; /* 确保PC端卡片有足够的高度 */
}

.pc-chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 16px 0 0 16px;
}

.pc-chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.2);
}

.pc-chapter-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.pc-chapter-info {
  flex: 1;
  min-width: 0;
}

.pc-chapter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.pc-chapter-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1f2937;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.pc-chapter-card:hover .pc-chapter-title {
  color: #3b82f6;
}

.pc-word-count {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #6b7280;
  font-size: 0.75rem;
  background: #f9fafb;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  margin-top: 0.5rem;
  width: fit-content;
}

/* 章节编号样式 */
.chapter-number {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  position: relative;
  overflow: hidden;
  min-width: 2.5rem;
  text-align: center;
}

.chapter-number::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.pc-chapter-card:hover .chapter-number::before {
  left: 100%;
}

/* 付费标签样式 - 统一设计 */
.chapter-status-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.chapter-badge-paid {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chapter-badge-paid:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.chapter-badge-free {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chapter-badge-free:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 移动端付费标签调整 */
@media screen and (max-width: 767px) {
  .chapter-status-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.675rem;
    gap: 0.25rem;
  }
}

/* 章节按钮样式 */
.chapter-read-btn {
  flex: 1;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chapter-read-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.chapter-login-btn {
  flex: 1;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(107, 114, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.chapter-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(107, 114, 128, 0.35);
  background: linear-gradient(135deg, #4b5563, #374151);
}

/* 响应式布局控制 - 统一为列表布局 */
@media screen and (max-width: 767px) {
  /* 移动端：隐藏PC布局，显示移动布局 */
  .pc-chapter-list {
    display: none !important;
    visibility: hidden !important;
  }
  
  .mobile-chapter-list {
    display: block !important;
    visibility: visible !important;
    max-height: 450px;
    overflow-y: auto;
    padding-bottom: 0.5rem;
  }
}

@media screen and (min-width: 768px) {
  /* PC端：显示PC布局，隐藏移动布局 */
  .pc-chapter-list {
    display: block !important;
    visibility: visible !important;
    max-height: 600px;
    overflow-y: auto;
    padding: 0.5rem 0;
  }
  
  .mobile-chapter-list {
    display: none !important;
    visibility: hidden !important;
  }
}

/* PC端章节列表样式 - 简化版 */
.pc-chapter-item {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.pc-chapter-item:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 移动端章节列表样式 - 简化版 */
.mobile-chapter-list .chapter-item {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.375rem;
  transition: all 0.2s ease;
}

.mobile-chapter-list .chapter-item:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 滚动条样式 */
.chapter-list-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.chapter-list-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.chapter-list-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.chapter-list-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.chapter-list-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.7);
}

/* line-clamp 工具类 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chapter-card {
  animation: fadeInUp 0.3s ease-out;
}

/* 书籍封面样式 */
.book-cover {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.8s ease;
}

.book-cover:hover::before {
  transform: translateX(100%);
}