:root {
  --bg: #E4F0D8;
  --fg: #010D0B;
  --accent: #d9230f;
}
html, body {
  overflow-x: hidden !important; /* 全局禁止横向滚动 */
  touch-action: pan-y manipulation; /* 允许垂直滚动，同时禁止双击放大 */
}
/* 全局 */
body {
  margin: 0;
   font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background .25s, color .25s;
}
a {
  text-decoration: none;
  color: var(--fg);
}
.card p {
  /* 使用负外边距，让上下间距变为 -5px */
  margin: 10px 0;
}
h3 {
  /* 设置上下边距为 5px，左右为 0 */
  margin: -1px 0;
}
.navbar {
  display: flex;
  justify-content: space-between; /* 左 Logo，右 图标组 */
  align-items: center;
  padding: 0 16px;
  height: 46px;
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);

  /* 固定顶部 */
  position: fixed;
  top: 0;
  left: 0;
  width: 94%;   /* 默认：移动端还是94% */
  z-index: 999;
}

/* PC 宽屏时左右各留 450px */
@media (min-width: 1200px) {
  .navbar {
    left: 450px;
    right: 450px;
    width: auto;   /* 避免和 left/right 冲突 */
  }
}
.navbar .logo {
  font-weight: bold;
  font-size: 1.2em;
  color: var(--fg);
}
.navbar nav a {
  margin: 0 10px;
  color: var(--fg);
}
  .nav-pop .nav-item{display:block;padding:.55rem 1rem;font-size:14px;color:#333;text-decoration:none}
  .nav-pop .nav-item:hover{background:#f5f5f5;}
/* 搜索页头部 */
.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-header .logo {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
}
.search-header nav a {
  margin: 0 12px;
  color: var(--fg);
  font-size: .95rem;
  text-decoration: none;
}
.search-header nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* 搜索框 */
.search-container {
  display: flex;
  justify-content: center;
  padding: 24px 0;
  background: var(--bg);
}
.search-box {
  position: relative;
  width: 100%;
  max-width: 300px;
}
.search-box input {
			margin-top: 40px;

  width: 100%;
  padding: 14px 48px 14px 16px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  box-sizing: border-box;
  transition: border-color .2s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-box button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.search-box button svg {
				margin-top: 40px;

  stroke: var(--accent);
  width: 24px;
  height: 24px;
  animation: search-pulse 1.2s infinite;
}

/* 放大镜脉冲动画 */
@keyframes search-pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.2); opacity: .75; }
  100% { transform: scale(1); opacity: 1; }
}

/* 放大镜图标 */
.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.search-icon svg {
  stroke: var(--accent);
  cursor: pointer;
  animation: search-pulse 1.2s infinite;
  transition: stroke .2s ease, transform .2s ease;
}
.search-icon:hover svg,
.search-icon:focus svg {
  stroke: rgba(217, 35, 15, 0.85);
  transform: scale(1.1);
}
.search-icon:hover {
  background-color: rgba(217, 35, 15, 0.1);
  border-radius: 4px;
}

/* 主区内容 */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 40px;
  background: var(--bg);
  color: var(--fg);
}
main > h2,
.search-title {
  font-size: 1.4rem;
  text-align: center;
  margin-top: 60px;
  margin-bottom: 24px;
  margin-left: 0;
  margin-right: 0;
}
main > h2.hot-novel,
.search-title {
  font-size: 1.4rem;
  text-align: center;
  margin-top: 60px;
  margin-bottom: 24px;
}


/* 网格卡片 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 24px;
}
.card {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.card img {
  width: 100%;
  /* 强制保持 3:4 的长宽比 */
  aspect-ratio: 3 / 4;
  /* 保持封面完整裁切，中间居中 */
  object-fit: cover;
  object-position: center;
}

.card-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-content h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--fg);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-content p {
  margin: 0;
  font-size: .85rem;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 小说详情 */
.novel-detail {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.novel-detail img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}
.novel-detail .info {
  flex: 1;
}

/* 章节列表 */
.chapter-list > .chap {
  padding: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  cursor: pointer;
}

/* 阅读内容 */
.content {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 1rem;
  background: var(--bg);
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}

/* 导航按钮 */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background .2s;
}
button:disabled {
  background: #aaa;
}

/* 分页 */
.pagination {
  margin: 20px 0;
  text-align: center;
}
.pagination button {
  margin: 0 4px;
  padding: 8px 12px;
  font-size: .9rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.pagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.pagination button:hover:not(:disabled) {
  background: rgba(217, 35, 15, .85);
}

/* 登录 / VIP 区通用样式 */
#loginSection,
#vipSection {
  max-width: 400px;
  margin: 40px auto;
  padding: 0 16px;
}
#loginSection h2,
#vipSection h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  text-align: center;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: .95rem;
}
.form-group input,
.renew-group input {
  width: 100%;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  box-sizing: border-box;
  transition: border-color .2s;
}
.form-group input:focus,
.renew-group input:focus {
  outline: none;
  border-color: var(--accent);
}

#loginBtn,
#registerBtn,

#clearCacheBtn,
#renewBtn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.hint {
  margin-top: 12px;
  text-align: center;
  font-size: .9rem;
}
.hint a {
  color: var(--accent);
}
.vip-info {
  text-align: center;
  margin-bottom: 24px;
}
.vip-info p {
  margin: 6px 0;
  font-size: 1rem;
}
.vip-info .expires {
  color: var(--accent);
  font-weight: 600;
}
.renew-group {
  margin-bottom: 16px;
}
.renew-group label {
  display: block;
  margin-bottom: 6px;
  font-size: .95rem;
}
#logoutBtn {
  display: block;
  width: 50%;
  margin: 40px auto 0;
  background: #555;
  padding: 10px;
  font-size: 1rem;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s;
}
#logoutBtn:hover {
  background: #444;
}

/* 公共底部样式（site-footer） */
.site-footer {
  background: var(--bg);
  color: var(--fg);
  border-top: 1px solid #eee;
  padding: 24px 16px;
  margin-top: 40px;
}
.site-footer .footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.site-footer .footer-links a {
  color: var(--fg);
  text-decoration: none;
  font-size: .95rem;
}
.site-footer .footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.site-footer .footer-info {
  text-align: center;
  font-size: .85rem;
  color: #777;
}
.site-footer .footer-info p {
  margin: 4px 0;
}
.site-footer .footer-info a {
  color: #777;
  text-decoration: none;
  font-size: .85rem;
}
.site-footer .footer-info a:hover {
  color: var(--accent);
  text-decoration: underline;
}
@media (min-width: 600px) {
  .site-footer .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .site-footer .footer-links {
    justify-content: flex-start;
  }
}
/* —— 目录里每一行章节 —— */
.chapter {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px dashed rgba(0,0,0,.1);
  font-size: .9rem;
  cursor: pointer;
  color: var(--fg);
}

/* 章节名占据左侧剩余空间 */
.chapter .chapter-name {
  flex: 1;
  /* 如果名称过长，可选加下面两行实现省略号 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 活动状态（当前正在阅读的章）高亮 */
.chapter.active {
  color: var(--accent);
  font-weight: 600;
}

/* VIP 图标固定在最右侧 */
.chapter .vip-icon {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--accent);
}

/* 如果想让图标本身更突出，可加下面几行 */
.chapter .vip-icon:hover {
  transform: scale(1.1);
}
/* 书架的网格：自动填充，最小列宽 150px */
    #shelfGrid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 16px;
      margin-top: 12px;
    }
    /* 最近阅读的网格：固定两列 */
    #historyGrid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      margin-top: 12px;
    }
    /* 空提示文字 */
    .empty-msg {
      color: #777;
      font-size: .95rem;
      padding: 12px;
    }
    /* 同步按钮样式 */
    .sync-buttons {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin: 20px 0;
    }
    .sync-buttons button {
		margin-top: 60px;
      padding: 8px 16px;
      font-size: 1rem;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      background: var(--accent);
      color: #fff;
      transition: background .2s;
    }
    .sync-buttons button:hover {
      background: rgba(217, 35, 15, 0.85);
    }
	.navbar {
    display: flex;
    justify-content: space-between; /* 左 Logo，右 图标组 */
    align-items: center;
    padding: 0 16px;
    height: 46px;
    background: var(--bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }
  .navbar .logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--fg);
    text-decoration: none;
  }
  /* 右侧图标组 */
  .nav-icons {
    display: flex;
    align-items: center;
    gap: 8px; /* 图标间距设为 8px */
  }
  .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
  }
  .nav-icon svg {
    width: 24px;
    height: 24px;
  }
  .nav-icon:hover svg {
    stroke: var(--accent);
  }
  
  /* ===== Skeleton 骨架屏 通用樣式 ===== */
.skeleton {
  width: 100%;
  height: 200px; /* 根據實際區塊調整高度 */
  background: linear-gradient(90deg, #eee 25%, #ddd 40%, #eee 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 專門針對章節列表的骨架：多個項目的占位 */
.chapter-list-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chapter-list-skeleton .line {
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #ddd 40%, #eee 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  width: 80%;
}
 /* 容器：把热门小说卡片布局成网格 */
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 16px;
      margin-top: 16px;
    }

    /* 骨架卡片整体样式 */
    .skeleton-card {
      background: #eee;
      border-radius: 4px;
      overflow: hidden;
    }
    /* 骨架图像区域：宽度100%，填充高度比例约 150% */
    .skeleton-img {
      position: relative;
      width: 100%;
      padding-top: 150%;
      background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
      background-size: 200px 100%;
      animation: shimmer 1.2s infinite;
    }
    /* 骨架文字行 */
    .skeleton-line {
      height: 14px;
      margin: 8px;
      background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
      background-size: 200px 100%;
      animation: shimmer 1.2s infinite;
      border-radius: 4px;
    }
    /* 不同长度的占位行示例 */
    .skeleton-line.short { width: 60%; }
    .skeleton-line.medium { width: 80%; }
    .skeleton-line.long { width: 90%; }

    /** Shimmer 动画关键帧 **/
    @keyframes shimmer {
      0% { background-position: -200px 0; }
      100% { background-position: 200px 0; }
    }
	/* —— 加載中提示的容器 —— */
.loading-container {
  display: flex;               /* 横向排列 spinner + 文字 */
  align-items: center;         /* 垂直居中 */
  justify-content: center;     /* 水平居中 */
  padding: 16px 0;             /* 根据需要上下留白 */
}

/* —— 圆形旋转动画 —— */
.spinner {
  width: 20px;                 /* 圆环直径 */
  height: 20px;
  border: 3px solid var(--accent);      /* 外圈颜色为主色 */
  border-top-color: transparent;        /* 顶部留空，使其能看到旋转效果 */
  border-radius: 50%;         /* 变成圆形 */
  animation: spin 1s linear infinite;  /* 无限匀速旋转 */
  margin-right: 8px;          /* 圆环与文字之间留点距离 */
}

/* 旋转关键帧 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— 「加載中…」文字样式（可根据实际项目微调） —— */
.loading-text {
  font-size: 14px;
  color: var(--fg);           /* 假设有 --fg 变量，文字用前景色 */
}
/* ========== 郵箱後綴自動補全樣式 ========== */
.email-suggestions {
  position: absolute;
  top: calc(100% + 4px);  /* 在輸入框下方略留空白 */
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none; /* 預設隱藏，由 JS 控制顯示 */
}

.email-suggestions li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.email-suggestions li:hover,
.email-suggestions .selected {
  background-color: #f0f0f0;
}
/* 示例 CSS（放在你的 style.css 里或页面 <style> 中） */
.notif-container {
  position: relative;
  display: inline-block;
}
#notifToggleBtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}
.notif-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid #ccc;
  border-radius: 4px;
  display: none; /* 默认隐藏 */
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.notification-item {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}
.notification-item:last-child {
  border-bottom: none;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.notif-title {
  font-weight: bold;
}
.notif-body {
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.notif-actions {
  text-align: right;
}
.ack-btn {
  background: #007bff;
  border: none;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.8rem;
  cursor: pointer;
}
.ack-btn:hover {
  background: #0056b3;
}
.no-notifications {
  padding: 12px;
  text-align: center;
  color: #888;
}

/* 切换面板显示/隐藏 */
.notif-container.open .notif-panel {
  display: block;
}
/* 顶部横幅样式 */
.subscribe-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fffae6;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}
.subscribe-banner button {
  margin-left: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
#subscribeYesBtn {
  background-color: #4caf50;
  color: white;
}
#subscribeNoBtn {
  background-color: #ccc;
  color: #333;
}

/* 通知中心面板样式 */
.notif-container {
  position: relative;
  display: inline-block;
}
#notifToggleBtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}
.notif-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid #ccc;
  border-radius: 4px;
  display: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.notification-item {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}
.notification-item:last-child {
  border-bottom: none;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.notif-title {
  font-weight: bold;
}
.notif-body {
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.notif-actions {
  text-align: right;
}
.ack-btn {
  background: #007bff;
  border: none;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.8rem;
  cursor: pointer;
}
.ack-btn:hover {
  background: #0056b3;
}
.no-notifications {
  padding: 12px;
  text-align: center;
  color: #888;
}
.notif-container.open .notif-panel {
  display: block;
}
   /* 瀑布流 */
    #bookList{column-width:300px;column-gap:1rem;margin:1rem auto;max-width:1100px}

    /* 卡片 */
    .book-card{break-inside:avoid;border:1px solid #e5e5e5;border-radius:8px;background:#fff;
               padding:.9rem;margin:0 0 1rem;font-size:15px;box-shadow:0 1px 4px rgba(0,0,0,.05)}
    .book-card img{width:70px;height:96px;border-radius:4px;object-fit:cover}

    /* 行动按钮（加大字号 & 点击范围） */
    .book-card .actions{display:flex;gap:.9rem;margin-top:.5rem;font-size:16px;color:#444;cursor:pointer}
    .book-card .actions span{display:flex;align-items:center;gap:.25rem;padding:.22rem .55rem;border-radius:18px;
                             transition:.2s}
    .book-card .actions span:hover{background:#f3f3f3}
    .book-card .actions .like.on{color:#ff9a3c;font-weight:700}

    /* 骨架 */
    .sk-card{break-inside:avoid;border:1px solid #eee;border-radius:8px;background:#fafafa;padding:1rem;margin:0 0 1rem}
    .sk-img{width:70px;height:96px;background:#eee;border-radius:4px;margin-bottom:.7rem}
    .sk-line{height:12px;background:#eee;border-radius:4px;margin:.25rem 0}
    .sk-line.long{width:80%}.sk-line.mid{width:60%}.sk-line.short{width:40%}
	.sort-btn{border:none;margin:0 .35rem;padding:.35rem .9rem;border-radius:20px;cursor:pointer;font-size:14px}
    .sort-btn.active{background:#ff9a3c;color:#fff;font-weight:600}
/* ===== User Center：VIP 卡片（轻量） ===== */
.vip_card{
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
  padding:14px;
}
.vip_card_name{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.vip_card_name_left{
  font-weight:700; font-size:1.05rem; color:#222;
}
.vip_card_btn_container{ flex-shrink:0; }
.vip_card_btn{
  border:0; border-radius:999px; padding:8px 16px;
  background: var(--accent); color:#fff; font-weight:700; cursor:pointer;
  transition: background .2s ease;
}
.vip_card_btn:hover{ background: rgba(217,35,15,.9); }
.vip_card_brief{
  margin-top:8px; font-size:.95rem; color:#666;
}
.vip_card_end {
    font-size: 0.875rem;
    color: #B5804E;
}

/* 模态框背景，用于覆盖整个屏幕 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明的黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px); /* 背景模糊效果 */
    transition: opacity 0.3s ease;
}

/* 提示框主体（温馨提示的“外框”） */
.modal-container {
    background-color: rgba(255, 255, 255, 0.95); /* 半透明的白色背景 */
    border: 1px solid #e0e0e0; /* 浅灰色边框 */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* 更柔和的阴影 */
    max-width: 400px; /* 调整了最大宽度，更适合手机和桌面 */
    width: 90%;
    animation: fadeInScale 0.3s ease-out; /* 进入动画 */
    padding: 2px; /* 留出一点空间给里面的内容框 */
}

/* 提示框内容（内层，增加层次感） */
.modal-content {
    background-color: #ffffff; /* 纯白色背景 */
    padding: 32px; /* 内边距 */
    border-radius: 10px; /* 小于外框的圆角，形成嵌套效果 */
    text-align: center;
}

/* 标题 */
.modal-title {
    margin-top: 0;
    font-size: 1.5rem;
    color: #34495e; /* 更深的蓝色，增加稳重感 */
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* 消息内容 */
.modal-message {
    margin: 20px 0;
    font-size: 1rem;
    color: #7f8c8d;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-all;
}

/* 按钮容器 */
.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

/* 按钮基础样式 */
.modal-btn {
    padding: 12px 24px;
    border-radius: 25px; /* 胶囊形状的按钮 */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

/* 主要按钮（继续阅读） */
.modal-btn-primary {
    background-color: #3498db;
    color: #fff;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

/* 次要按钮（取消） */
.modal-btn-secondary {
    background-color: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
}

.modal-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(127, 140, 141, 0.1);
}

/* 动画效果 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.vip_card {
  margin-top: 15px;
    background: linear-gradient( 134deg, #FDDEBF 0%, #FBECDD 50%, #FFC998 100%);
    border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
    height: 6.9375rem;
}

.vip_card_name {
    display: flex;
    padding: 1.0625rem 1.125rem 0 1.125rem;
}

.vip_card_name_left {
    font-weight: bold;
    font-size: 1.0625rem;
    color: #7F4523;
}

.vip_card_btn_container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.vip_card_btn {
    width: 3.875rem;
    height: 1.75rem;
    background: linear-gradient( 90deg, #D8853B 0%, #9E540F 100%);
    border-radius: 5.625rem 5.625rem 5.625rem 5.625rem;
    font-size: 0.875rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip_card_brief {
    margin-top: 0.625rem;
    padding: 0 1.125rem;
    font-size: 0.9375rem;
    color: #854B27;
    line-height: 1.375rem;
}
/* ===== User Center - Stylish Overview ===== */
.uc-title{
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 14px;
}

.uc-hero{
  position: relative;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  background:
    radial-gradient(600px 200px at 100% 0, rgba(217,35,15,.08), transparent),
    linear-gradient(180deg, #fff, #fff);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  color: var(--fg);
}

@media (prefers-color-scheme: dark){
  .uc-hero{
    border-color: rgba(255,255,255,.08);
    background:
      radial-gradient(600px 200px at 100% 0, rgba(217,35,15,.14), transparent),
      linear-gradient(180deg, #14161a, #14161a);
    box-shadow: 0 8px 20px rgba(0,0,0,.28);
  }
}

.uc-hero-row{
	
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

@media (max-width: 520px){
  .uc-hero-row{
    grid-template-columns: auto 1fr;
  }
  .uc-cta{
    grid-column: 1 / -1;
  }
}

/* Avatar with ring */
.uc-avatar{
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; letter-spacing:.5px;
  background: linear-gradient(135deg, #ff7a59, var(--accent));
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  overflow: hidden;
}
.uc-avatar::after{
  content:"";
  position:absolute; inset:-2px;
  border-radius:50%;
  background:
    conic-gradient(from 180deg, rgba(217,35,15,.35), rgba(217,35,15,0) 40%, rgba(0,0,0,0) 70%),
    radial-gradient(40px 20px at 60% 20%, rgba(255,255,255,.35), transparent);
  pointer-events:none;
}

/* Meta */
.uc-meta{ min-width: 0; }
.uc-topline{
  display:flex; align-items:center; gap:8px;
  margin-bottom: 2px;
}
.uc-name{
  font-size: 1.1rem; font-weight: 800;
  max-width: 18ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Chip for VIP/Free */
.uc-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 4px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: rgba(34,197,94,.12); color: #16a34a; /* 默認按 VIP 綠色展示 */
}
.uc-chip.free{ background: rgba(217,35,15,.12); color: var(--accent); }

/* Email line */
.uc-email{
  display:flex; align-items:center; gap:6px;
  color: #666; font-size: .92rem;
}
.uc-email svg{ width: 16px; height: 16px; opacity: .8; }

.uc-exp{
  margin: 6px 0 0;
  font-size: .9rem;
  color: var(--accent);
  font-weight: 600;
}

/* CTA Button */
.uc-cta .uc-btn{
  appearance:none; border:0; cursor:pointer;
  background: linear-gradient(135deg, var(--accent), #ff7a59);
  color:#fff; font-weight: 800; letter-spacing:.2px;
  padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 10px 20px rgba(217,35,15,.2);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}
.uc-cta .uc-btn:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.uc-cta .uc-btn:active{ transform: translateY(0); box-shadow: 0 6px 14px rgba(217,35,15,.2); }

/* Quick links */
.uc-quick{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 520px){
  .uc-quick{ grid-template-columns: repeat(3, 1fr); }
}
.uc-qitem{
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding: 12px 10px; border-radius: 12px; text-decoration:none;
  background: #fff; color: var(--fg);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
@media (prefers-color-scheme: dark){
  .uc-qitem{
    background: #181b20; border-color: rgba(255,255,255,.08);
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
  }
}
.uc-qitem:hover{ transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.uc-qitem svg{ width: 20px; height: 20px; }
/* 针对大屏（PC）增加左右留白 */
@media (min-width: 1200px) {
  body {
    padding-left: 450px;
    padding-right: 450px;
  }
  main {
    max-width: 1100px; /* 内容区再放宽一点 */
    margin: 0 auto;
  }
}
body {
    -webkit-overflow-scrolling: touch;
}

/* 隐藏 Safari 顶部的状态栏 */
.reader-container {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

.header {
    top: constant(safe-area-inset-top);
    top: env(safe-area-inset-top);
}
#cacheStatus {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(30, 144, 255, 0.9); /* 半透明蓝色 */
  color: #fff;
  font-size: 14px;
  padding: 6px 12px;
  text-align: center;
  z-index: 9999;
  transition: transform 0.3s ease;
}

#cacheStatus.hidden {
  transform: translateY(-100%);
}

#cacheProgressBar {
  margin-top: 4px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

#cacheProgressFill {
  width: 0%;
  height: 100%;
  background: #fff;
  transition: width 0.3s;
}
/*
 * rank-specific.css
 * 榜单页面的专用样式
 * 优化点 1: Tabs 自动换行
 * 优化点 2: 新增书籍分类样式
 */

/* --- 核心布局：Flexbox for Two-Column Layout --- */
.rank-page-main {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* 优化点 1: Tabs 自动换行 */
.rank-tabs-container {

    display: flex;
    flex-wrap: wrap; /* 关键修改：允许 flex item 换行 */
    overflow-x: hidden; /* 禁止横向滚动 */
    white-space: normal;
    border-bottom: 2px solid var(--border);
    padding: 0 1rem 5px 1rem; /* 调整底部 padding，为换行按钮留出空间 */
    background: var(--bg-secondary);
}

.rank-content-wrapper {
    display: flex;
    padding: 1rem 0 1rem 0; /* 整体内容的上下 padding */
}

/* 移动端默认隐藏侧边栏 */
.category-nav {
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    width: 120px;
    margin-left: 1rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-right: 1rem;
}

/* PC 端显示侧边栏 */
@media (min-width: 768px) {
    .category-nav {
        display: flex;
    }
    .rank-list-content {
        padding-left: 1.5rem;
    }
}

/* --- Tab 按钮样式 (大分类) --- */
.rank-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem; /* 调整 padding */
    margin-right: 5px; /* 添加右侧间距 */
    margin-bottom: 5px; /* 添加底部间距 */
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color-secondary);
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 3px solid transparent;
}
.rank-tab-btn:hover {
    color: var(--text-color-primary);
}
.rank-tab-btn.active {
    color: var(--theme-color);
    border-bottom: 3px solid var(--theme-color);
}

/* --- 侧边栏按钮样式 (子分类) --- */
.category-nav-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.5rem;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color-secondary);
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.category-nav-btn:hover {
    background-color: var(--hover-bg);
}
.category-nav-btn.active {
    background-color: var(--theme-color);
    color: var(--white);
    font-weight: bold;
}

/* --- 内容标题 --- */
.rank-main-title {
    padding: 0 1rem 0.5rem;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--theme-color);
    margin: 0;
}

/* --- 榜单列表 --- */
.rank-list {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
}

.rank-item.with-cover {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s;
}
.rank-item.with-cover:hover {
    background-color: var(--hover-bg);
}
.rank-item.with-cover:last-child {
    border-bottom: none;
}

.rank-number {
    flex-shrink: 0;
    width: 25px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 10px;
    color: var(--text-color-secondary);
}
.rank-number.top-3 {
    color: var(--theme-color);
}

.rank-cover {
    width: 50px;
    height: 70px;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.rank-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--skeleton-color);
}

.rank-info {
    flex-grow: 1;
    overflow: hidden;
    padding-left: 0;
}

.rank-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color-primary);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

/* 优化点 2: 书籍分类样式 */
.rank-category {
    font-size: 0.8rem;
    color: var(--theme-color);
    margin-bottom: 3px;
    display: block;
    font-weight: 500;
}

.rank-author {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    margin-bottom: 3px;
}

.rank-intro {
    font-size: 0.8rem;
    color: var(--text-color-tertiary);
    margin-top: 5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 骨架屏样式 (保持不变) --- */
.rank-card-skeleton {
    display: flex;
    align-items: flex-start;
    padding: 10px 1rem;
    border-bottom: 1px solid var(--border-light);
}
.rank-card-skeleton::before {
    content: '';
    width: 50px;
    height: 70px;
    background: var(--skeleton-color);
    margin-right: 15px;
    border-radius: 4px;
}
.skeleton-rank-line {
    height: 15px;
    background: var(--skeleton-color);
    margin-bottom: 8px;
    border-radius: 4px;
}
.skeleton-rank-line.long {
    width: 80%;
}
.skeleton-rank-line.medium {
    width: 60%;
    height: 12px;
}
.skeleton-tab-item {
    width: 80px;
    height: 30px;
    background: var(--skeleton-color);
    margin: 8px 10px;
    border-radius: 4px;
}
/* 容器布局 */
.rank-page-container {
    padding: 20px;
}

/* 顶部 Tab 样式 */
.rank-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.rank-tab-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    font-weight: bold;
    margin-right: 10px;
    border-bottom: 2px solid transparent;
}

.rank-tab-btn.active {
    color: var(--primary-color, #007bff); /* 激活颜色 */
    border-bottom: 2px solid var(--primary-color, #007bff);
}

/* 核心布局：侧边栏和内容区并排显示 */
.rank-main-content {
    display: flex; 
    gap: 20px; 
    /* 重点：给父容器设置一个固定的高度，或者让它充满视窗 */
    /* 假设你希望内容区占据视窗高度（减去header和footer） */
    min-height: calc(100vh - 150px); /* 100vh 减去头部和底部的空间 */
}
/* 右侧书籍列表内容样式 */
#rankListContent { /* 注意这里使用 ID 选择器 */
    flex: 1; 
    min-width: 0; 
    /* 🌟 核心修复点 1：设置一个固定高度或最大高度 */
    max-height: calc(100vh - 180px); /* 确保它不会超出视窗，且小于 rank-main-content 的高度 */
    
    /* 🌟 核心修复点 2：允许垂直滚动 */
    overflow-y: auto; 
}
/* 2. 左侧分类导航（侧边栏）样式 */
.category-nav {
    flex: 0 0 80px; /* 固定宽度 150px，不伸缩 */
    display: flex;
    flex-direction: column; /* 按钮垂直排列 */
    padding-right: 10px;
    border-right: 1px solid #f0f0f0;
}

.category-nav-btn {
    padding: 8px 10px;
    margin-bottom: 5px;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    transition: background-color 0.2s;
}

.category-nav-btn:hover {
    background-color: #f5f5f5;
}

.category-nav-btn.active {
    background-color: var(--highlight-color, #e6f7ff); /* 激活状态背景 */
    color: var(--primary-color, #007bff);
    font-weight: bold;
}

/* 3. 右侧书籍列表内容样式 */
.rank-list-content {
    flex: 1; /* 占据剩余所有空间 */
    overflow-y: auto; /* 如果内容很多可以滚动 */
}

/* (书籍列表的具体样式，例如 .rank-list, .rank-item 等，保持不变) */
/* 示例 CSS 样式（请自行添加到您的 style.css 中） */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.category-grid {
    /* 确保每行只显示 4 个卡片 */
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px; /* 调整间距 */
    padding: 0 1rem;
}

/* 移动端适配 (可选，以确保手机上每行显示 2 个) */
@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}