/* 主样式文件 - 参照 h5-web 的样式风格 */
/* 已整合设计系统，参考欧美电子书网站设计规范 */

/* 通用容器 */
.page-container {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-color, var(--color-bg-secondary));
  padding-bottom: 80px; /* 为底部标签栏留出空间 */
}

/* 头部样式 */
.header-box {
  width: 100%;
  height: 56px;
  background: var(--color-bg-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.header-box .logo {
  width: 100%;
  display: flex;
  align-items: center;
}

.header-box .logo img {
  width: 136px;
  height: auto;
}

.header-box .icon-search,
.header-box .icon-vip {
  width: 40px;
  height: 40px;
  margin-left: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-box .icon-search img,
.header-box .icon-vip img {
  width: 22px;
  height: 22px;
}

/* 标题样式 */
.title-box {
  padding: 0 var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-lg);
  margin-top: var(--spacing-lg);
}

.title-box p {
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  line-height: var(--line-height-tight);
  position: relative;
}

.title-box .title_bg {
  position: absolute;
  bottom: -4px;
  left: -3px;
  width: 60px;
  height: auto;
}

.title-box .right {
  display: flex;
  align-items: center;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  line-height: var(--line-height-normal);
  height: 30px;
  cursor: pointer;
  gap: var(--spacing-xs);
  transition: all var(--transition-fast);
}

.title-box .right:hover {
  opacity: 0.8;
}

.title-box .right img {
  margin-left: 3px;
  width: 12px;
  height: 12px;
}

/* 书籍列表样式 */
.book-item {
  width: 100%;
  display: flex;
  align-items: stretch;
  margin-bottom: var(--spacing-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

/* 书籍卡片用 <a class="book-item"> 暴露 SEO 链接时，去掉默认链接样式 */
a.book-item {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.book-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-item:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
  opacity: 0.9;
}

.book-item > img {
  height: 146px;
  width: 109px;
  max-width: 109px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.book-item .right {
  margin-left: 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-item .right p:nth-child(1) {
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-item .right p:nth-child(2) {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-base);
  color: var(--color-text-tertiary);
  line-height: var(--line-height-normal);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: var(--spacing-sm);
}

.books_tag_box {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.books_tag_box .tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-primary-alpha-10);
  border-radius: var(--radius-lg);
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  line-height: var(--line-height-normal);
  transition: all var(--transition-fast);
}

.books_tag_box .tag:hover {
  background: var(--color-primary-alpha-05);
  transform: scale(1.02);
}

/* 横向滚动书籍列表 */
.list_item_box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-3xl);
  gap: var(--spacing-md);
  padding: 0 var(--spacing-lg);
}

.list_item_box .book-item {
  flex: 0 0 calc((100% - 2 * 12px) / 3);
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}

.list_item_box .book-item > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.list_item_box .book-item .right {
  margin-left: 0;
  margin-top: 12px;
  width: 100%;
}

.list_item_box .book-item .right p {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  text-align: center;
}

/* 底部标签栏 */
.tabBar_box {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 450px;
  height: 60px;
  background: var(--color-bg-primary);
  display: flex;
  justify-content: space-between;
  padding: 9px 52px;
  border-top: 1px solid var(--color-border-light);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  z-index: var(--z-index-fixed);
}

/* 桌面端底部标签栏调整 */
@media screen and (min-width: 768px) {
  .tabBar_box {
    max-width: 1200px;
  }
}

.tabBar_item {
  display: flex;
  flex-direction: column;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
}

.tabBar_item:active {
  transform: scale(0.95);
}

.tabBar_item img {
  width: 30px;
  height: 30px;
}

.tabBar_item span {
  font-size: var(--font-size-xs);
  margin-top: var(--spacing-xs);
}

.tabBar_item span.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* 空状态 */
.empty-box {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-5xl) var(--spacing-xl);
  text-align: center;
}

.empty-box img {
  width: 120px;
  height: 120px;
  opacity: 0.6;
  margin-bottom: var(--spacing-lg);
}

.empty-box p {
  margin-top: var(--spacing-lg);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-md);
  color: var(--color-text-tertiary);
  line-height: var(--line-height-relaxed);
  text-align: center;
}

/* 按钮样式 */
.btn {
  padding: var(--spacing-md) var(--spacing-xl);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-lighter) 100%);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  color: var(--color-bg-primary);
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  min-height: 44px;
}

.btn:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-light) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
  opacity: 0.9;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-full {
  width: calc(100% - var(--spacing-3xl));
  margin: var(--spacing-lg);
}

/* 卡片样式 */
.card {
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 输入框样式 */
.input {
  width: 100%;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  padding: 0 var(--spacing-lg);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  outline: none;
  transition: all var(--transition-base);
}

.input:focus {
  background: var(--color-bg-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-10);
}

.input::placeholder {
  color: var(--color-text-quaternary);
}

/* 列表项样式 */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background var(--transition-base);
  min-height: 44px;
}

.list-item:active {
  background: var(--color-bg-tertiary);
}

.list-item-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-item-title {
  flex: 1;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.list-item-arrow {
  width: 15px;
  height: 15px;
  opacity: 0.3;
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-base);
  gap: var(--spacing-md);
}

.loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-medium);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 返回按钮 */
.come-back {
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin-right: 12px;
}

