.translate-section {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 16px;
  max-width: 100%;
  margin: 5px auto;
  height: calc(100% - 120px);
  display: flex;
  flex-direction: column;
}

.translate-section-right {
  margin-left: 10px;
  width: 90%;
  height: calc(100% - 165px);
}

.translate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.translate-header-right {
  /* 按钮分两行 */
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.translate-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.button-group {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  overflow: scroll;
  scrollbar-width: none;
}

.button-group-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.button-group button {
  /* 高度固定，若空间不足，字体变小 */
  height: 100%;
  font-size: 14px;
  white-space: nowrap;
}

.translate-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

.language-toggle,
.format-toggle,
.layout-toggle,
.mindmap-toggle {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.language-toggle:hover,
.format-toggle:hover,
.mindmap-toggle:hover,
.layout-toggle:hover {
  background-color: #f5f5f5;
}

.language-toggle.chinese {
  color: #1890ff;
  border-color: #1890ff;
}

.language-toggle.english {
  color: #52c41a;
  border-color: #52c41a;
}

.format-toggle.formatted {
  color: #722ed1;
  border-color: #722ed1;
}

.format-toggle.raw {
  color: #fa8c16;
  border-color: #fa8c16;
}

.mindmap-toggle {
  color: #52c41a;
  border-color: #52c41a;
}

.mindmap-toggle.loading {
  color: #1890ff;
  border-color: #1890ff;
}

.mindmap-toggle:disabled {
  color: #cccccc;
  cursor: not-allowed;
}

.layout-toggle {
  color: #1890ff;
  border-color: #1890ff;
}

.page-indicator {
  color: #666;
  font-size: 14px;
}

.translate-content {
  flex: 1;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 16px;
  position: relative;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  color: #666;
}

.translation-text {
  line-height: 1.6;
  color: #333;
  font-size: 14px;
}

.raw-text {
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 0;
}

/* Markdown 样式调整 */
.translation-text h1 {
  font-size: 1.5em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.translation-text h2 {
  font-size: 1.3em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.translation-text h3 {
  font-size: 1.1em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.translation-text p {
  margin: 0.5em 0;
  font-size: 14px;
}

.translation-text ul, 
.translation-text ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.translation-text li {
  font-size: 14px;
  margin: 0.2em 0;
}

.translation-text code {
  background-color: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 13px;
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

.translation-text pre {
  background-color: #f5f5f5;
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.5em 0;
}

.translation-text pre code {
  background-color: transparent;
  padding: 0;
  font-size: 13px;
}

.translation-text blockquote {
  margin: 0.5em 0;
  padding-left: 1em;
  border-left: 4px solid #ddd;
  color: #666;
}

.translation-text img {
  max-width: 100%;
  height: auto;
  margin: 0.5em 0;
}

.translation-text table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.translation-text th,
.translation-text td {
  border: 1px solid #ddd;
  padding: 0.5em;
  font-size: 14px;
}

.translation-text th {
  background-color: #f5f5f5;
}

/* KaTeX 数学公式样式调整 */
.katex {
  font-size: 1.1em;
}

.katex-display {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5em 0;
}

.mindmap-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.mindmap-modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mindmap-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
}

.mindmap-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.close-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.close-button:hover {
  color: #333;
}

.mindmap-container {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.mindmap {
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.regenerate-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #1976d2;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.regenerate-button:hover {
  background-color: #1565c0;
}

.regenerate-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.regenerate-button svg {
  font-size: 18px;
}

.export-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.export-button:hover {
  background-color: #45a049;
}

.export-button svg {
  font-size: 18px;
} 

.translate-body {
  position: relative;
}

.control-buttons {
  display: flex;
  gap: 8px;
}

.clipboard-buttons {
  display: flex;
  gap: 8px;
  z-index: 1000;
  margin-left: auto;
}

.clipboard-buttons button {
  background-color: #f0f0f0;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease-in-out;
}

.clipboard-buttons button:hover {
  background-color: #e0e0e0;
  color: #333;
}

.clipboard-buttons button svg {
  font-size: 14px;
  transform: scale(1);
  transition: transform 0.3s ease, opacity 0.3s ease, scale 0.3s ease;
}

.clipboard-buttons button:hover svg {
  transform: scale(1.1);
}

.nav-page-buttons {
  display: flex;
  gap: 8px;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.nav-page-buttons button {
  background-color: #f0f0f0;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-page-buttons button:hover {
  background-color: #e0e0e0;
  color: #333;
}

.nav-page-buttons button svg {
  font-size: 14px;
}

.nav-page-buttons button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.nav-page-buttons button:disabled svg {
  color: #cccccc;
}
