/* Base style for textareas */
.base-textbox {
    position: absolute; /* Positioned relative to its container */
    background-color: transparent;
    border: none;
    resize: none;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    /* top, left, width, height are now set via inline styles or specific IDs */
}

/* Remove outline on focus */
.base-textbox:focus {
    outline: none;
}

.h1-text {
  font-family: '黑体', 'HeiTi', serif; /* 使用黑体，同时添加后备字体 */
  font-size: 20px;
  text-align: left;
  display: flex;
  align-items: flex-start; /* Changed from flex-end to align text to the top */
  justify-content: left;
}

.h1-multiline-text {
  font-size: 16px;
  line-height: 2.07;
  white-space: pre-wrap; /* 保留换行符和空格，允许文本换行 */
  word-wrap: break-word; /* 允许长单词断行 */
  overflow-wrap: break-word; /* 现代浏览器中更推荐使用 */
}

.h2-text {
  font-family: '黑体', 'HeiTi', serif; /* 使用黑体，同时添加后备字体 */
  font-size: 40px;
  text-align: center; /* 文本水平居中 */
  display: flex;
  align-items: center; /* 文本垂直居中 */
  justify-content: center; /* flex 元素水平居中 */
  line-height: 1.0; /* 确保行高不会导致偏移 */
}

.h2-small-text {
    font-size: 27px !important;
}



.h3-text {
  font-family: '黑体', 'HeiTi', serif; /* 使用黑体，同时添加后备字体 */
  font-size: 15px;
  text-align: left;
  display: flex;
  align-items: flex-start; /* 从 flex-end 改为 flex-start 以支持多行文本 */
  justify-content: left;
  white-space: pre-wrap; /* 允许文本换行 */
  word-wrap: break-word;   /* 允许长单词断行 */
  line-height: 1.5; /* 增加行高以提高可读性 */
}

.h4-text {
  font-family: '楷体', 'KaiTi', serif; /* 使用楷体，同时添加后备字体 */
  font-size: 16px;
  text-align: left;
  display: flex;
  align-items: flex-start; /* Changed from flex-end to align text to the top */
  justify-content: left;
}

/* General debug mode style for ALL textboxes */
.base-textbox.debug-mode {
    border: 1px solid red !important; /* Use !important to ensure override */
    background-color: rgba(255, 0, 0, 0.1);
}