/* 高级UI增强样式 - 为小白屋代码预览器提供更精美的界面和交互体验 */

/* 全局动画效果 */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(74, 108, 247, 0.2); }
  50% { box-shadow: 0 0 20px rgba(74, 108, 247, 0.4); }
  100% { box-shadow: 0 0 5px rgba(74, 108, 247, 0.2); }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 增强标题和按钮效果 */
.logo h1 {
  font-size: 1.6rem !important;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #4A6CF7, #00C8FF, #4A6CF7) !important;
  background-size: 200% auto !important;
  animation: gradient-shift 5s ease infinite !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-fill-color: transparent !important;
  font-weight: 700 !important;
}

/* 增强面板效果 */
.editor-container, .preview-container {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
  border: none !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 
              0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

.editor-container:hover, .preview-container:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 
              0 3px 10px rgba(0, 0, 0, 0.07) !important;
}

/* 美化面板标题 */
.panel-header {
  background: linear-gradient(120deg, #f8faff 0%, #ffffff 100%) !important;
  padding: 18px 20px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.panel-header h2 {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #1A1F2C !important;
  padding-left: 15px !important;
}

.panel-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  background: linear-gradient(to bottom, #4A6CF7, #00C8FF);
  border-radius: 3px;
}

/* 美化按钮 */
.control-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.control-btn:hover {
  background-color: #ffffff !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.control-btn.active {
  background-color: rgba(74, 108, 247, 0.15) !important;
  color: #4A6CF7 !important;
}

.control-btn svg {
  transition: transform 0.3s ease !important;
}

.control-btn:hover svg {
  transform: scale(1.15) !important;
}

/* 底部操作栏增强 */
.action-bar {
  background: linear-gradient(to right, #f8faff, #ffffff) !important;
  padding: 20px 30px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.action-btn {
  background: linear-gradient(135deg, #4A6CF7, #3A5CE5) !important;
  border-radius: 12px !important;
  padding: 12px 22px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 6px 15px rgba(74, 108, 247, 0.25) !important;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.action-btn:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 20px rgba(74, 108, 247, 0.35) !important;
  background: linear-gradient(135deg, #3A5CE5, #2A4CD5) !important;
}

.action-btn:active {
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 10px rgba(74, 108, 247, 0.3) !important;
}

/* 美化选择框和输入控件 */
.option-group select, 
.option-group input[type="range"] {
  transition: all 0.3s ease !important;
  border-radius: 10px !important;
  padding: 10px 15px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background-color: #f5f7ff !important;
}

.option-group select:hover,
.option-group input[type="range"]:hover {
  border-color: rgba(74, 108, 247, 0.3) !important;
}

.option-group select:focus {
  border-color: #4A6CF7 !important;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2) !important;
  outline: none !important;
}

/* 增强预览区域 */
#preview-frame {
  background-image: 
    linear-gradient(45deg, #f9faff 25%, transparent 25%), 
    linear-gradient(-45deg, #f9faff 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f9faff 75%), 
    linear-gradient(-45deg, transparent 75%, #f9faff 75%) !important;
  background-size: 20px 20px !important;
  padding: 20px !important;
}

#preview-content {
  border-radius: 12px !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s ease !important;
}

/* 全屏模式增强 */
#fullscreen-container {
  background-color: #f4f7ff !important;
}

.fullscreen-header {
  background: linear-gradient(to right, #1A1F2C, #2A3040) !important;
  padding: 18px 30px !important;
}

.fullscreen-btn {
  border-radius: 12px !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.fullscreen-btn:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
}

#fullscreen-content {
  padding: 30px !important;
  background-image: 
    linear-gradient(45deg, #f0f3fa 25%, transparent 25%), 
    linear-gradient(-45deg, #f0f3fa 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f0f3fa 75%), 
    linear-gradient(-45deg, transparent 75%, #f0f3fa 75%) !important;
  background-size: 30px 30px !important;
}

#fullscreen-content iframe {
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* 交互增强 - 提示框 */
.toast {
  border-radius: 12px !important;
  padding: 15px 20px !important;
  background-color: #1A1F2C !important;
  border-left: 5px solid #4A6CF7 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  animation: 
    slideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
    fadeOut 0.4s ease 3s forwards !important;
}

/* 动画效果增强 */
.animation-active {
  animation: glow 2s infinite !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}

::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
  border-radius: 10px !important;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1 !important;
  border-radius: 10px !important;
  border: 2px solid #f1f1f1 !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8 !important;
}

/* 编辑器增强 */
.CodeMirror {
  font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace !important;
  line-height: 1.7 !important;
  padding: 5px !important;
}

.CodeMirror-gutters {
  border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
  .editor-container, .preview-container {
    border-radius: 12px !important;
  }
  
  .action-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* 悬浮工具提示 */
[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1A1F2C;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* 模式切换按钮增强 */
.mode-selector {
  background-color: #f0f3fa !important;
  border-radius: 12px !important;
  padding: 5px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.mode-selector button {
  border-radius: 10px !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.mode-selector button.active {
  background: linear-gradient(135deg, #ffffff, #f8faff) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
  color: #4A6CF7 !important;
  font-weight: 600 !important;
}

/* 页面加载动画 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

body.loaded::before {
  opacity: 0;
}

/* 添加页面载入动画脚本 */
