* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.file-input {
    display: none;
}

#uploadBtn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#uploadBtn:hover {
    background-color: #45a049;
}

.data-display {
    overflow-x: auto;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subtitle {
    text-align: left;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 14px;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.pagination button {
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: #f0f0f0;
    border-color: #999;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination button.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.page-number {
    padding: 5px 10px;
    cursor: pointer;
    margin: 0 2px;
    border-radius: 4px;
    transition: background-color 0.3s;
    border: 1px solid #ddd;
}

.page-number:hover {
    background-color: #e0e0e0;
}

.page-number.active {
    background-color: #4CAF50;
    color: white;
}

.page-ellipsis {
    padding: 5px;
    color: #666;
}

.analysis-section {
    flex: 1;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    th, td {
        padding: 6px;
        font-size: 12px;
    }
}

.indicator-section {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.indicator-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.category {
    display: inline-block;
    margin: 5px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category:hover {
    background-color: #f0f0f0;
}

.category.selected {
    background-color: #4CAF50;
    color: white;
}

.category-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.category-values {
    font-size: 0.9em;
    color: #666;
}

.selected-item {
    display: inline-flex;
    align-items: center;
    margin: 5px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

#selectedData {
    margin: 20px 0;
    padding: 10px;
    border: 1px dashed #ccc;
    min-height: 50px;
}

#analysisResult {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.analysis-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.analysis-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-column h4 {
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table th,
.analysis-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 14px;
}

.analysis-table th {
    background-color: #f2f2f2;
}

.analysis-table td.selected {
    background-color: #e3f2fd;
    color: inherit;
}

.analysis-table td:hover {
    background-color: #f5f5f5;
}

.analysis-table td.selected:hover {
    background-color: #e3f2fd;
}

@media screen and (max-width: 768px) {
    .analysis-grid {
        flex-direction: column;
    }
}

.statistics-section {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.selected-items {
    margin-bottom: 20px;
}

.selected-items h4 {
    margin-bottom: 10px;
    color: #333;
}

.analyze-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.analyze-btn:hover {
    background-color: #45a049;
}

.statistics-result {
    margin-top: 20px;
}

.statistics-result h4 {
    margin-bottom: 10px;
    color: #333;
}

.statistics-table {
    width: 100%;
    margin-top: 10px;
}

.statistics-table th,
.statistics-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.statistics-table th {
    background-color: #f2f2f2;
}

.selected-row {
    padding: 5px;
    border-bottom: 1px dashed #ccc;
}

.selected-row:last-child {
    border-bottom: none;
}

.delete-btn {
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
}

.delete-btn:hover {
    color: #ff4444;
}

#mainTable th,
#mainTable td {
    width: 35px;
    max-width: 35px;
    padding: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mainTable th {
    font-size: 8px;
}

#mainTable td {
    font-size: 10px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.data-section {
    width: 100%;
}

.analysis-section {
    width: 100%;
}

.paste-btn {
    margin-left: 10px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.paste-btn:hover {
    background-color: #45a049;
}

.paste-data-section {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.paste-data-content {
    overflow-x: auto;
}

#pasteDataTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#pasteDataTable th,
#pasteDataTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#pasteDataTable th {
    background-color: #f2f2f2;
}

#pasteDataTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subtitle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.get-numbers-btn {
    padding: 4px 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.get-numbers-btn:hover {
    background-color: #45a049;
}

.external-data-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    padding: 8px 16px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #cc0000;
}

.iframe-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.external-link {
    padding: 20px;
    text-align: center;
}

.data-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.data-link:hover {
    background-color: #45a049;
}

.shrink-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.shrink-btn:hover {
    background-color: #45a049;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.statistics-table th,
.statistics-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.statistics-table th {
    background-color: #f2f2f2;
}

.table-container {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.table-container thead {
    position: sticky;
    top: 0;
    background-color: #f2f2f2;
    z-index: 1;
}

.table-container .analysis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.selectable-analysis {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.selectable-analysis td {
    cursor: default;
}

.selectable-analysis td.selecting,
.selectable-analysis td.selected,
.selectable-analysis td:hover,
.selectable-analysis td.selected:hover {
    cursor: default;
    outline: none;
    background-color: transparent;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 6px 12px;
    margin: 4px 0;
    border-radius: 4px;
}

.pattern-value {
    font-weight: bold;
    color: #2196f3;
}

.pattern-category {
    color: #666;
}

.pattern-remove {
    margin-left: auto;
    cursor: pointer;
    color: #999;
    font-weight: bold;
}

.pattern-remove:hover {
    color: #ff4444;
}

.pattern-display {
    min-height: 60px;
    border: 1px dashed #ccc;
    padding: 8px;
    margin: 10px 0;
    background: #fff;
}

/* 修改五层板块的样式 */
.fifth-layer-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #000;
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.analysis-item {
    border: 1px dotted #000;
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analysis-item h4 {
    margin-bottom: 6px;
    font-weight: normal;
    font-size: 14px;
}

.analysis-table-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-table-layout table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.analysis-table-layout tr {
    height: 40px;
}

.label-cell {
    width: 100px;
    border: 1px solid #000;
    padding: 5px 10px;
    font-size: 14px;
    background-color: #f5f5f5;
    text-align: center;
}

.data-cell {
    border: 1px solid #000;
    padding: 5px 10px;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    text-align: left;
}

.data-cell span {
    display: inline-block;
    margin-right: 3px;
}

.analysis-item {
    border: 1px dotted #000;
    padding: 8px;
    flex: 1;
}

.analysis-item h4 {
    margin-bottom: 6px;
    font-weight: normal;
    font-size: 14px;
}

.analysis-rows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.row-item {
    border: 1px solid #000;
    padding: 4px;
    flex: 1;
    min-height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.analysis-controls {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.analyze-btn {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.analyze-btn:hover {
    background-color: #45a049;
}

.selectable-analysis {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.selectable-analysis td {
    cursor: default;
}

.selectable-analysis td.selecting,
.selectable-analysis td.selected,
.selectable-analysis td:hover,
.selectable-analysis td.selected:hover {
    cursor: default;
    outline: none;
    background-color: transparent;
}

.analysis-table td.selected {
    background-color: transparent;
    color: inherit;
}

.analysis-table td:hover {
    background-color: transparent;
}

.analysis-table td.selected:hover {
    background-color: transparent;
}

/* 添加合并表格的样式 */
.merged-analysis {
    width: 100%;
    overflow-x: auto;
}

.merged-analysis table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.merged-analysis th {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35); /* 总共35列，平均分配宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 20px;
    line-height: 20px;
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 2;
}

.merged-analysis thead tr:first-child th {
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 3;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px;  /* 调整为第一行表头的高度 */
    z-index: 3;
    background-color: #f2f2f2;
}

.merged-analysis thead tr:nth-child(2) th {
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 确保表格内容不会被表头遮挡 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
    transform: translateZ(0);
}

.merged-analysis thead tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px; /* 紧接着第一行表头 */
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr th {
    padding: 0 2px; /* 减小内边距 */
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.merged-analysis tbody {
    margin-top: 40px; /* 为表格内容添加顶部边距，等于两个表头的高度 */
}

.merged-analysis td {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35); /* 总共35列，平均分配宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merged-analysis td.selected {
    background-color: #e3f2fd;
    outline: 2px solid #2196f3;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

.merged-analysis td:hover {
    background-color: #f5f5f5;
}

.merged-analysis td.selected:hover {
    background-color: #e3f2fd;
}

/* 分隔不同分析项的列 */
.merged-analysis th:nth-child(7n) {
    border-right: 2px solid #666;
}

.merged-analysis td:nth-child(7n) {
    border-right: 2px solid #666;
}

/* 表头样式 */
.merged-analysis thead tr:first-child th {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* 调整表格容器的高度和滚动 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

/* 确保表头固定 */
.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
    transform: translateZ(0);
}

/* 调整滚动条样式 */
.table-container.merged-analysis::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container.merged-analysis::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container.merged-analysis::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container.merged-analysis::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 确保表格内容在滚动时不会覆盖表头 */
.table-container.merged-analysis {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* 移除选中提示样式 */
.selection-tip {
    display: none;
}

.selection-tip.show {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0; }
}

/* 优化四层表格性能 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.virtual-scroll-content {
    position: relative;
    width: 100%;
}

.virtual-scroll-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    will-change: transform;
}

.merged-analysis table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
}

.merged-analysis thead tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr th {
    padding: 0 2px;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.merged-analysis tbody {
    display: table-row-group;
}

.merged-analysis tbody tr {
    height: 24px;
}

.merged-analysis td {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #ddd;
    background-color: #fff;
    height: 24px;
    line-height: 24px;
}

/* 移除所有可能导致额外空间的样式 */
.merged-analysis tbody tr:first-child {
    margin-top: 0;
}

.merged-analysis tbody {
    margin-top: 0;
    position: static;
}

/* 调整表格容器的总高度以适应内容 */
.table-container.merged-analysis {
    max-height: calc(300px + 40px); /* 300px + 两行表头的高度 */
    height: auto;
}

/* 四层表头文字显示优化 */
#mergedAnalysis thead th {
    min-width: 90px;
    overflow: visible;
}

.main-category {
    white-space: nowrap;
    max-width: 100px;
    transform: translateX(-50%) scale(0.85);
    letter-spacing: -0.5px;
}

.sub-category span {
    display: inline-block;
    width: 14.28%; /* 100% / 7列 */
    padding: 0 1px;
    transform: scale(0.75);
    transform-origin: center;
    text-align: center;
    letter-spacing: -0.3px;
}
.link-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.link-button:hover {
    background-color: #45a049;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.statistics-table th,
.statistics-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.statistics-table th {
    background-color: #f2f2f2;
}

.selected-row {
    padding: 5px;
    border-bottom: 1px dashed #ccc;
}

.selected-row:last-child {
    border-bottom: none;
}

.delete-btn {
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
}

.delete-btn:hover {
    color: #ff4444;
}

#mainTable th,
#mainTable td {
    width: 35px;
    max-width: 35px;
    padding: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mainTable th {
    font-size: 8px;
}

#mainTable td {
    font-size: 10px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.data-section {
    width: 100%;
}

.analysis-section {
    width: 100%;
}

.paste-btn {
    margin-left: 10px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.paste-btn:hover {
    background-color: #45a049;
}

.paste-data-section {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.paste-data-content {
    overflow-x: auto;
}

#pasteDataTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#pasteDataTable th,
#pasteDataTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#pasteDataTable th {
    background-color: #f2f2f2;
}

#pasteDataTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subtitle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.get-numbers-btn {
    padding: 4px 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.get-numbers-btn:hover {
    background-color: #45a049;
}

.external-data-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    padding: 8px 16px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #cc0000;
}

.iframe-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.external-link {
    padding: 20px;
    text-align: center;
}

.data-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.data-link:hover {
    background-color: #45a049;
}

.shrink-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.shrink-btn:hover {
    background-color: #45a049;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.statistics-table th,
.statistics-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.statistics-table th {
    background-color: #f2f2f2;
}

.table-container {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.table-container thead {
    position: sticky;
    top: 0;
    background-color: #f2f2f2;
    z-index: 1;
}

.table-container .analysis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.selectable-analysis {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.selectable-analysis td {
    cursor: default;
}

.selectable-analysis td.selecting,
.selectable-analysis td.selected,
.selectable-analysis td:hover,
.selectable-analysis td.selected:hover {
    cursor: default;
    outline: none;
    background-color: transparent;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 6px 12px;
    margin: 4px 0;
    border-radius: 4px;
}

.pattern-value {
    font-weight: bold;
    color: #2196f3;
}

.pattern-category {
    color: #666;
}

.pattern-remove {
    margin-left: auto;
    cursor: pointer;
    color: #999;
    font-weight: bold;
}

.pattern-remove:hover {
    color: #ff4444;
}

.pattern-display {
    min-height: 60px;
    border: 1px dashed #ccc;
    padding: 8px;
    margin: 10px 0;
    background: #fff;
}

/* 修改五层板块的样式 */
.fifth-layer-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #000;
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.analysis-item {
    border: 1px dotted #000;
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analysis-item h4 {
    margin-bottom: 6px;
    font-weight: normal;
    font-size: 14px;
}

.analysis-table-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-table-layout table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.analysis-table-layout tr {
    height: 40px;
}

.label-cell {
    width: 100px;
    border: 1px solid #000;
    padding: 5px 10px;
    font-size: 14px;
    background-color: #f5f5f5;
    text-align: center;
}

.data-cell {
    border: 1px solid #000;
    padding: 5px 10px;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    text-align: left;
}

.data-cell span {
    display: inline-block;
    margin-right: 3px;
}

.analysis-item {
    border: 1px dotted #000;
    padding: 8px;
    flex: 1;
}

.analysis-item h4 {
    margin-bottom: 6px;
    font-weight: normal;
    font-size: 14px;
}

.analysis-rows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.row-item {
    border: 1px solid #000;
    padding: 4px;
    flex: 1;
    min-height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.analysis-controls {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.analyze-btn {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.analyze-btn:hover {
    background-color: #45a049;
}

.selectable-analysis {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.selectable-analysis td {
    cursor: default;
}

.selectable-analysis td.selecting,
.selectable-analysis td.selected,
.selectable-analysis td:hover,
.selectable-analysis td.selected:hover {
    cursor: default;
    outline: none;
    background-color: transparent;
}

.analysis-table td.selected {
    background-color: transparent;
    color: inherit;
}

.analysis-table td:hover {
    background-color: transparent;
}

.analysis-table td.selected:hover {
    background-color: transparent;
}

/* 添加合并表格的样式 */
.merged-analysis {
    width: 100%;
    overflow-x: auto;
}

.merged-analysis table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.merged-analysis th {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35); /* 总共35列，平均分配宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 20px;
    line-height: 20px;
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 2;
}

.merged-analysis thead tr:first-child th {
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 3;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px;  /* 调整为第一行表头的高度 */
    z-index: 3;
    background-color: #f2f2f2;
}

.merged-analysis thead tr:nth-child(2) th {
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 确保表格内容不会被表头遮挡 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
    transform: translateZ(0);
}

.merged-analysis thead tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px; /* 紧接着第一行表头 */
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr th {
    padding: 0 2px; /* 减小内边距 */
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.merged-analysis tbody {
    margin-top: 40px; /* 为表格内容添加顶部边距，等于两个表头的高度 */
}

.merged-analysis td {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35); /* 总共35列，平均分配宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merged-analysis td.selected {
    background-color: #e3f2fd;
    outline: 2px solid #2196f3;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

.merged-analysis td:hover {
    background-color: #f5f5f5;
}

.merged-analysis td.selected:hover {
    background-color: #e3f2fd;
}

/* 分隔不同分析项的列 */
.merged-analysis th:nth-child(7n) {
    border-right: 2px solid #666;
}

.merged-analysis td:nth-child(7n) {
    border-right: 2px solid #666;
}

/* 表头样式 */
.merged-analysis thead tr:first-child th {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* 调整表格容器的高度和滚动 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

/* 确保表头固定 */
.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
    transform: translateZ(0);
}

/* 调整滚动条样式 */
.table-container.merged-analysis::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container.merged-analysis::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container.merged-analysis::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container.merged-analysis::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 确保表格内容在滚动时不会覆盖表头 */
.table-container.merged-analysis {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* 移除选中提示样式 */
.selection-tip {
    display: none;
}

.selection-tip.show {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0; }
}

/* 优化四层表格性能 */
.table-container.merged-analysis {
    height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    position: relative;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.virtual-scroll-content {
    position: relative;
    width: 100%;
}

.virtual-scroll-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    will-change: transform;
}

.merged-analysis table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

.merged-analysis thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f2f2f2;
}

.merged-analysis thead tr:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr:nth-child(2) {
    position: sticky;
    top: 20px;
    z-index: 3;
    background-color: #f2f2f2;
    height: 20px;
    line-height: 20px;
}

.merged-analysis thead tr th {
    padding: 0 2px;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.merged-analysis tbody {
    display: table-row-group;
}

.merged-analysis tbody tr {
    height: 24px;
}

.merged-analysis td {
    padding: 2px;
    text-align: center;
    font-size: 12px;
    width: calc(100% / 35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #ddd;
    background-color: #fff;
    height: 24px;
    line-height: 24px;
}

/* 移除所有可能导致额外空间的样式 */
.merged-analysis tbody tr:first-child {
    margin-top: 0;
}

.merged-analysis tbody {
    margin-top: 0;
    position: static;
}

/* 调整表格容器的总高度以适应内容 */
.table-container.merged-analysis {
    max-height: calc(300px + 40px); /* 300px + 两行表头的高度 */
    height: auto;
}

/* 四层表头文字显示优化 */
#mergedAnalysis thead th {
    min-width: 90px;
    overflow: visible;
}

.main-category {
    white-space: nowrap;
    max-width: 100px;
    transform: translateX(-50%) scale(0.85);
    letter-spacing: -0.5px;
}

.sub-category span {
    display: inline-block;
    width: 14.28%; /* 100% / 7列 */
    padding: 0 1px;
    transform: scale(0.75);
    transform-origin: center;
    text-align: center;
    letter-spacing: -0.3px;
}