/* 站点管理样式 */
.sites-controls {
    margin-bottom: 15px;
}

.sites-btn {
    position: relative;
    transition: all 0.3s;
    margin-bottom: 15px;
    /* 增加底部间距，确保有足够空间显示多行 */
}

.sites-btn.edit-mode {
    cursor: move;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.sites-icon {
    position: relative;
}

.sites-icon:hover .site-controls-top {
    display: flex;
    /* 鼠标悬停时显示按钮 */
}

.site-controls {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1010;
    /* 提高z-index确保按钮不被遮挡 */
}

.site-controls-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    /* 更高的z-index确保按钮显示在最上层 */
    bottom: auto;
    display: none;
    /* 默认隐藏 */
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    /* 确保按钮垂直居中 */
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* 半透明背景，提高按钮可见度 */
}

.site-controls button {
    margin: 0 2px;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

/* 拖拽时的样式 */
.site-ghost {
    opacity: 0.5;
    background: rgba(0, 123, 255, 0.2);
}

.site-chosen {
    background: rgba(0, 123, 255, 0.2);
}

/* 顶部编辑按钮样式 */
.nav-login .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 确保上传按钮与其他按钮在同一水平线上 */
.nav-login label.btn {
    display: inline-block;
    /* 使按钮成为块级元素，确保正确的布局行为 */
    vertical-align: middle;
    /* 使按钮垂直居中 */
    margin-bottom: 0;
    /* 消除可能的底部间距 */
}

.nav-login .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-login .btn i {
    font-size: 1em;
}

/* 调整按钮间距 */
.nav-login .ml-1 {
    margin-left: 0.25rem !important;
}

.nav-login .ml-3 {
    margin-left: 1rem !important;
}

/* 编辑对话框样式 */
.site-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
}

.site-edit-modal-content {
    background-color: #222;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.site-edit-modal-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-edit-modal-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-edit-modal-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px;
    background-color: #333;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
}

/* 确保标签页预览区域中的所有标签都能显示 */
.existing-sites-container {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
}

/* 确保编辑按钮在所有标签页上都能正常显示 */
.existing-sites-container .site-item {
    position: relative;
}

.existing-sites-container .site-item .edit-btn,
.existing-sites-container .site-item .delete-btn {
    position: absolute;
    z-index: 1010;
    /* 提高z-index确保按钮不被遮挡 */
    display: block;
    top: 5px;
}

.existing-sites-container .site-item .edit-btn {
    right: 25px;
}

.existing-sites-container .site-item .delete-btn {
    right: 5px;
}

/* 确保标签页内容不会被编辑按钮遮挡 */
.existing-sites-container .site-item .site-content {
    padding-top: 10px;
}

.existing-site-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.existing-site-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.existing-site-item img {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* 1.5列布局样式 */
.col-lg-1-5 {
    flex: 0 0 12.5%;
    max-width: 12.5%;
}

@media (max-width: 992px) {
    .col-md-1-5 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (max-width: 768px) {
    .col-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 调整容器最大宽度和边距 */
.container-md.px-5 {
    max-width: 85% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* 优化图标显示 */
.sites-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sites-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 调整主体部分的垂直位置 */
.header-big {
    margin-top: -40vh;
    /* 上移20% */
    position: relative;
}

/* 调整快捷站点区域的位置 */
.quick-sites {
    position: relative;
    margin-top: -2vh;
    /* 微调快捷站点区域位置 */
}

/* 调整快捷站点容器高度，确保有足够空间显示所有标签 */
.quick-sites .container-md {
    height: auto !important;
    min-height: 250px;
    padding-bottom: 30px;
}

/* 确保页面内容整体居中 */
.page-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* 调整页脚位置 */
.main-footer {
    margin-top: auto;
}