body {
    min-width: 1200px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#page-header {
    background-color: #3498db;
    color: white;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-width: 1200px;
}

#page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
}

#main-container {
    display: flex;
    flex: 1;
    min-width: 1200px;
}

#left-panel, #right-panel {
    height: calc(100vh - 50px);
    overflow-y: auto;
    box-sizing: border-box;
    min-width: 600px;
}

#left-panel {
    width: 50%;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #333; /* 添加这行 */
}

#left-panel textarea {
    width: calc(100% - 10px);
    margin: 0;
    resize: vertical;
    min-height: 6em;
    height: 6em;
    line-height: 1.2em;
    padding: 5px;
}

.report-header {
    height: 50px;
    background-color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: white;
    border-bottom: 1px solid #2980b9;
    margin: 0;
    padding: 0;
}

#report-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 10px 15px;
}

#report-content, #report-frame {
    flex-grow: 1;
    overflow-y: auto;
}

#report-frame {
    border: none;
    width: 100%;
    display: none;
}

.section-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.section-wrapper.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.section-checkbox {
    margin-right: 10px;
    margin-top: 11px;
}

.section-checkbox:checked + .section {
    border-left: 4px solid #3498db;
}

.section {
    flex-grow: 1;
    padding: 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    cursor: move;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

textarea {
    width: calc(100% - 10px);
    margin: 0;
    resize: vertical;
}

input[type="text"], textarea, select {
    width: calc(100% - 10px);
    padding: 8px;
    margin: 0;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, textarea:focus, select:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.input-row label {
    min-width: 150px;
    margin-right: 10px;
    color: #34495e;
    font-weight: bold;
}

.input-row input[type="text"],
.input-row select {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.input-row .radio-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

button {
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.hidden {
    display: none;
}

.radio-group {
    display: flex;
    flex-grow: 1;
}

.radio-group label {
    margin-right: 20px;
    background-color: #ecf0f1;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.radio-group label:hover {
    background-color: #bdc3c7;
}

.radio-group input[type="radio"]:checked + label {
    background-color: #3498db;
    color: white;
}

.collapsed {
    max-height: 43px;
    overflow: hidden;
}

.collapsed h2 {
    margin: 0;
    line-height: 23px;
}

.collapsed .section-content {
    display: none;
}

.button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#add-section {
    background-color: #2ecc71;
}

#add-section:hover {
    background-color: #27ae60;
}

#execute-review {
    background-color: #e74c3c;
}

#execute-review:hover {
    background-color: #c0392b;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 800px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.dialog-content {
    overflow-y: auto;
    margin-bottom: 20px;
    flex-grow: 1;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
}

.dialog-buttons button {
    margin-left: 10px;
}

.error-container {
    max-height: 300px;
    overflow-y: auto;
}

.error {
    color: #e74c3c;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#sortable-sections .section-wrapper {
    cursor: move;
}

#sortable-sections .section-wrapper:hover {
    background-color: #f9f9f9;
}

.summary, .tasks {
    margin-bottom: 20px;
}

.summary h3, .tasks h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.task {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.task h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.field {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.field label {
    width: 150px;
    min-width: 150px;
    margin-right: 10px;
    padding-top: 3px;
    color: #34495e;
    font-weight: bold;
}

.field input,
.field textarea,
.field .plain-text-value {
    flex-grow: 1;
    width: calc(100% - 210px);
    margin-right: 5px;
    margin-left: 0;
    padding: 3px 5px;
}

.plain-text-value {
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    line-height: 20px;
    min-height: 20px;
}

.copy-button {
    flex-shrink: 0;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    margin: 0 0 0 5px;
    height: 20px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.copy-button:hover {
    background-color: #7f8c8d;
}

/* 新增：为没有复制按钮的字段添加一个占位符 */
.field:not(:has(.copy-button))::after {
    content: '';
    width: 45px; /* 复制按钮的宽度 */
    flex-shrink: 0;
}

#status-container {
    margin-bottom: 15px;
    font-weight: normal;
    font-size: 14px;
    background-color: #f39c12;
    color: white;
    padding: 10px;
    border-radius: 4px;
}

#report-content::-webkit-scrollbar {
    width: 8px;
}

#report-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#report-content::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

#report-content::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

#output-requirements h2 {
    cursor: default;
}

.non-sortable {
    pointer-events: none;
}

.non-sortable .section-checkbox {
    pointer-events: none;
}

.non-sortable textarea {
    background-color: #f0f0f0;
    cursor: default;
}

#commit-whole, #commit-range {
    display: none;
}

.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}

.toast-message.show {
    opacity: 1;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid #ccc;
    padding-left: 10px; /* 添加这行 */
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background-color: #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    color: #7f8c8d;
}

.tab-button.active {
    background-color: #3498db;
    border-bottom: 3px solid #2980b9;
    font-weight: bold;
    color: white;
}

.tab-button:hover {
    background-color: #bdc3c7;
}

.tab-content {
    display: none;
    padding: 20px;
    height: calc(100% - 50px);
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

#report-frame {
    width: 100%;
    height: 100%;
    border: none;
}

#progress-tab {
    padding: 20px;
}

/* 新增样式 */
.summary, .task {
    background-color: #ffffff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.summary h3, .task h4 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

#model-select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    background-color: #ffffff;
    color: #34495e;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#model-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

#model-select option {
    padding: 8px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    body, #page-header, #main-container {
        min-width: 1200px;
    }
}

#gitlab-config {
    min-width: 300px; /* 设置最小宽度 */
    width: 100%; /* 使用100%宽度 */
    max-width: 800px; /* 设置最大宽度，避免在大屏幕上过宽 */
    margin: 0 auto; /* 居中显示 */
}

#gitlab-config .input-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 15px;
}

#gitlab-config .input-row label {
    min-width: 125px;
    margin-right: 10px;
    flex: 0 0 auto;
}

#gitlab-config .input-row input[type="text"],
#gitlab-config .input-row input[type="password"],
#gitlab-config .input-row select {
    flex: 1 1 auto;
    min-width: 0;
}

#gitlab-config h2 {
    cursor: default;
}

#system-prompt h2 {
    cursor: default;
}

#system-prompt .section-checkbox {
    pointer-events: none;
}

#system-prompt textarea {
    resize: vertical;
    min-height: 2em;
    height: auto;
}

#task-time-info {
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#task-time-info h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

#task-time-info p {
    margin: 5px 0;
}

.toolbar {
    padding: 10px 20px;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar-left {
    display: flex;
    align-items: center;
}

.toolbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 15px;
    margin-top: 0; /* 设置上边距为 0 */
}

.icon-btn img {
    width: 16px;
    height: 16px;
}

.template-select {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.template-select label {
    margin-right: 10px;
    white-space: nowrap;
    font-size: 14px;
    color: #34495e;
}

#template-dropdown {
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #bdc3c7;
    font-size: 14px;
    height: 30px;
    width: 150px;
}

/* 确保 toolbar 的 checkbox 样式与其他 section 一致 */
.section-wrapper .section-checkbox:checked + .toolbar {
    border-left: 4px solid #3498db;
}

.help-icon {
    margin-left: 10px;
    flex: 0 0 auto;
}

/* 对于 radio buttons 的特殊处理 */
.input-row .radio-group + .help-icon {
    margin-left: auto;
}

/* 确保 select 元素不会过宽 */
#model-select {
    max-width: 200px;
}

/* 调整 tooltip 的位置 */
.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    max-width: 500px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.help-dialog {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
}

.help-dialog h3 {
    text-align: left;
    margin-bottom: 20px;
    font-size: 24px;
    color: #2c3e50;
}

.help-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 20px; /* 添加一些右侧padding，以防止滚动条覆盖内容 */
}

.help-text h4 {
    margin-bottom: 15px;
    color: #3498db;
    font-size: 18px;
}

.help-text p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.help-text strong {
    color: #3498db;
}

.help-page {
    height: 100%;
    overflow-y: auto;
}

.help-page video {
    max-width: 100%;
    max-height: calc(100vh - 200px); /* 调整这个值以适应您的布局 */
    margin-top: 20px;
    object-fit: contain;
}

.dialog-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#prev-page,
#next-page,
#close-help-dialog {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#prev-page:hover,
#next-page:hover,
#close-help-dialog:hover {
    background-color: #2980b9;
}

#prev-page:disabled,
#next-page:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#page-indicator {
    font-size: 14px;
    color: #7f8c8d;
}

#page3 {
    overflow-y: hidden; /* 防止第三页出现滚动条 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.show-on-startup {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.show-on-startup input[type="checkbox"] {
    margin-right: 5px;
}

.password-input-container {
    position: relative;
    display: flex;
    flex-grow: 1;
    align-items: center;
}

.password-input-container input {
    width: 100%;
    padding: 8px;
    padding-right: 35px; /* 为切换按钮留出空间 */
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.password-input-container input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.password-input-container input:disabled,
.password-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0px;
}

.toggle-password:focus {
    outline: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.checkbox-container label {
    width: 50px;
    min-width: 50px;
    margin-left: 5px;
}

.radio-group {
    display: flex;
    flex: 0 0 auto;
}

.radio-group label {
    margin-right: 10px;
    white-space: nowrap;
}

#gitlab-config .input-row .radio-group label {
    width: 80px;
    min-width: 80px;
}