/* ==============================
   老鱼笔记 - 全局样式
   完整修复版：PC/手机端适配 + 所有问题修复
   ============================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f5f5;
  font-family: "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* 主容器：PC端固定400x800，手机端全宽 */
.container {
  width: 100%;
  max-width: 400px;
  height: 800px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

/* 顶部Logo区域 */
.fixed-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  z-index: 1000;
  padding: 12px 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
}

.header {
  text-align: center;
  padding: 12px 0;
}
.logo {
  width: 120px;
  height: auto;
  max-width: 100%;
}

/* 横幅广告区 */
.banner-slider {
  width: 100%;
  padding: 10px;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* 轮播广告容器 */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.carousel-slide {
  display: none;
  width: 100%;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active {
  background: white;
}

/* 默认广告图样式 */
.banner-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  object-fit: cover;
}

/* 内容区域 */
.content-container {
  position: absolute;
  top: 100px;
  bottom: 60px;
  width: 100%;
  overflow-y: auto;
  padding: 0 10px;
}

/* 书籍列表 */
.book-list {
  padding: 10px;
}

.book-item {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transform: none !important;
  -webkit-transform: none !important;
}

.book-cover {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.book-info h3 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

.desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
  transform: none !important;
  -webkit-transform: none !important;
}

.book-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 12px;
  color: #999;
  background: #f8f8f8;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

.reading-count {
  color: #666;
  white-space: nowrap;
}

.btn-free {
  background: none;
  border: none;
  color: #ff6600;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-free:hover {
  background: rgba(255, 102, 0, 0.05);
}

/* 底部导航栏 */
.fixed-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ff6600;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 14px 0;
  text-align: center;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 未登录时的登录按钮样式 */
.btn-login {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  font-weight: bold;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
  border-radius: 8px;
}
.btn-login:hover {
  opacity: 0.9;
}

/* 登录态导航链接样式 */
.footer-nav a {
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  padding: 6px 12px;
  margin: 0 4px;
  display: inline-block;
  border-radius: 6px;
  transition: background 0.2s;
}
.footer-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 0.9;
}
.footer-nav .separator {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 6px;
}

/* ====== 导航栏样式区分 ====== */
.footer-nav:has(.btn-login) {
  padding: 0;
}
.footer-nav:has(.btn-login) .btn-login {
  width: 100%;
  max-width: 300px;
  background: #ff6600;
  border-radius: 8px;
}
.footer-nav:not(:has(.btn-login)) {
  padding: 14px 0;
}

/* ====== 登录/注册弹窗 ====== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  transform: translateY(-50%) translateX(-50%);
  top: 50%;
  left: 50%;
  position: absolute;
}

/* 适配小屏手机 */
@media (max-width: 375px) {
  .modal-content {
    max-width: 90vw;
    padding: 16px;
  }
}

.modal-content h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  font-size: 20px;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

.modal-content .captcha-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.modal-content .captcha-row input {
  flex: 1;
  margin: 0;
  height: 40px;
}

.modal-content .captcha-row img {
  width: 80px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background: #ff6600;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  cursor: pointer;
  box-sizing: border-box;
}

.modal-content button:hover {
  background: #e05a00;
}

.modal-content a {
  color: #ff6600;
  text-decoration: none;
}

/* ====== 滚动条样式 ====== */
.content-container::-webkit-scrollbar {
  width: 6px;
}
.content-container::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

/* ====== 修复：PC端滚动条 ====== */
.container {
  overflow: hidden;
}
.content-container {
  overflow-y: auto;
}

/* ====== 修复：手机端导航栏样式 ====== */
@media (max-width: 400px) {
  .fixed-footer {
    height: 50px;
    padding: 10px 0;
  }
  .footer-nav a {
    font-size: 16px;
    padding: 4px 8px;
  }
  .footer-nav .separator {
    margin: 0 4px;
  }
  
/* ====== 轮播广告样式 ====== */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.carousel-slide {
  display: none;
  width: 100%;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active {
  background: white;
}
}