@import url('./confirm-dialog.css');
@import url('./inner-ide/main.css');
@import url('./code-switcher.css');
@import url('./center-block.css');
@import url('./contact-me.css');

/* Markdown 内容样式 */
.markdown-body {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400 !important;
  color: #010101;
  font-family: 'Noto Sans SC', system-ui, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
    sans-serif !important;
  width: 100%;                /* 👈 添加 */
  box-sizing: border-box;     /* 👈 添加 */
  /* 如果需要左边距，使用 margin 而不是 padding */
  /* margin-left: 50px; */
  will-change: opacity; /* 优化渲染性能 */
}
/* 内容变化时的动画 */
.markdown-body > * {
  animation: slideIn 0.3s ease;
}

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

.markdown-body strong {
  font-weight: 700;
}
/* 一级标题：最深、最醒目 */
.markdown-body h1 {
  font-size: 32px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 24px;
  padding-bottom: 16px;
  color: #202124; /* 比原来的 #111827 稍微柔一点 */
}

/* 二级标题：略小一点，颜色同主标题，保持层级清晰 */
.markdown-body h2 {
  font-size: 26px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 20px;
  color: #202124;
}

/* 三级标题：用次级文本色，视觉上比正文重一点 */
.markdown-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
  color: #3c4043;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: inherit !important;  /* 强制用父元素的 font-family */
}



/* 段落正文：比主色略浅一点，阅读感更柔和 */
.markdown-body p {
  margin-bottom: 12px;
}


  /* ===== 行内代码 ===== */
.markdown-body code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #e83e8c;
}



/* ===== 代码块容器 ===== */
.markdown-body pre {
  background: #282828;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* 代码块内的 code */
.markdown-body pre code {
  background: #282828;
  padding: 16px;
  display: block;
  overflow-x: auto;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.5;  /* 👈 改：统一行高 */
  border-radius: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;  /* 👈 添加：统一字体 */
}

/* ===== Prism 行号样式 ===== */
.markdown-body pre.line-numbers {
  padding-left: 0;
  position: relative;
}

.markdown-body pre.line-numbers code {
  padding-left: 3.8em;  /* 👈 为行号留出空间 */
  padding-top: 16px;
  padding-bottom: 16px;
}

.markdown-body .line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 14px;  /* 👈 改：与代码字体大小一致 */
  line-height: 1.5;  /* 👈 改：与代码行高一致 */
  left: 0;
  width: 3em;
  padding-top: 16px;  /* 👈 添加：与代码 padding 一致 */
  padding-bottom: 16px;  /* 👈 添加：与代码 padding 一致 */
  letter-spacing: -1px;
  border-right: 1px solid #3a3a3a;
  user-select: none;
  background: #282828;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;  /* 👈 添加：统一字体 */
}

.markdown-body .line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
  color: #858585;
  padding-right: 0.8em;
  text-align: right;
  height: auto;  /* 👈 添加 */
}

.markdown-body .line-numbers-rows > span:before {
  content: counter(linenumber);
}
/* ===== 代码块容器 ===== */
.markdown-body pre {
  background: #282828;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* 代码块内的 code */
.markdown-body pre code {
  background: #282828;
  padding: 16px;
  display: block;
  overflow-x: auto;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ✅ 没有语言标签的普通代码块 - 蓝色背景样式 */
.markdown-body pre:not([class*="language-"]) {
  background: #e3f2fd; /* 浅蓝色背景 */
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.markdown-body pre:not([class*="language-"]) code {
  background: #e3f2fd; /* 浅蓝色背景 */
  color: #1565c0; /* 深蓝色文字 */
  padding: 12px 16px !important;
}

/* ===== Prism 行号样式 ===== */
.markdown-body pre.line-numbers {
  padding-left: 0;
  position: relative;
}

.markdown-body pre.line-numbers code {
  padding-left: 3.8em;  /* 👈 为行号留出空间 */
  padding-top: 16px;
  padding-bottom: 16px;
}

.markdown-body .line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 14px;
  line-height: 1.5;
  left: 0;
  width: 3em;
  padding-top: 16px;
  padding-bottom: 16px;
  letter-spacing: -1px;
  border-right: 1px solid #3a3a3a;
  user-select: none;
  background: #282828;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.markdown-body .line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
  color: #858585;
  padding-right: 0.8em;
  text-align: right;
  height: auto;
}

.markdown-body .line-numbers-rows > span:before {
  content: counter(linenumber);
}

/* ===== 语言标签 ===== */
.markdown-body pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 12px;
  font-size: 12px;
  color: #999;
  background: #2d2d2d;
  border-bottom-left-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.markdown-body pre[class*="language-python"]::before {
  content: "Python";
  color: #3776ab;
}

.markdown-body pre[class*="language-javascript"]::before {
  content: "JavaScript";
  color: #f7df1e;
}

.markdown-body pre[class*="language-typescript"]::before {
  content: "TypeScript";
  color: #3178c6;
}

.markdown-body pre[class*="language-java"]::before {
  content: "Java";
  color: #f89820;
}

.markdown-body pre[class*="language-cpp"]::before {
  content: "C++";
  color: #00599c;
}

.markdown-body pre[class*="language-c"]::before {
  content: "C";
  color: #555;
}

/* ===== 滚动条美化 ===== */
.markdown-body pre code::-webkit-scrollbar {
  height: 8px;
}

.markdown-body pre code::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

/* ✅ 普通代码块的滚动条 */
.markdown-body pre:not([class*="language-"]) code::-webkit-scrollbar-track {
  background: #bbdefb; /* 浅蓝色滚动条轨道 */
}

.markdown-body pre code::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

/* ✅ 普通代码块的滚动条滑块 */
.markdown-body pre:not([class*="language-"]) code::-webkit-scrollbar-thumb {
  background: #1976d2; /* 蓝色滚动条滑块 */
}

.markdown-body pre code::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ✅ 普通代码块的滚动条滑块悬停 */
.markdown-body pre:not([class*="language-"]) code::-webkit-scrollbar-thumb:hover {
  background: #1565c0; /* 深蓝色 */
}

/* 隐藏整个 toolbar */
.markdown-body .code-toolbar .toolbar {
  display: none !important;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.markdown-body li {
  margin-bottom: 8px;
}

.markdown-body blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 16px;
  margin: 20px 0;
  color: #6b7280;
  font-style: italic;
}

.markdown-body img {  
  max-width: 100%;
  height: auto;
  display: block;
  margin : 20px auto;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid #e5e7eb;
  padding: 12px;
  text-align: left;
}

.markdown-body th {
  background: #f9fafb;
  font-weight: 600;
}

.markdown-body .note-box {
  border: 2px solid black;
  border-radius: 8px;
  padding: 8px 14px;
  width: 100%;
  margin: 12px 0;
  box-sizing: border-box;
}

.markdown-body .note-box p {
  margin: 0;
}

.markdown-body .note-box p + p {
  margin-top: 4px;
}

.markdown-body .info-box {
  background-color: #e3f2fd;
}

.markdown-body .warning-box {
  background-color: #fff3e0;
  border : 2px solid #ff9800;
}

.markdown-body .success-box {
  background-color: #e8f5e9;
  border : 2px solid #4caf50;
}

.markdown-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 12px;
  color: #666;
  font-size: 14px;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========== UIManager Loading 蒙层样式 ========== */
.ui-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all; /* 👈 阻止所有点击事件 */
}

.markdown-body .ui-loading-overlay.visible {
    opacity: 1;
}

.markdown-body .ui-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.markdown-body .ui-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: ui-loading-spin 1s linear infinite;
}

.markdown-body .ui-loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

@keyframes ui-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}