/* 
 * 应用级基础样式 - reinvent-insight项目
 * 只包含最基本的全局样式，不与组件样式冲突
 */

/* 基础重置 */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* 防止整体页面滚动 */
}

/* 移动端基础优化 */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important; /* 强制隐藏横向滚动 */
    width: 100% !important;
    box-sizing: border-box;
  }
  
  /* 笔记库视图移动端边距优化 */
  .max-w-3xl.mx-auto.p-6 {
    padding: 1rem !important; /* 恢复合适的padding */
  }
}

@media (max-width: 480px) {
  .max-w-3xl.mx-auto.p-6 {
    padding: 0.75rem !important; /* 极小屏幕保持适度padding */
  }
}

/* 应用主容器 */
.app {
  height: 100vh; /* 使用视口高度 */
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止应用容器滚动 */
  
  /* 全局CSS变量 */
  --app-header-height: 80px;
}

/* 主内容区域 */
.app__content {
  flex: 1;
  overflow: hidden; /* 默认隐藏滚动，由具体视图控制 */
}

/* 非阅读视图允许滚动 */
.app__content.overflow-auto {
  overflow: auto;
}

/* 阅读视图隐藏滚动 */
.app__content.overflow-y-hidden {
  overflow: hidden;
}

/* 基础动画 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 环境标识 */
.dev-env-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  animation: pulse 2s infinite;
  backdrop-filter: blur(8px);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}




/* 自定义滚动条样式 - 深色主题 */
/* Webkit浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.5);
  border-radius: 5px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.7);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(71, 85, 105, 0.5) rgba(15, 23, 42, 0.3);
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .slide-in,
  .dev-env-indicator {
    animation: none;
  }
  
  ::-webkit-scrollbar-thumb {
    transition: none;
  }
}

/* 打印样式 */
@media print {
  /* 重置全局高度和溢出限制 */
  html, body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: white !important;
    position: static !important;
  }
  
  .app {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: white !important;
    display: block !important;
    position: static !important;
    flex: none !important;
  }
  
  .app__content {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    position: static !important;
    flex: none !important;
    display: block !important;
  }
  
  /* 隐藏开发环境标识 */
  .dev-env-indicator {
    display: none !important;
  }
} 