/* --- 1. 容器佈局 (Containers) --- */
#tableList {
    margin-top: 5px;
    overflow-x: hidden;
    font-size: 14px;
}

#tableList ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-sub-container {
    margin-top: 2px;
    padding-left: 15px;
    /* 基礎縮排 */
}

/* --- 2. 按鈕基礎樣式 --- */
#dbBtn,
.tableBtn {
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

#dbBtn {
    font-size: 14px;
    color: black;
    max-width: 70%;
}

.tableBtn {
    font-size: 12px;
    color: #333;
    padding: 2px 0;
}

#dbBtn.pressed,
.tableBtn.pressed {
    font-weight: bold;
    transform: translateY(1px);
}

/* --- 3. 新增功能模組 (通用與差異化) --- */

/* 通用新增按鈕樣式 */
#addDatabaseBtn,
#addTableBtn {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

/* 資料集(大項)樣式 */
#addDatabaseBtn {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

#addDatabaseBtn:hover {
    color: #000;
    font-weight: bold;
}

/* 資料表(子項)樣式：縮排與文字變小 */
#addTableBtn {
    font-size: 12px;
    /* 文字更小 */
    color: #444;
    margin-top: 0px;
    margin-bottom: 2px;
    padding-left: 0px;
    /* 額外縮排 */
}

#addTableBtn:hover {
    color: #000;
    font-weight: bold;
}

/* 輸入框樣式調整 */
.add-db-input {
    width: 100%;
    height: 22px;
    margin-top: 4px;
    padding: 0 2px;
    font-size: 12px;
    border: none;
    border-bottom: 1px solid #ccc;
    background-color: transparent;
    outline: none;
    box-sizing: border-box;
}

/* 子層輸入框微調 */
.table-sub-container .add-db-input {
    font-size: 11px;
    width: 90%;
    /* 寬度稍微縮減 */
}

/* --- 4. 點點填充線與垃圾桶 (其餘樣式保持不變) --- */
.db-item-header,
.table-item-header {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 24px;
}

.item-filler {
    flex-grow: 1;
    margin: 0 8px;
    border-bottom: 2px dotted #888;
    height: 12px;
    opacity: 0.7;
    align-self: stretch;
}

.delete-btn {
    padding: 0 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #888;
}

.delete-btn:hover {
    color: #ff4d4f !important;
}

.delete-btn svg {
    width: 14px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.trash-lid {
    transition: transform 0.3s ease;
    transform-origin: 3px 6px;
}

.delete-btn:hover .trash-lid {
    transform: rotate(-45deg);
}

#authActions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#authActions button {
    padding: 5px 10px;
    cursor: pointer;
}

/* --- 5. 側邊欄擴充樣式 --- */
#userInfoSection {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

#authSection {
    margin-top: 10px;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

.auth-btn {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #666;
    padding: 5px 0;
    transition: all 0.2s;
}

.auth-btn:hover {
    color: #ff4d4f;
    /* 這裡改為紅色 */
    font-weight: bold;
}