body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    padding-top: 50px;
}

.container {
    width: 100%;
    max-width: 600px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box {
    position: relative;
    width: 100%;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

/* User specified styles mostly start here */
.tag-suggestions {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

/* 1. 修改父级容器：取消分散对齐 */
.suggestion-item {
    display: flex;
    /* justify-content: space-between;  <-- 删除或注释掉这一行 */
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

/* 2. 修改名称容器：让它占据左侧剩余的所有空间 */
.suggestion-item > div:first-child {
    flex: 1; /* 这会把 post-count 和按钮推向右侧 */
}

/* 3. 设置 post-count：与按钮保持固定间距 */
.post-count {
    color: #888;
    font-size: 0.85em;
    text-align: right;
    margin-right: 15px;
    white-space: nowrap;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.suggestion-item div {
    display: flex;
    flex-direction: column;
}

.en-name {
    font-weight: bold;
    color: #333;
}

.cn-name {
    font-size: 0.9em;
    color: #666;
    margin-top: 2px;
}

.post-count {
    color: #888;
    font-size: 0.85em;
    min-width: 50px;
    text-align: right;
}

/* Category colors (similar to Danbooru conventions) */
.tag-cat-0 .en-name { color: #0075f8; } /* General */
.tag-cat-1 .en-name { color: #aa0000; } /* Artist */
.tag-cat-3 .en-name { color: #a0a; }    /* Copyright */
.tag-cat-4 .en-name { color: #0a0; }    /* Character */
 
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0;
}
.modal-row label {
    min-width: 90px;
    color: #333;
}
.modal-row input, .modal-row textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.modal-row textarea {
    min-height: 80px;
    resize: vertical;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}
.modal-actions button {
    padding: 8px 12px;
    border: none;
    background: #0075f8;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}
.modal-actions button#fb-cancel {
    background: #888;
}
.modal-msg {
    margin-top: 8px;
    color: #aa0000;
    font-size: 13px;
}
