body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f7f7f7;
  /* 类似 Notion 的浅灰背景 */
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* 从顶部开始对齐 */
  min-height: 100vh;
}

.converter-container {
  background-color: #ffffff;
  /* 白色内容区域 */
  border-radius: 8px;
  padding: 30px 40px;
  max-width: 1000px;
  /* 限制最大宽度 */
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
  /* 微妙阴影 */
  margin-top: 30px;
}

h1 {
  font-size: 1.8em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  color: #111;
}

.description {
  text-align: center;
  color: #777;
  margin-bottom: 30px;
  font-size: 0.95em;
}

.panels {
  display: flex;
  gap: 30px;
  /* 面板间距 */
  margin-bottom: 20px;
}

.panel {
  flex: 1;
  /* 均分宽度 */
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #555;
  font-size: 0.9em;
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-tag {
  background-color: #eee;
  color: #555;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8em;
}

textarea,
.output-text-area {
  width: 100%;
  min-height: 300px;
  /* 固定最小高度 */
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  /* 浅灰色边框 */
  border-radius: 4px;
  font-size: 1em;
  line-height: 1.6;
  resize: vertical;
  /* 允许垂直调整大小 */
  background-color: #fff;
  box-sizing: border-box;
  /* 包含 padding 和 border */
  font-family: inherit;
  /* 继承 body 字体 */
  outline: none;
  /* 移除默认 outline */
  transition: border-color 0.2s ease;
}

textarea:focus,
.output-text-area:focus {
  border-color: #4a90e2;
  /* 聚焦时边框变蓝 (可选) */
}

.output-text-area {
  background-color: #f9f9f9;
  /* 输出区域稍有区分 */
  overflow-y: auto;
  /* 内容过多时显示滚动条 */
  word-wrap: break-word;
  /* 自动换行 */
  white-space: pre-wrap;
  /* 保留空白符序列，但正常换行 */
}

/* 绿色波浪线标注 */
.highlighted {
  text-decoration: underline wavy #28a745;
  /* 绿色波浪线 */
  /* text-underline-offset: 2px; */
  /* 可选：调整下划线与文字的距离 */
  /* text-decoration-skip-ink: none; */
  /* 可选：让下划线连续穿过字母下伸部分 */
  background-color: rgba(40, 167, 69, 0.05);
  /* 非常淡的绿色背景 */
  border-radius: 2px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: #777;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9em;
  position: relative;
  /* 用于定位状态提示 */
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

.copy-btn:hover {
  color: #333;
}

#copyStatus {
  font-size: 0.85em;
  color: #28a745;
  /* 成功提示用绿色 */
}

/* （可选）转换按钮样式 */
/*
#convertButton {
  display: block;
  width: 150px;
  margin: 20px auto 0;
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s ease;
}

#convertButton:hover {
  background-color: #0056b3;
}
*/

/* 响应式设计：小屏幕时堆叠 */
@media (max-width: 768px) {
  .panels {
    flex-direction: column;
    gap: 20px;
  }

  .converter-container {
    padding: 20px;
    margin-top: 15px;
  }

  h1 {
    font-size: 1.6em;
  }

  textarea,
  .output-text-area {
    min-height: 200px;
  }
}

/* 历史记录样式 */
.history-container {
  margin-top: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.history-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.clear-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.history-item {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.history-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.history-item .original {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.history-item .converted {
  color: #333;
  font-weight: 500;
}

.history-item .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.3s ease;
}

.history-item:hover .copy-btn {
  opacity: 1;
}

.history-item .copy-btn:hover {
  background: #e9ecef;
  color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .history-list {
    grid-template-columns: 1fr;
  }
}

/* 自动粘贴开关样式 */
.auto-paste-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
}

.auto-paste-label {
  color: #555;
  font-size: 0.8em;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 16px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
}

input:checked+.slider {
  background-color: #4a90e2;
}

input:focus+.slider {
  box-shadow: 0 0 1px #4a90e2;
}

input:checked+.slider:before {
  transform: translateX(14px);
}

.slider.round {
  border-radius: 16px;
}

.slider.round:before {
  border-radius: 50%;
}