/**
 * LEAN 4 Playground 样式
 */

/* 代码块包装器 */
.lean4-code-wrapper {
  position: relative;
  margin: 1em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e1e4e8;
}

/* 工具栏 */
.lean4-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(180deg, #f6f8fa 0%, #ebeef1 100%);
  border-bottom: 1px solid #e1e4e8;
}

/* 语言标签 */
.lean4-lang-label {
  font-size: 12px;
  font-weight: 600;
  color: #586069;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 按钮容器 */
.lean4-buttons {
  display: flex;
  gap: 8px;
}

/* 按钮基础样式 */
.lean4-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

/* 在线运行按钮 */
.lean4-run-btn {
  background: #2ea44f;
  color: white;
  border-color: #2c974b;
}

.lean4-run-btn:hover {
  background: #2c974b;
  border-color: #268a3f;
}

.lean4-run-btn:active {
  background: #268a3f;
}

/* 复制按钮 */
.lean4-copy-btn {
  background: #fafbfc;
  color: #24292e;
  border-color: #e1e4e8;
}

.lean4-copy-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5da;
}

.lean4-copy-btn:active {
  background: #edeff2;
}

.lean4-copy-btn.copied {
  background: #2ea44f;
  color: white;
  border-color: #2c974b;
}

/* 代码块样式调整 */
.lean4-code-wrapper pre {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

.lean4-code-wrapper pre code {
  display: block;
  padding: 16px !important;
  overflow-x: auto;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
  .lean4-code-wrapper {
    border-color: #30363d;
  }

  .lean4-toolbar {
    background: linear-gradient(180deg, #21262d 0%, #161b22 100%);
    border-bottom-color: #30363d;
  }

  .lean4-lang-label {
    color: #8b949e;
  }

  .lean4-copy-btn {
    background: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
  }

  .lean4-copy-btn:hover {
    background: #30363d;
    border-color: #484f58;
  }
}

/* 响应式布局 */
@media (max-width: 600px) {
  .lean4-toolbar {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .lean4-buttons {
    width: 100%;
  }

  .lean4-btn {
    flex: 1;
    text-align: center;
  }
}

/* iframe 嵌入模式（可选） */
.lean4-iframe-wrapper {
  margin: 1em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e1e4e8;
}

.lean4-iframe {
  width: 100%;
  height: 400px;
  border: none;
}

.lean4-iframe-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
}

.lean4-iframe-title {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
}

.lean4-fullscreen-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: #fafbfc;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  cursor: pointer;
}

.lean4-fullscreen-btn:hover {
  background: #f3f4f6;
}
