body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 0; /* Remove body padding, handle spacing with wrapper */
    line-height: 1.6;
    display: flex;
    flex-direction: column; /* Ensure .app-wrapper and #footer stack vertically */
    min-height: 100vh;
    box-sizing: border-box;
}

.app-wrapper { /* New wrapper for main content and sidebar */
    display: flex;
    width: 100%;
    height: 100vh; /* Full viewport height */
    box-sizing: border-box;
    position: relative; /* For potential absolute positioning of sidebar if needed, or just for structure */
    overflow-x: hidden; /* Prevent horizontal scrollbar during transition */
}

/* Container for main content and floating buttons */
.container-wrapper {
    flex-grow: 1;
    position: relative; /* Crucial for positioning buttons relative to this wrapper */
    display: flex; /* To make .container take up available space */
    flex-direction: column; /* Stack .container and potentially other elements */
}

/* 侧边栏触发按钮样式 - 现在相对于 .container-wrapper 定位 */
.sidebar-toggle-button {
    position: absolute; /* Changed from fixed to absolute */
    bottom: 20px;
    right: 20px; /* Will be relative to .container-wrapper */
    width: 50px;
    height: 50px;
    background-color: #3d5aff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Ensure buttons are above content but below sidebar */
    transition: background-color 0.3s ease, bottom 0.3s ease, right 0.3s ease; /* Added right transition */
}

.sidebar-toggle-button:hover {
    background-color: #3451d2;
}

/* 设置按钮位置 (ID specific for clarity) */
#sidebar-toggle-button {
    /* right: 20px; bottom: 20px; are defaults from .sidebar-toggle-button */
}

/* Agent按钮位置 - 在设置按钮上方 (ID specific for clarity) */
#open-agent-button {
    bottom: 80px; /* 20px (settings button bottom) + 50px (settings button height) + 10px (gap) */
    /* right: 20px; is default from .sidebar-toggle-button */
    background-color: #5f84ff; /* 不同的颜色区分 */
}

#open-agent-button:hover {
    background-color: #3653d3;
}


.container { /* Main content area */
    flex-grow: 1;
    background-color: #ffffff;
    padding: 30px; /* Original padding */
    padding-bottom: 200px; /* Increased padding-bottom for background image space, adjust 200px as needed */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto; /* Allow scrolling for main content if it overflows */
    height: 100%; /* Fill height of app-wrapper */
    transition: margin-right 0.3s ease-in-out, width 0.3s ease-in-out; /* 修改过渡属性 */
    width: 100%; /* 初始宽度 */
    /* margin-right will be controlled by JS directly on style for width adjustment */
    background-image: url('images/background.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; /* Or adjust as needed, e.g., auto 150px */
}
/* .app-wrapper.sidebar-visible .container is no longer needed in this form */
/* .container.sidebar-open-content-shift class will be used by JS to adjust mainContainer style.width */

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* Gap between title and settings button */
}

h1 {
    color: #2c3e50;
    text-align: left; /* Align to left as it's part of a flex row now */
    margin-bottom: 0; /* Margin handled by main-header gap or container gap */
    font-size: 2.3rem;
    font-weight: 700;
}

#main-logo {
    max-height: 130px; /* 您可以根据需要调整这个值 */
    margin-top: -3px; /* 适当的顶部间距 */
    margin-left: 20px; /* 适当的左侧间距 */
    margin-bottom: -30px;
    width: auto;
    display: block; /* 如果需要，可以帮助对齐 */
}

/* 通用 Section 样式 */
.settings-section,
.input-section,
.output-section,
.table-generator-section {
    background-color: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    border: 1px solid #e9e9e9;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Consistent gap within sections */
    border-left: 4px solid #4170ffcc; /* 新增蓝色左描边 */
}

h2 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.7rem;
    border-bottom: 2px solid #417ceb;
    padding-bottom: 8px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #5f626b;
    font-size: 1rem;
}

input[type="password"],
textarea,
input[type="text"],
input[type="number"],
select {
    width: 100%; /* Make inputs full width by default */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #417ceb;
    box-shadow: 0 0 8px rgba(65, 124, 235, 0.25);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

button {
    background-color: #417ceb;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    font-weight: 500;
    line-height: 1.5; /* Ensure text is vertically centered */
}

button:hover {
    background-color: #3562d4;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Specific Button Groupings and Alignments */
.settings-section {
    padding: 0; 
    border: none;
    box-shadow: none;
    background-color: transparent;
}
#open-settings-button {
    width: auto; 
}

.input-section {
    gap: 8px; 
}
.description-input-group {
    display: flex;
    align-items: flex-start; 
    gap: 10px;
}
.description-input-group textarea {
    flex-grow: 1; 
    margin-bottom: 0; 
}
.description-input-group #send-description {
    width: auto; 
    flex-shrink: 0; 
}


.section-header-controls {
    display: flex;
    justify-content: space-between; /* Pushes title and button to opposite ends */
    align-items: center; /* Vertically aligns items */
    margin-bottom: 10px; /* 与下方内容的间距 */
}

.section-header-controls h3 {
    margin: 0 10px 0 0; /* Removes default h3 bottom margin, adds right margin */
    font-size: 1.1em; /* Optional: adjust title size if needed */
}

.section-header-controls .inline-button {
    padding: 5px 10px; /* Smaller padding for inline buttons */
    font-size: 0.9em; /* Smaller font size for inline buttons */
    /* Add any other specific styling for these buttons */
}

.section-header-controls h2 {
    margin-bottom: 0; /* 移除h2的默认下边距，因为flex会处理对齐 */
}

.toggle-list-button {
    padding: 5px 10px; /* 调整内边距使按钮更小巧 */
    font-size: 1.2rem; 
    min-width: auto; 
    line-height: 1; 
    padding: 5px 8px; /* Adjusted padding for a smaller icon button */
    background-color: transparent; /* Make it less obtrusive */
    color: #5f626b;
    border: 1px solid #ccc;
}
.toggle-list-button:hover {
    background-color: #e9e9e9;
    color: #333;
}

/* Hide description input when personnel section is collapsed */
.output-section.personnel-collapsed .description-input-group {
    display: none;
}


.personnel-details-area {
    /* 这个区域将包含输入、按钮、加载提示和表格 */
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.personnel-input-area {
    padding: 0; /* 移除内边距，因为它现在是更大区域的一部分 */
    border: none; /* 移除边框 */
    box-shadow: none; /* 移除阴影 */
    background-color: transparent; /* 透明背景 */
    flex-shrink: 0; /* 输入区域不可压缩 */
}

.personnel-controls { /* This is for .output-section .controls */
    display: flex;
    gap: 10px;
    margin-top: 10px; 
    margin-bottom: 10px; 
    flex-shrink: 0; 
}

.personnel-controls button { /* Buttons inside .output-section .controls */
    flex: 1 1 0; /* Allow buttons to grow and shrink equally, basis 0 */
}

/* New style for subheaders with buttons */
.section-subheader-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* Adjust as needed */
}
.section-subheader-with-button h3 {
    margin-bottom: 0; /* Remove bottom margin from h3 inside this container */
    font-size: 1.2rem; /* Consistent with other similar h3s */
    color: #34495e;
}
/* .inline-button class is already styled and should work here */

.loading-indicator#loading-personnel {
    text-align: center;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-bottom: 10px;
    flex-shrink: 0; /* 加载指示器不可压缩 */
}

.import-personnel-section {
    margin-top: 10px !important; /* 减少与上方表格的距离 */
    padding-top: 10px !important;
    flex-shrink: 0; /* 导入区域不可压缩 */
}

.import-personnel-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.import-personnel-section button#import-personnel-button {
    align-self: flex-end; 
    width: auto;
}

.import-seat-table-section { 
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px; 
    padding-top: 20px; 
    border-top: 1px solid #eee;
    flex-shrink: 0; /* 导入座位表区域不可压缩 */
}
.import-seat-table-section h3 {
    margin-top: 0;
    margin-bottom: 5px; 
    font-size: 1.2rem; 
    color: #34495e;
}
.import-seat-table-section textarea {
    min-height: 80px; 
}
.import-seat-table-section button {
    align-self: flex-end;
    width: auto;
}

.seat-modification-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0; /* 座位修改区域不可压缩 */
}
.seat-modification-section h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: #34495e;
}
.seat-modification-section p {
    font-size: 0.9rem;
    color: #5f626b;
    margin-top: 0;
    margin-bottom: 5px;
}
.seat-modification-section textarea {
    min-height: 60px; 
}
.seat-modification-section button {
    align-self: flex-end;
    width: auto;
}
#seat-modification-output {
    position: relative; /* Ensure this is a positioning context for the GIF */
    font-size: 0.9rem;
    white-space: pre-wrap; 
    padding: 15px; /* Added padding to match thinking output */
    background-color: transparent; /* Added background to match thinking output */
    border: 2px dashed #cccccc; /* Changed border to match thinking output */
    border-radius: 8px; /* Added border-radius to match thinking output */
    margin-top: 10px; /* Added margin-top to match thinking output */
    flex-shrink: 0; /* 座位修改输出区域不可压缩 */
    /* display: none; /* Initial state if needed, then controlled by JS */
    /* opacity: 0; /* Initial state if needed, then controlled by JS */
    /* transition: opacity 0.3s ease-in-out; /* Transition if needed */
}


.table-generator-section .generator-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    flex-shrink: 0; /* 控制区域不可压缩 */
}
.table-generator-section .generator-controls label {
    margin-bottom: 0; 
}
.table-generator-section .generator-controls input[type="number"] {
    width: 70px; 
    margin-bottom: 0; 
}
.table-generator-section .generator-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-shrink: 0; /* 按钮区域不可压缩 */
}
.table-generator-section .generator-buttons button {
    flex-grow: 1; 
}


.table-generator-section .arrangement-section {
    display: flex;
    flex-direction: row; 
    gap: 20px; 
    align-items: flex-start; /* 改回 flex-start，允许内容决定自身高度，避免被拉伸 */
    flex-shrink: 0; /* 编排区域不可压缩 */
}

.arrangement-remarks-wrapper, 
#seat-modification-section {
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: 10px; 
    padding: 15px; 
    border: 1px solid #e0e0e0; 
    border-radius: 8px; 
    background-color: #f9f9f9; 
    min-width: 0;
    /* 移除 align-items: stretch; 如果之前有的话，或确保其不影响内部对齐 */
}

/* 确保这些包装器内的标签和文本区域行为正确 */
.arrangement-remarks-wrapper .section-title-button-group,
#seat-modification-section .section-title-button-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline; /* 修改对齐方式为基线对齐 */
    margin-bottom: 8px; /* 标题组和下方文本框的间距 */
}

.arrangement-remarks-wrapper .section-title-button-group label,
#seat-modification-section .section-title-button-group h3 {
    margin-top: 0; /* 确保顶部无外边距 */
    margin-bottom: 0; /* 移除label/h3自身的下边距，由父级控制 */
    font-weight: 600;
    font-size: 1.1rem; /* 统一标题字体大小 */
    color: #34495e;   /* 统一标题颜色 */
    line-height: 1.5; /* 统一行高 */
    padding-top: 5px; /* 添加一些内边距以帮助对齐 */
    padding-bottom: 5px; /* 添加一些内边距以帮助对齐 */
}

#seat-modification-section .section-title-button-group h3 {
    /* 如果需要更细致的调整h3使其看起来和label完全一样，可以在这里添加，但通常font-weight, size, color已足够 */
}

.inline-button { /* 新增：用于标题旁边按钮的样式 */
    padding: 6px 12px;
    font-size: 0.9rem;
    margin-left: 10px; /* 按钮和标题的间距 */
    flex-shrink: 0; /* 防止按钮被压缩 */
    align-self: center; /* 尝试让按钮在交叉轴居中，配合 baseline 可能有帮助 */
}


.arrangement-remarks-wrapper textarea,
#seat-modification-section textarea {
    width: 100%; 
    box-sizing: border-box; /* padding和border包含在宽度内 */
    min-height: 90px; /* 一致的最小高度 */
}

/* 如果之前#seat-modification-section有特定的边距/内边距/边框覆盖，现在移除它们，除非确实需要 */
#seat-modification-section {
    padding: 15px; /* 确保内边距一致 */
    border: 1px solid #e0e0e0; /* 确保边框一致 */
    border-radius: 8px;
    background-color: #f9f9f9;
}

/* ai-arrange-button 现在在 generator-buttons 中，此规则可能不再直接适用或需要调整 */
/* .table-generator-section .arrangement-section button#ai-arrange-button {
    width: 100%; 
    margin-top: 5px; 
} */


/* Output Areas */
#markdown-output, #table-preview {
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    background-color: #ffffff;
    min-height: 120px; /* Base min-height, specific overrides might apply */
    overflow-x: auto; 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#markdown-output {
    /* 这里可以添加特定于markdown输出的样式 */
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    /* 覆盖通用样式中的min-height */
    min-height: 0 !important;
}

/* Specific styles for #table-preview to handle vertical growth and scrolling */
#table-preview {
    position: relative; /* Ensure this is a positioning context for the GIF */
    /* flex-grow: 1; Removed as per new requirement */
    /* overflow-y: auto; Removed to allow content to define height */
    /* min-height: 0; Removed to allow content to define height */
    display: flex; 
    flex-direction: column;
    flex-shrink: 0; /* 确保表格预览区域不会被压缩 */
    /* overflow-x: auto; is handled by a more general rule below if needed */
}

/* Markdown Table Styles */
#markdown-output table, #table-preview table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border: 1px solid #ddd; /* Default border for all sides */
    border-radius: 6px;
    border-right: 3px solid rgb(132 180 255 / 70%); /* Deep blue, 50% opacity */
    border-bottom: 3px solid rgb(132 180 255 / 70%); /* Deep blue, 50% opacity */
    /* Adjust padding if border makes content too close to edge, or use box-sizing: border-box if not already default for tables */
}

#markdown-output th, #markdown-output td, #table-preview th, #table-preview td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
#markdown-output td:not(:last-child), #table-preview td:not(:last-child) {
    border-right: 1px solid #eee; 
}


#markdown-output th, #table-preview th {
    background-color: #f8f9fa;
    font-weight: 600; 
    color: #454d55; 
    border-bottom: 2px solid #dee2e6; 
}
#markdown-output th:not(:last-child), #table-preview th:not(:last-child) {
    border-right: 1px solid #dee2e6; 
}


#markdown-output tr:last-child td, #table-preview tr:last-child td {
    border-bottom: none;
}

#markdown-output tr:nth-child(even) td, #table-preview tr:nth-child(even) td {
    background-color: #f9f9f9; 
}

/* Layout for Output and Table Generator */
.content-wrapper {
    display: flex; 
    gap: 30px;
    align-items: flex-start; /* Allow children to determine their own height */
    flex-grow: 1; /* Allow it to take available vertical space in .container */
    min-height: 0; /* Important for a flex item that grows, to allow shrinking if needed */
    /* overflow: hidden; /* Consider if clipping is desired for the wrapper itself */
}

.output-section {
    /* display: flex; flex-direction: column; is already set by generic section styles */
    flex: 1 1 50%; /* grow, shrink, basis - for 50/50 split when not collapsed */
    min-width: 320px; /* Keep a min-width for responsiveness */
    transition: width 0.3s ease-in-out, min-width 0.3s ease-in-out, padding 0.3s ease-in-out, flex 0.3s ease-in-out; /* Updated transition */
    overflow-y: auto; /* 人员信息表在空间不足时显示滚动条 */
    align-self: stretch; /* Make output-section stretch to the height of table-generator-section */
}

.table-generator-section {
    flex: 1 1 50%; /* grow, shrink, basis - for 50/50 split when not collapsed */
    min-width: 320px;
    transition: flex 0.3s ease-in-out; /* Updated transition */
    /* display: flex; flex-direction: column; is already set by generic section styles */
}


@media (max-width: 767px) { 
    .content-wrapper {
        flex-direction: column;
    }
    .output-section, .table-generator-section {
        width: 100%; 
        flex-basis: auto; 
        min-height: auto; /* Reset min-height for stacked view if 800px is too much */
    }
    .output-section {
        min-height: 400px; /* Or a more suitable min-height for mobile */
    }
}


#ai-thinking-output,
.personnel-thinking-output,
.seat-modify-thinking-output {
    position: relative; /* Ensure this is a positioning context for the GIF */
    padding: 15px;
    background-color: transparent; 
    border: 2px dashed #cccccc; 
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 15px; /* 为移动后的元素添加底部外边距 */
    display: none; 
    opacity: 0; 
    transition: opacity 0.3s ease-in-out;
    flex-shrink: 0; /* 思考过程区域不可压缩 */
}

.thinking-output-visible { 
    display: block !important;
    opacity: 1 !important;
}

#ai-thinking-output h3,
.personnel-thinking-output h3,
.seat-modify-thinking-output h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #5f626b; 
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

#ai-thinking-output pre,
.personnel-thinking-output pre,
.seat-modify-thinking-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    /* New/Modified properties */
    overflow-x: auto; /* Add horizontal scroll if content is too wide */
    max-width: 100%; /* Ensure pre does not exceed its container's width */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    /* End New/Modified properties */
    background-color: transparent;
    padding: 10px;
    border-radius: 6px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #777777; 
    border: none; 
    opacity: 0;
    animation: fadeInText 0.3s ease-in-out forwards;
    animation-delay: 0.1s; 
}

@keyframes fadeInText {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Agent Thinking Output - similar to other thinking outputs */
.agent-thinking-output {
    padding: 10px 15px; /* Consistent with other thinking outputs but might need adjustment based on sidebar context */
    background-color: transparent; 
    border: 2px dashed #cccccc; 
    border-radius: 8px;
    margin-bottom: 10px; /* Space before chat messages */
    display: none; 
    opacity: 0; 
    transition: opacity 0.3s ease-in-out;
    flex-shrink: 0; /* 思考过程区域不可压缩 */
    overflow-x: hidden; /* Prevent horizontal overflow from children */
}
.agent-thinking-output.thinking-output-visible { /* To show it */
    display: block !important;
    opacity: 1 !important;
}
.agent-thinking-output h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem; /* Slightly smaller for sidebar context */
    color: #5f626b; 
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}
.agent-thinking-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 100px; /* Smaller max-height for sidebar */
    overflow-y: auto;
    background-color: transparent; 
    padding: 8px;
    border-radius: 6px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.85rem; /* Smaller font for sidebar */
    color: #777777; 
    border: none; 
    opacity: 0;
    animation: fadeInText 0.3s ease-in-out forwards;
    animation-delay: 0.1s; 
}


/* Styles for special seat modification commands */
.seat-mod-command {
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}
.seat-mod-swap { background-color: #e6f3ff; color: #0056b3; border: 1px solid #b3d9ff; } 
.seat-mod-move { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } 
.seat-mod-empty { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } 
.seat-mod-fill { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; } 
.seat-mod-error { background-color: #f8d7da; color: #721c24; font-weight: normal; } 
.seat-mod-message { color: #5f626b; font-style: italic; } 


.model-trigger:hover,
.custom-select-trigger:hover {
 background-color: #b3d9ff;
}

/* Footer */
#footer {
    text-align: center;
    padding: 15px;
    background-color: #34495e;
    color: #ecf0f1;
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: auto; 
}

#footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #181818; /* Changed color */
}

#footer a {
    color: #417ceb;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

/* Sidebar Styles */
.sidebar {
    width: 350px; 
    height: 100vh; 
    position: fixed; 
    top: 0;
    right: -350px; 
    background-color: #fdfdfd;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1); 
    z-index: 1000; 
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: right 0.3s ease-in-out, margin-right 0.3s ease-in-out; /* Added margin-right transition */
    flex-shrink: 0;
}

.sidebar.open {
    right: 0;
}

/* This class will be added to .container when a sidebar is open to adjust its width */
.container.sidebar-open-content-shift {
    /* width: calc(100% - 350px); /* This will be set by JavaScript */
    /* margin-right: 350px; /* This might still be needed if buttons are outside .container but inside .container-wrapper */
}


.sidebar-header {
    display: flex;
    /* justify-content: space-between; /* Adjusted for new close button */
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #417ceb;
    margin-bottom: 0;
    /* position: relative; /* Ensure header can be a positioning context if needed, but button is now outside */
}

.close-sidebar-button {
    position: absolute;
    top: 25px; /* Vertically align with header text */
    right: 20px; /* Position to the top-right */
    background: transparent;
    border: none;
    color: #5f626b;
    font-size: 28px; /* Size of the '×' character */
    font-weight: bold;
    line-height: 1; /* Ensure tight vertical fit */
    padding: 0;
    cursor: pointer;
    z-index: 1005; 
}

.close-sidebar-button:hover {
    color: #000;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.4rem; 
    color: #34495e;
    border-bottom: none;
    padding-bottom: 0;
    /* flex-grow: 1; /* Optional: if title needs to expand */
}

.sidebar .close-button { /* This rule seems to be for a different close button, keeping it for now but the new one is .close-sidebar-button */
     color: #999;
     font-size: 26px;
     font-weight: bold;
     cursor: pointer;
     padding: 0 5px; 
}
.sidebar .close-button:hover {
    color: #333;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px; 
}

/* Agent对话界面样式 */
.agent-chat-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative; /* Needed for ::before positioning */
    overflow: hidden; /* To contain the pseudo-element if it's larger */
}

.agent-chat-section::before {
    content: "";
    position: absolute;
    bottom: 190px;  /* 显著向上移动，使其底部在输入框附近 */
    right: -150px; /* 配合cover和新的宽高调整 */
    width: 400px;   /* 调整伪元素尺寸 */
    height: 390px;  /* 调整伪元素尺寸 */
    background-image: url('images/logo.png');
    background-repeat: no-repeat;
    background-size: cover; /* 改为cover以填充并消除白边，可能会裁剪 */
    opacity: 0.3;
    z-index: -1; /* 置于父元素背景之下 */
    pointer-events: none; /* 确保不干扰点击 */
}

.agent-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.agent-chat-messages {
    position: relative; /* Ensure this is a positioning context for the GIF */
    flex-grow: 1;
    /* border: 1px solid #e0e0e0; Removed border */
    /* border-radius: 8px; Removed border-radius */
    padding: 0; /* Adjusted padding, or remove if handled by individual messages */
    /* background-color: #f8f9fa; Removed background, will inherit from sidebar-content */
    overflow-y: auto;
    margin-bottom: 15px; /* Keep space before input area */
    display: flex;
    flex-direction: column; 
    gap: 12px;
    position: relative; /* Ensure messages are above the ::before pseudo-element of parent */
    z-index: 1;
}

.agent-message {
    padding: 12px 15px; /* Increased padding */
    border-radius: 10px; /* More rounded corners */
    position: relative;
    max-width: 85%; /* Messages don't take full width */
    word-wrap: break-word; /* Ensure long words break */
    line-height: 1.5;
}

.agent-message.user-message {
    background-color: #e2f0d9; /* 用户消息背景 - 浅绿色 */
    border: 1px solid #c3e6cb;
    color: #155724;
    align-self: flex-end; /* 用户消息靠右 */
    border-left: none; 
    border-right: 4px solid #28a745; /* 右侧绿色强调线 */
    margin-left: auto; 
    margin-right: 5px; 
}

.agent-message.agent-message-assistant, 
.agent-message.assistant-message { 
    background-color: #d1e7fd; /* Agent消息背景 - 浅蓝色 */
    border: 1px solid #b8daff;
    color: #0c5460;
    align-self: flex-start; /* Agent消息靠左 */
    border-right: none; 
    border-left: 4px solid #007bff; /* 左侧蓝色强调线 */
    margin-right: auto; 
    margin-left: 5px; 
}
.agent-message.agent-message-error, /* For error messages from agent */
.agent-message.error-message {
    background-color: #f8d7da; /* Light red for errors */
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-left: 4px solid #dc3545; /* Red accent */
    align-self: flex-start;
    margin-right: auto;
    margin-left: 5px;
}


.agent-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px; /* Space between header and content */
    font-size: 0.85rem;
    color: #5f626b;
}
.agent-message-header strong {
    font-weight: 600;
}
.agent-message-time {
    font-size: 0.75rem;
    color: #777;
}

.agent-message-content {
    /* margin-bottom: 5px; Handled by agent-message padding */
    /* line-height: 1.5; Moved to .agent-message */
    /* word-wrap: break-word; Moved to .agent-message */
}


.agent-chat-input-area {
    flex-shrink: 0;
    position: relative; /* Ensure it's above the ::before pseudo-element */
    z-index: 1;         /* Ensure it's above the ::before pseudo-element */
    padding-top: 15px; /* Add some space above input area */
    border-top: 1px solid #e0e0e0; /* Separator line */
    background-color: #fdfdfd; /* Match sidebar background */
    margin: 0 -20px -20px -20px; /* Extend to sidebar edges */
    padding: 15px 20px 20px 20px; /* Inner padding */
}

.agent-chat-input-area textarea {
    margin-bottom: 10px;
    resize: vertical;
    min-height: 70px; /* Slightly taller input */
    border-radius: 8px; /* Rounded corners for textarea */
    border: 1px solid #ced4da;
    padding: 10px;
}
.agent-chat-input-area textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.agent-chat-input-buttons {
    display: flex;
    gap: 10px;
    /* justify-content: flex-end; /* Removed to allow buttons to fill width */
}

.agent-chat-input-buttons button {
    flex: 1 1 0; /* Allow buttons to grow and shrink equally */
    padding: 8px 15px; 
    font-size: 0.95rem;
}

/* Specific button styling if needed, e.g., for primary send button */
#agent-send-button {
    background-color: #007bff; /* Blue send button */
}
#agent-send-button:hover {
    background-color: #0056b3;
}
#agent-clear-button {
    background-color: #6c757d; /* Grey clear button */
}
#agent-clear-button:hover {
    background-color: #545b62;
}


/* Agent配置区域样式 - Kept for now, but not primary focus of this change */
.agent-config-section {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.agent-config-section textarea {
    min-height: 80px;
}

.agent-config-section input[type="number"] {
    width: 100px;
}

/* Ensure primary and secondary button classes are available if used by agent controls */
.primary-button { /* General primary button style if needed elsewhere */
    background-color: #007bff;
}
.primary-button:hover {
    background-color: #0056b3;
}
.secondary-button { /* General secondary button style */
    background-color: #6c757d;
}
.secondary-button:hover {
    background-color: #5a6268;
}

.active-config-display {
    background-color: #e9f5ff;
    border: 1px solid #b3d9ff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0056b3;
}
.active-config-display p { margin: 0; font-weight: 500; }
.active-config-display strong { color: #004085; }

.config-item-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between; 
}
.config-item-header h3 {
    margin: 0; 
    display: flex;
    align-items: center;
    gap: 8px; 
    font-size: 1.1rem;
    color: #34495e;
}
.collapse-icon {
    font-size: 0.8em;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.model-config-item.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.model-config-item > .config-item-content { 
    max-height: 1000px; 
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 10px; 
    padding-bottom: 10px;
    margin-top: 10px; 
}

.model-config-item.collapsed > .config-item-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
.active-indicator {
    font-size: 0.8rem;
    color: #27ae60;
    font-weight: bold;
    margin-left: auto; 
}


.deepseek-quick-config, #model-configs-list {
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.deepseek-quick-config:first-child, #model-configs-list:first-child {
     border-top: none;
     padding-top: 0;
}


.deepseek-quick-config h3 { 
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #34495e;
}

.model-config-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.3s ease;
}
.model-config-item.active-config {
    border-color: #27ae60; 
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.3);
}

.config-item-content { 
    display: flex;
    flex-direction: column;
    gap: 10px; 
}


.model-config-item label {
    margin-bottom: 3px; 
    font-weight: 500; 
}

.model-config-item input[type="text"],
.model-config-item input[type="password"],
.model-config-item select {
    width: 100%; 
    padding: 8px;
    margin-bottom: 5px; 
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-size: 1rem; 
    color: #333; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}
.custom-select-trigger::after { 
    content: '▼';
    font-size: 0.7em;
    margin-left: 8px;
}
.custom-select-wrapper.open .custom-select-trigger::after {
    content: '▲';
}

.custom-select-dropdown {
    display: none; 
    position: absolute;
    top: 100%; 
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none; 
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1050; 
    padding: 8px;
    box-sizing: border-box;
}
.custom-select-wrapper.open .custom-select-dropdown {
    display: block;
}

.custom-select-dropdown .model-search-input { 
    width: 100%;
    padding: 8px;
    margin-bottom: 8px; 
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.custom-select-dropdown .model-search-input:focus {
    border-color: #417ceb;
    box-shadow: 0 0 6px rgba(65, 124, 235, 0.2);
    outline: none;
}

.custom-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px; 
    overflow-y: auto;
}

.custom-options-list li {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 4px;
}

.custom-options-list li:hover,
.custom-options-list li.selected { 
    background-color: #d6eaff; /* 改为浅蓝色 */
}
.custom-options-list li.hidden-by-search {
    display: none;
}


.model-config-item .models-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.model-item {
    border: 1px dashed #ccc;
    padding: 10px;
    border-radius: 6px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.model-item label { font-weight: normal; color: #666; }
.model-item input[type="text"], .model-item select { padding: 7px; margin-bottom: 5px; }
.model-item select[multiple] { height: 70px; }

.model-config-item .config-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.model-config-item .config-actions button {
    flex-grow: 1;
    padding: 8px 10px;
    font-size: 0.9rem;
}

button.primary-button { background-color: #417ceb; }
button.primary-button:hover { background-color: #3562d4; }
button.primary-button:disabled { background-color: #d7dffc; color: #777; }


button.secondary-button { background-color: #9fafc0; }
button.secondary-button:hover { background-color: #7f8c8d; }

button.danger-button { background-color: #e74c3c; }
button.danger-button:hover { background-color: #c0392b; }

.model-item button.remove-model, 
.model-config-item button.add-model, 
#add-model-config, 
.deepseek-quick-config button { 
    width: 100%; 
    padding: 9px;
    font-size: 0.95rem;
}
.model-item button.remove-model { background-color: #e74c3c; }
.model-item button.remove-model:hover { background-color: #c0392b; }


.model-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.model-list-controls h4 { margin: 0; font-size: 1rem; }
.model-list-controls .fetch-models {
     padding: 6px 10px;
     background-color: #5bc0de;
     color: white;
     font-size: 0.9rem;
     width: auto; 
}
.model-list-controls .fetch-models:hover { background-color: #46b8da; }


/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px 10px; 
        gap: 20px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .input-section #send-description,
    .output-section .controls,
    .table-generator-section .generator-buttons,
    .table-generator-section .arrangement-section, /* Changed from .arrangement-controls */
    .table-generator-section #copy-arranged-table { /* This ID might be inside .generator-buttons now */
        flex-direction: column; 
        align-items: stretch; 
    }
    .input-section #send-description,
    .table-generator-section .arrangement-section button, /* Target button inside .arrangement-section */
    .table-generator-section #copy-arranged-table {
        width: 100%; 
    }
    .output-section .controls button {
        flex-grow: 0; 
    }
     .table-generator-section .generator-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .table-generator-section .generator-controls input[type="number"] {
        width: 100%;
    }
}

/* In-page Notification Area */
#in-page-notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000; /* Ensure it's above most other content */
    width: 300px; /* Or max-width, adjust as needed */
}

/* Individual Notification Styling */
.in-page-notification {
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #fff; /* Default text color, can be overridden by type */
}

.in-page-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Notification Types */
.in-page-notification.info {
    background-color: #17a2b8; /* Bootstrap info color */
    border-left: 5px solid #117a8b;
}

.in-page-notification.success {
    background-color: #28a745; /* Bootstrap success color */
    border-left: 5px solid #1e7e34;
}

.in-page-notification.warning {
    background-color: #ffc107; /* Bootstrap warning color */
    color: #212529; /* Darker text for yellow background */
    border-left: 5px solid #d39e00;
}

.in-page-notification.error {
    background-color: #dc3545; /* Bootstrap danger color */
    border-left: 5px solid #bd2130;
}


/* Dark mode scrollbar styling */
/* Scrollbar Styles */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #aaa; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* Gender coloring - already present, kept for completeness */
.gender-male { background-color: #e6f3ff; }
.gender-female { background-color: #ffe6f2; }

/* Personnel List Collapsing Styles */
.personnel-list-wrapper {
    position: relative; /* Ensure this is a positioning context for the GIF */
    transition: width 0.3s ease-in-out, padding 0.3s ease-in-out;
    overflow: hidden; 
    width: 100%; 
    flex-grow: 1; /* Allow wrapper to grow to fill .output-section */
    overflow-y: auto; /* Always allow scroll if content overflows */
    min-height: 0; /* Important for flex item to shrink correctly */
    display: flex;
    flex-direction: column;
}

.output-section:not(.personnel-collapsed) .personnel-list-wrapper {
    /* flex-grow: 1; Already set above */
    /* overflow-y: auto; Already set above */
    overflow-x: visible; 
    /* min-height: 0; Already set above */
}

.output-section.personnel-collapsed .personnel-list-wrapper {
    /* width: 100%; Already set by general .personnel-list-wrapper */
    padding: 0; 
    /* overflow-y: auto; Already set by general .personnel-list-wrapper */
    /* flex-grow: 1; Already set by general .personnel-list-wrapper */
    /* min-height: 0; Already set by general .personnel-list-wrapper */
}


.output-section.personnel-collapsed {
    width: 110px; /* Increased width */
    max-width: 120px; /* Consistent with new width */
    min-width: 100px; /* Consistent with new width, or adjust as needed */
    padding: 10px 5px; /* Adjusted padding slightly */
    flex: 0 0 150px; /* Do not grow, do not shrink, basis is 150px */
    min-height: 100px; /* Explicit small min-height when collapsed */
    /* min-height: 800px; will apply unless overridden by media query */
}

/* Styles for the new div-based list in collapsed mode */
.output-section.personnel-collapsed .personnel-list-wrapper #markdown-output .personnel-item {
    padding: 8px 5px;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    position: relative; 
    border-bottom: 1px solid #eee; 
}
.output-section.personnel-collapsed .personnel-list-wrapper #markdown-output .personnel-item:last-child {
    border-bottom: none;
}
.output-section.personnel-collapsed .personnel-list-wrapper #markdown-output .personnel-item-empty {
    padding: 8px 5px;
    font-size: 0.9em;
    color: #777;
    text-align: center;
}


/* Tooltip for collapsed view (now targets .personnel-item) - REMOVED */
/*
.output-section.personnel-collapsed .personnel-list-wrapper #markdown-output .personnel-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 105%; 
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: pre-wrap; 
    z-index: 1001; 
    margin-left: 5px; 
    min-width: 150px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; 
    display: block !important; 
    opacity: 1 !important; 
    visibility: visible !important; 
}
*/

/* Hide input area and controls except the toggle button when collapsed */
.output-section.personnel-collapsed .personnel-input-area {
    display: none;
}
.output-section.personnel-collapsed .personnel-controls {
    display: none;
}
.output-section.personnel-collapsed .loading-indicator {
    display: none;
}
.output-section.personnel-collapsed .personnel-thinking-output {
    display: none;
}
.output-section.personnel-collapsed .import-personnel-section {
    display: none;
}
.output-section.personnel-collapsed .controls button:not(#toggle-personnel-list) {
    display: none;
}
.output-section.personnel-collapsed .controls {
    justify-content: center; 
}
.output-section.personnel-collapsed h2,
.output-section.personnel-collapsed .import-personnel-section { 
    display: none;
}
.output-section.personnel-collapsed #loading { 
    display: none !important;
}

/* Styles for table cells in expanded view (if tooltip is also desired there on name) */
#markdown-output table td:first-child {
    position: relative; 
}
/* Optional: Tooltip for expanded view table cells (if desired) - REMOVED */
/*
#markdown-output table td:first-child:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0; 
    top: 100%; 
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: pre-wrap; 
    z-index: 1001; 
    margin-top: 2px; 
    min-width: 200px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; 
    display: block !important; 
    opacity: 1 !important; 
    visibility: visible !important; 
}
*/
/* Add word-wrap for table cells, especially remarks, to prevent overflow */
#markdown-output td {
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}


/* Adjust table generator section when personnel list is collapsed */
.content-wrapper.personnel-list-collapsed .table-generator-section { /* 确保此规则存在且正确 */
    flex-grow: 1;
    flex-shrink: 1; /* Allow shrinking if needed */
    flex-basis: auto; /* Take up remaining space */
    width: auto; /* Let flexbox determine width */
}

/* Removed .content-wrapper:not(.personnel-list-collapsed) .table-generator-section rule as it's handled by the default .table-generator-section flex property */


/* Ensure the controls button for toggle has appropriate styling if needed */
#toggle-personnel-list {
    min-width: 80px; 
}
.output-section.personnel-collapsed #toggle-personnel-list {
    width: 100%; 
    padding: 10px 5px; 
}

/* Style for original seat number background */
.original-seat-number-bg {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.65em; 
    color: rgba(0, 0, 0, 0.25); 
    z-index: 0; 
    pointer-events: none; 
    font-weight: bold;
}

#table-preview td { 
    position: relative;
}

/* Streaming GIF styles */
.streaming-gif {
    position: absolute;
    width: 30px; /* Smaller size */
    height: 30px; /* Smaller size */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, top 0.1s linear, left 0.1s linear; /* Smooth movement */
    pointer-events: none; /* So it doesn't interfere with mouse events */
    z-index: 10;
    /* transform: translate(-50%, -50%); /* Removed for simpler positioning */
}

.streaming-gif.thinking-mode {
    bottom: 5px;
    left: 5px;
    transform: none; /* Override transform for this mode */
}

.streaming-gif.visible {
    display: inline-block;
    opacity: 1;
}

.streaming-cursor {
    display: inline; /* Use inline to follow text flow naturally */
    width: 0;
    height: 0;
    /* No visible properties needed, it's just a marker */
}

.agent-message.system-notification-message {
    background-color: #f0f0f0; /* 浅灰色背景 */
    border: 1px solid #cccccc;
    color: #333333; /* 深灰色文字 */
    align-self: center; /* 系统消息居中对齐 */
    max-width: 90%; /* 可以比用户/Agent消息更宽 */
    margin-top: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #777777; /* 中性强调色 */
}

.agent-message.system-notification-message .agent-message-header strong {
    color: #555555; /* 系统通知标签颜色稍深 */
}

.agent-message.system-notification-message .agent-message-content {
    font-style: italic; /* 系统通知内容使用斜体 */
    color: #444444;
}
/* --- 新增：座位表模式切换 --- */
.tabs {
    display: flex;
    margin-left: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.tab-button {
    padding: 6px 12px;
    cursor: pointer;
    background-color: #f0f0f0;
    border: none;
    border-left: 1px solid #ccc;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.tab-button:first-child {
    border-left: none;
}

.tab-button.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.tab-button:not(.active):hover {
    background-color: #e0e0e0;
}

/* --- 新增：自定义座位表格 --- */
.custom-seat-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 让单元格等宽 */
}

.custom-cell {
    border: 1px solid #ccc;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.8em;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* 修复BUG 4b: 统一悬停效果，并提高选择器特异性以覆盖偶数行样式 */
#table-preview .custom-cell:not(.remark-cell):hover {
    background-color: #d4edda !important; /* 使用更明显的绿色，并使用 !important 确保覆盖 */
}

/* 修复BUG 4b: 移除座位单元格的蓝色背景，使其与普通单元格背景一致 */
.custom-cell.seat-cell {
    /* background-color: #e6f3ff; */ /* 已移除蓝色背景 */
    font-weight: bold; /* 让座位号或人名更突出 */
}

.custom-cell.remark-cell {
    background-color: #f5f5f5;
    font-style: italic;
    color: #555;
    font-size: 0.9em;
}

.seat-id {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.8em;
    color: #888;
}

.seat-name {
    font-weight: bold;
    font-size: 1.1em;
}

/* --- 新增：自定义上下文菜单 --- */
#custom-seat-context-menu {
    position: fixed;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
    font-size: 0.9em;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
}

.context-menu-item:hover {
    background-color: #f0f0f0;
}
/* --- 修正：生成器控件并排显示 --- */
.generator-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.generator-controls label {
    margin-right: 5px;
}

.generator-controls input[type="number"] {
    width: 60px; /* 给予一个固定的宽度 */
}
/* --- 修正：生成器控件并排显示 --- */
.generator-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.generator-controls label {
    margin-right: 5px;
}

.generator-controls input[type="number"] {
    width: 60px; /* 给予一个固定的宽度 */
}

.remark-input {
    width: 90%;
    padding: 5px;
    box-sizing: border-box;
}

.custom-cell.selected {
    background-color: #b3d9ff !important; /* A distinct selection color */
    border-color: #007bff;
    box-shadow: inset 0 0 0 2px #007bff;
}