.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tag-group {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.group-header {
    margin-bottom: 15px;
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px); /* 根据容器宽度自动计算列数 */
    grid-template-rows: repeat(3, auto); /* 固定3行 */
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 120px;
    max-height: 150px; /* 限制高度确保3行 */
    overflow: hidden; /* 超出部分隐藏 */
}

.tag {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
    width: 120px; /* 6个汉字的宽度 */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.5;
    height: 32px; /* 固定高度 */
}

.tag:hover {
    background-color: #e9ecef;
}

.tag.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.pagination {
    display: flex;
    align-items: center;
    margin: 0;
}

.control-panel {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-input {
    width: 120px;
    padding: 5px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    height: 32px;
}

.btn-sm {
    height: 32px;
    line-height: 1;
    padding: 0 10px;
}

.progress-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
}

.progress-log {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    padding: 10px;
    margin-top: 15px;
    font-family: monospace;
}

.error {
    color: red;
}

.page-info {
    line-height: 31px;
}

/* 关系图样式 */
.relation-block {
    margin-top: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.relation-container {
    width: 100%;
    height: 400px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 15px;
}

/* D3关系图样式 */
.node text {
    font-size: 16px; /* 增大字体 */
    font-weight: bold;
}

.link {
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 1px;
}

.link-label {
    font-size: 14px; /* 增大字体 */
    fill: #666;
    font-weight: bold;
}