/* KeepMind Studio - High Performance UI v4.1 */
:root {
  --bg-main: #0b0f1a;
  --bg-sidebar: #0f172a;
  --ui-border: rgba(255, 255, 255, 0.05);
  --brand-indigo: #6366f1;
  --text-muted: #64748b;
}

html, body {
  height: 100%; margin: 0; padding: 0; overflow: hidden;
  background-color: var(--bg-main);
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 极细滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

/* 商业级顶栏 */
.context-header {
  height: 56px;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

/* 书籍列表卡片 */
.book-card {
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.book-card:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--ui-border); }

/* 按钮规范 */
.btn {
  height: 32px; padding: 0 14px; font-size: 12px; font-weight: 600;
  border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary { background: var(--brand-indigo); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.btn-secondary { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--ui-border); color: #94a3b8; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(1); }

/* 徽章 */
.badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 800; text-transform: uppercase; }

/* 封面灯箱 */
#image-lightbox {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95);
  z-index: 1000; align-items: center; justify-content: center; cursor: zoom-out;
  backdrop-filter: blur(12px);
}
#image-lightbox img {
  max-width: 85%; max-height: 85%; object-fit: contain;
  border-radius: 1.5rem; box-shadow: 0 0 80px rgba(0,0,0,0.6);
  animation: springUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes springUp { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 空状态动画 */
.pulse-glow {
  width: 120px; height: 120px; background: var(--brand-indigo);
  border-radius: 50%; opacity: 0.05; filter: blur(40px);
  animation: pulse 4s infinite ease-in-out;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.05; } 50% { transform: scale(1.3); opacity: 0.1; } }

/* --- 📖 Reader 排版锁死 (V4.2 Optimized) --- */
.reader-view { 
  max-width: 840px; 
  margin: 0 auto; 
}
.prose { 
  color: #94a3b8 !important; 
  font-size: 1rem !important; 
  line-height: 1.6 !important; 
}
.prose h1 { 
  font-size: 2.25rem !important; 
  font-weight: 900 !important; 
  color: #ffffff !important; 
  margin-bottom: 2rem !important; 
  letter-spacing: -0.05em !important;
}
.prose h2 { 
  font-size: 1.5rem !important; 
  font-weight: 800 !important; 
  color: #ffffff !important; 
  border-bottom: 1px solid var(--ui-border); 
  padding-bottom: 0.5rem; 
  margin-top: 2.5rem !important; /* 压缩标题上方空白 */
  margin-bottom: 1rem !important;
}
.prose h3 { 
  font-size: 1.15rem !important; 
  font-weight: 700 !important; 
  color: var(--brand-indigo) !important; 
  margin-top: 1.5rem !important; 
  margin-bottom: 0.5rem !important;
}
.prose p { 
  margin-bottom: 1rem !important; 
}
.prose ul { 
  margin-top: 0.5rem !important;
  margin-bottom: 1.5rem !important;
}
.prose li::marker { 
  color: var(--brand-indigo) !important; 
  font-weight: bold;
}
