.container-wrapper {
  container-type: inline-size; /* 声明它为一个尺寸查询容器 */
  container-name: tts-app;     /* (可选)给它一个名字 */
  width: 100%; /* 确保它撑满iframe */
}

html, body {
    overflow-x: hidden;
    height: 100%;
}
body {
    margin: 0;
    padding: 0;
    overflow-y: auto;
}
.main {
    /*min-height: 100%;*/
    display: flex;
    flex-direction: column;
}
/* 防止Bootstrap模态框添加padding-right */
body.modal-open {
    padding-right: 0 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
}
.title {
    margin-top:5px;
}
.nav-link {
    display:block;
    padding: 6px 8px 3px 8px !important;
}
.main {
    /* height: 100%; 使用固定高度 */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden; /* <-- 添加这一行代码！ */
}
/* 顶部标题栏样式 */
.main-header {
    background-color: #fff;
    padding: 10px 20px 10px 0px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    /* 设置固定定位 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* 确保在最上层显示 */
    z-index: 1000;
    /* width: 100%; 确保宽度100% */
}
.header-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.main-logo {
    display: flex;
    align-items: center;
    min-width: 200px; /* 设置最小宽度以防止文字重叠 */
}

.main-gg {
    display: flex;
    justify-content: flex-end; /* 靠右对齐 */
    align-items: center; /* 垂直居中 */
    width: 100%; /* 设置宽度占满容器 */
    flex: 1; /* 占用剩余空间 */
    padding-right: 0px; /* 右边距10px */
}

@media screen and (max-width: 576px) {
    .main-gg {
        order: 2; /* 调整显示顺序，使其显示在main-logo下方 */
        width: 100%; /* 确保在小屏幕下占满宽度 */
        margin-top: 10px; /* 添加一些上边距，与main-logo分开 */
    }
}

.main-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

/* 页脚样式 */
.main-footer {
    /* margin-top: auto; 确保footer始终在底部 */
    width: 100%;
    text-align: center;
    background-color: #f0f2f5;
    padding-bottom: 10px; 
    flex-shrink: 0; /* 防止footer被压缩 */
    position: relative; /* 改为相对定位，使footer随内容流动 */
    /* z-index: 1000; 确保显示在最上层 */
}

@media screen and (max-width: 575px) {
    .main-footer {
        margin-top: 20px; /* 在小屏幕下增加一些上边距 */
    }
}

.tts-div {
    padding: 20px 20px 20px 20px; /* 减少底部内边距 */
    color: #155724;
    text-align: center;
    font-size: 15px;
    flex: 1; /* 让内容区域自适应填充剩余空间 */
    display: flex;
    flex-direction: column;
    /* overflow-y: auto; 如果内容过多，允许此区域滚动 */
    /*max-height: calc(100% - 90px - 150px); /* 减去header和footer的高度 */
}
.custom-template {
    background-color: #f0f2f5;
    max-width: 100%;
}
.row {
    margin:0px !important;
    display: flex;
    color: #155724;
    text-align: center;
    font-size: 15px;
}

/* 
.gg {
    padding: 5px 0px 0px 0px;
    color: #155724;
    text-align: center;
    font-size: 15px;
} */

.charnum {
    padding: 0px;
    color: #155724;
    text-align: center;
    font-size: 15px;
}

.row {
    margin: 0px 0px 0px 0px;
}

#getresult {
    /* padding: 0px 12px 0px 12px; */
    color: #155724;
    text-align: center;
    font-size: 15px;
    margin-top: 5px;
}

.form-control {
    background: white;
}

.mb-3 {
    margin-bottom: 6px;
}
/* 修改标签页相关样式 */
.tab-content {
    margin-top: 10px;
    position: relative;
}

.tab-pane {
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.tab-pane.active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

/* 确保表单容器正确显示 */
.ttsform {
    position: relative;
    width: 100%;
}
#mstts, #edgetts {
    padding-left: 8px;
}
#textbox, #edgetextbox {
    height: 470px;
}

/* 当名为 tts-app 的容器宽度小于等于 575px 时应用这些样式 */
@container tts-app (max-width: 575px) {
  #mstts, #edgetts {
    padding-right: 0;
    padding-left: 0; /* 在小屏幕下也最好移除左边距 */
  }
  #textbox, #edgetextbox {
    height: 200px;
  }
}
