/* ==========================================================================
   智汇文库（Zhihui Wenku）现代化商业级设计系统样式表
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  
  --vip-gold: #d97706;
  --vip-gold-light: #fffbeb;
  --vip-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

svg {
  max-width: 100%;
  vertical-align: middle;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   顶部导航栏（全局通用）
   ========================================================================== */
.navbar-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.nav-search-bar {
  flex: 1;
  max-width: 540px;
  position: relative;
}

.nav-search-input {
  width: 100%;
  height: 42px;
  background: #f1f5f9;
  border: 1.5px solid transparent;
  border-radius: 24px;
  padding: 0 44px 0 18px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.nav-search-input:focus {
  background: #fff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.nav-search-btn {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-search-btn:hover {
  background: var(--primary-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-vip-gradient {
  background: var(--vip-gradient);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
  transition: all 0.2s ease;
}

.btn-vip-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.btn-checkin {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-checkin:hover {
  background: #d1fae5;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.points-pill {
  background: #dbeafe;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-login {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-login:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary);
}

/* ==========================================================================
   首页大厅布局（Banner、分类Tab、卡片流、排行榜）
   ========================================================================== */
.home-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hero-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.hot-search-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.hot-tag-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 4px 12px;
  border-radius: 14px;
  transition: all 0.2s;
}

.hot-tag-badge:hover {
  background: var(--primary);
  color: #fff;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-tab-btn {
  padding: 8px 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-tab-btn.active, .category-tab-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.home-layout-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  align-items: start;
}

.home-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
  align-self: start;
}

@media (max-width: 1024px) {
  .home-layout-grid {
    grid-template-columns: 1fr;
  }
  .home-sidebar-column {
    position: static;
  }
}

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 1100px) {
  .doc-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .doc-card-grid {
    grid-template-columns: 1fr;
  }
}

.doc-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  min-height: 155px;
}

.doc-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.format-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.badge-pdf { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-doc { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-xls { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-ppt { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-txt { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

.doc-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.doc-description {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.doc-price-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.price-free { color: #059669; }
.price-points { color: #2563eb; }
.vip-free-badge {
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* 首页侧边栏组件 */
.sidebar-vip-card {
  background: linear-gradient(145deg, #242933 0%, #1a1c24 100%);
  border-radius: 14px;
  padding: 22px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.22);
}

.sidebar-vip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar-vip-title {
  font-size: 16px;
  font-weight: 800;
  color: #f7dcb6;
}

.sidebar-vip-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 16px;
}

.btn-sidebar-vip-gold {
  background: linear-gradient(135deg, #ebd0a7 0%, #d8a870 100%);
  color: #2b1d0e;
  font-size: 13px;
  font-weight: 800;
  border: none;
  border-radius: 20px;
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 168, 112, 0.35);
  transition: all 0.2s ease;
}

.btn-sidebar-vip-gold:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.sidebar-white-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sidebar-card-title {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.sidebar-refresh-btn {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.sidebar-refresh-btn:hover {
  color: var(--primary);
}

.rank-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item-v2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-badge-v2 {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.rank-b1 { background: #ef4444; }
.rank-b2 { background: #f97316; }
.rank-b3 { background: #eab308; }
.rank-b4 { background: #3b82f6; }
.rank-b5 { background: #64748b; }

.rank-title-v2 {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.rank-title-v2:hover {
  color: var(--primary);
}

.sidebar-service-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.btn-sidebar-service {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  border-radius: 18px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-sidebar-service:hover {
  background: #dbeafe;
}

/* ==========================================================================
   在线阅读器（Reader Engine）专属排版样式（双栏无遮挡架构）
   ========================================================================== */
.reader-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px 20px 60px;
}

/* 普通流式工具栏，不使用 sticky 悬浮避免遮挡正文 */
.reader-toolbar {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.reader-doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-toolbar-icon {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-toolbar-icon:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-download-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.btn-download-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* 阅读器双栏网格 */
.reader-layout-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .reader-layout-grid {
    grid-template-columns: 1fr;
  }
}

.reader-main-column {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* PDF 高清缩放受控视口 */
.pdf-viewer-viewport {
  width: 100%;
  height: 82vh;
  min-height: 680px;
  background: #525659;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}

.pdf-inner-zoom-box {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transition: width 0.2s ease, height 0.2s ease;
  display: block;
}

.real-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 结构化纸张画板 */
.reader-canvas {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.reader-page-sheet {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 48px 56px;
  position: relative;
  min-height: 680px;
  box-sizing: border-box;
}

.reader-page-footer {
  position: absolute;
  bottom: 20px;
  left: 56px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

/* 试读截流遮罩 */
.reader-lock-overlay {
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, #ffffff 85%);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 50px 24px;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  box-shadow: var(--shadow-lg);
  margin-top: 20px;
}

/* ==========================================================================
   阅读器右侧专属侧边栏（作者信息、黑金VIP、热门相关推荐）
   ========================================================================== */
.reader-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
  align-self: start;
}

/* 1. 作者/上传者卡片 */
.reader-author-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.reader-author-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.reader-author-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary);
  border: 1.5px solid #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.reader-author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.reader-author-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.reader-author-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 2. 黑金 VIP 转化卡片 */
.reader-vip-card {
  background: linear-gradient(145deg, #232832 0%, #191c24 100%);
  border-radius: 14px;
  padding: 22px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25);
}

.reader-vip-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(232, 190, 137, 0.22) 0%, rgba(232, 190, 137, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.reader-vip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #f7dcb6;
  margin-bottom: 8px;
}

.reader-vip-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 18px;
}

.btn-reader-vip {
  background: linear-gradient(135deg, #ebd0a7 0%, #d8a870 100%);
  color: #2b1d0e;
  font-size: 13px;
  font-weight: 800;
  border: none;
  border-radius: 20px;
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 168, 112, 0.35);
  transition: all 0.2s ease;
}

.btn-reader-vip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(216, 168, 112, 0.5);
  filter: brightness(1.04);
}

/* 3. 热门相关推荐列表卡片 */
.reader-recom-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.reader-recom-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.reader-recom-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reader-recom-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.reader-recom-icon {
  width: 42px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}

.icon-word { background: #eff6ff; color: #2563eb; border-top: 3px solid #2563eb; }
.icon-pdf { background: #fef2f2; color: #dc2626; border-top: 3px solid #dc2626; }
.icon-excel { background: #ecfdf5; color: #059669; border-top: 3px solid #059669; }
.icon-ppt { background: #fff7ed; color: #ea580c; border-top: 3px solid #ea580c; }
.icon-txt { background: #f8fafc; color: #475569; border-top: 3px solid #475569; }

.reader-recom-info {
  flex: 1;
  min-width: 0;
}

.reader-recom-name {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin-bottom: 4px;
}

.reader-recom-item:hover .reader-recom-name {
  color: var(--primary);
}

.reader-recom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   通用模态框（Modal）与分页组件
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: modalScaleIn 0.25s ease forwards;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-close-btn:hover {
  background: #e2e8f0;
}

.vip-plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.vip-plan-card {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.vip-plan-card.active {
  border-color: #d97706;
  background: #fffbeb;
}

.vip-price {
  font-size: 20px;
  font-weight: 800;
  color: #d97706;
  margin: 6px 0;
}

/* 分页器精美样式 */
.wenku-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.pagination-item {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pagination-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.pagination-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* 现代化商业级 Footer 样式 */
.wenku-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
  padding: 50px 24px 28px;
  color: var(--text-secondary);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-col-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.footer-link-list a {
  color: var(--text-secondary);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link-list a:hover {
  color: var(--primary);
  transform: translateX(2px);
}

.footer-btn-feedback {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.footer-btn-feedback:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.footer-bottom-bar {
  border-top: 1px solid #f1f5f9;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* 反馈类型选择药丸标签 */
.feedback-type-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.feedback-type-btn {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.feedback-type-btn.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.feedback-form-input,
.feedback-form-textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  display: block;
}

.feedback-form-input:focus,
.feedback-form-textarea:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.feedback-form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.btn-feedback-submit {
  width: 100% !important;
  height: 44px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-feedback-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .wenku-footer {
    padding: 36px 16px 24px;
  }
}

/* 浮动挂件组 */
.floating-widget-group {
  position: fixed;
  right: 24px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 900;
}

.float-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.float-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Toast 提示条 */
.toast-notice {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 8px;
}

.toast-notice.show {
  display: flex;
}

.hide-on-mobile {
  display: none !important;
}

@media (min-width: 769px) {
  .hide-on-mobile {
    display: inline-flex !important;
  }
}

/* ==========================================================================
   全站移动端/平板端专属响应式自适应布局（Mobile & Tablet Adaptations）
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. 顶部导航栏自适应（精准两行布局：第一行 Logo+操作区，第二行全宽搜索框） */
  .navbar-container {
    padding: 10px 14px;
    height: auto;
    min-height: 50px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo actions"
      "search search";
    row-gap: 10px;
    column-gap: 12px;
    align-items: center;
  }

  .brand-logo {
    grid-area: logo;
    font-size: 17px;
    gap: 7px;
    white-space: nowrap;
    align-self: center;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .nav-actions {
    grid-area: actions;
    gap: 8px;
    align-items: center;
    justify-self: end;
    display: flex;
  }

  .nav-search-bar {
    grid-area: search;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
  }

  .nav-search-input {
    height: 38px;
    font-size: 13px;
    padding: 0 42px 0 16px;
    background: #f1f5f9;
    border-radius: 20px;
  }

  .nav-search-btn {
    top: 4px;
    right: 5px;
    width: 30px;
    height: 30px;
  }

  .btn-vip-gradient {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 14px;
    height: 30px;
  }

  .user-profile-menu {
    padding: 4px 8px;
    border-radius: 16px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .user-profile-menu .vip-free-badge {
    font-size: 9px;
    padding: 1px 4px;
  }

  .hide-mobile-text {
    display: none !important;
  }

  /* 2. 首页大厅自适应 */
  .home-container {
    padding: 12px 14px 40px;
  }

  .hero-section {
    padding: 20px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 14px;
  }

  .hot-search-tags {
    font-size: 11.5px;
    gap: 6px;
  }

  .hot-tag-badge {
    padding: 3px 8px;
    border-radius: 10px;
  }

  .category-tabs {
    margin-bottom: 16px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-tab-btn {
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: 16px;
  }

  .home-layout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .home-sidebar-column {
    position: static;
  }

  .doc-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .doc-card {
    padding: 14px 16px;
    min-height: auto;
  }

  .doc-title {
    font-size: 14px;
  }

  .doc-description {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .btn-login {
    padding: 4px 12px;
    font-size: 12px;
    height: 30px;
    border-radius: 14px;
  }

  /* 3. 阅读器自适应（工具栏与正文纸张 100% 严格像素级平齐） */
  .reader-container {
    padding: 12px 14px 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .reader-toolbar {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .reader-doc-info {
    flex: 1;
    min-width: 0;
    gap: 6px;
  }

  .reader-doc-info span[title] {
    max-width: 140px !important;
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-download-primary {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
    height: 32px;
    border-radius: 6px;
  }

  .btn-toolbar-icon {
    padding: 5px 8px;
    font-size: 12px;
    height: 32px;
  }

  .reader-layout-grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: 100%;
    gap: 16px;
  }

  .reader-main-column {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .reader-canvas {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 14px;
    padding: 0 0 20px 0;
  }

  .reader-sidebar-column {
    position: static;
  }

  .pdf-viewer-viewport {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 60vh;
    min-height: 400px;
    border-radius: var(--radius-sm);
  }

  .reader-page-sheet {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 24px 16px;
    min-height: 380px;
    border-radius: var(--radius-sm);
  }

  /* 4. 模态框自适应 */
  .modal-box {
    padding: 20px 16px;
    max-width: 95%;
  }

  .vip-plan-cards {
    gap: 6px;
  }

  .vip-plan-card {
    padding: 10px 4px;
  }

  .vip-price {
    font-size: 16px;
  }
}

/* ==========================================================================
   真实文档（Office Word/PPT/Excel & PDF）高保真纯净视口与试读截断保护引擎
   ========================================================================== */
.real-doc-viewer-wrapper {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.real-doc-viewer-wrapper.unlocked-view {
  height: 840px;
}

.real-doc-viewer-wrapper.locked-preview {
  height: 520px;
  overflow: hidden !important;
  user-select: none;
}

.real-doc-inner-clip {
  width: 100%;
  height: calc(100% + 36px);
  position: relative;
  overflow: hidden;
}

.real-doc-inner-clip iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 核心：未解锁状态下，彻底禁用 iframe 的所有鼠标/滚轮穿透事件 */
.real-doc-viewer-wrapper.locked-preview iframe {
  pointer-events: none !important;
  user-select: none !important;
}

/* 覆盖在视口上方的全屏防偷看防护罩 */
.real-doc-lock-barrier {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0.7) 65%,
    rgba(255, 255, 255, 0.98) 90%,
    #ffffff 100%
  );
}

/* 智汇文库专属高质感开屏加载遮罩（彻底遮盖底层任何微软开屏Logo动画） */
.real-doc-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.spinner-brand {
  width: 38px;
  height: 38px;
  border: 3.5px solid #f1f5f9;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: brandSpin 0.7s linear infinite;
}

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

/* 智汇文库专属 WebP 高保真多页画板引擎 */
.reader-webp-canvas {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reader-webp-page {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.reader-webp-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  background: #f8fafc;
}

.reader-webp-page-footer {
  padding: 10px 20px;
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   全新登录模态框组件（密码登录、短信+滑块安全验证、动态扫码登录）
   ========================================================================== */
.login-tab-nav {
  display: flex;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 20px;
  position: relative;
}

.login-tab-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.login-tab-item:hover {
  color: #2563eb;
}

.login-tab-item.active {
  color: #2563eb;
  font-weight: 700;
}

.login-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 20%;
  width: 60%;
  height: 2.5px;
  background: #2563eb;
  border-radius: 2px;
}

.login-tab-content {
  display: none;
}

.login-tab-content.active {
  display: block;
  animation: tabFadeIn 0.25s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 滑块安全验证组件 (Slider Security Verification) */
.slider-verify-box {
  width: 100%;
  height: 42px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-verify-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: #dcfce7;
  transition: width 0.05s linear;
}

.slider-verify-text {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  pointer-events: none;
  transition: color 0.2s;
}

.slider-verify-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
  color: #475569;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
}

.slider-verify-btn:active {
  cursor: grabbing;
}

.slider-verify-box.verified {
  background: #f0fdf4;
  border-color: #86efac;
}

.slider-verify-box.verified .slider-verify-bg {
  width: 100% !important;
  background: #dcfce7;
}

.slider-verify-box.verified .slider-verify-text {
  color: #16a34a;
  font-weight: 700;
}

.slider-verify-box.verified .slider-verify-btn {
  left: calc(100% - 44px) !important;
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  cursor: default;
}

/* 短信发送按钮 */
.btn-sms-send {
  height: 42px;
  padding: 0 16px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-sms-send:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-sms-send:disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* 扫码登录二维码容器 */
.qrcode-wrapper {
  display: inline-block;
  padding: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qrcode-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  border-color: #93c5fd;
}

.qrcode-center-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-scan-simulate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-scan-simulate:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
