/* 操作菜单 */
.action-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;
}

.action-menu button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.action-menu button:hover {
    background-color: #f1f3f4;
}

/* 列表项 */
.book-item, .image-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.book-item:hover, .image-item:hover {
    background-color: #f8f9fa;
}

/* 弹窗 */
.auth-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    padding: 30px 40px 30px 20px;
    border-radius: 10px;
    z-index: 1000;
    display: none;
    width: 380px;
}


/* 操作菜单默认隐藏 */
/* 合并后的 .action-menu 样式（原重复定义） */
.action-menu {
    display: none;
    position: absolute;
    right: 0; 
    top: 100%; 
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 120px;  /* 取较大值保证兼容性 */
    z-index: 1000;
}

/* 显示菜单 */
.action-menu.show {
    display: block;
}

.book-item {
    display: flex;          /* 使用Flex布局 */
    justify-content: space-between; /* 子元素左右两端对齐 */
    align-items: center;    /* 垂直居中对齐 */
    padding: 8px 10px;      /* 内边距增加点击区域 */
    border-bottom: 1px solid #eee; /* 分隔线 */
    width: 100%;            /* 占满父容器宽度 */
    cursor: pointer;        /* 鼠标指针提示可点击 */
    transition: background-color 0.2s; /* 悬停过渡效果 */
}

.book-item:hover, .image-item:hover, .music-item:hover, .movie-item:hover, .folder-item:hover, .game-item:hover {
    background-color: #f8f9fa; 
}

.book-item span, .image-item span, .music-item span, .movie-item span, .folder-item span, .game-item span {
    flex: 1;                /* 文件名占满剩余空间 */
    overflow: hidden;       /* 内容溢出隐藏 */
    white-space: nowrap;    /* 不换行 */
    text-overflow: ellipsis; /* 溢出显示省略号 */
}

/* 统一操作区域样式（与library的book-actions保持一致） */
.image-actions, .music-actions, .movie-actions, .folder-actions, .game-actions {
    margin-left: 10px;      /* 操作区域与文件名保持间距 */
    position: relative;     /* 为下拉菜单定位 */
}

/* 统一操作按钮（"..."）样式 */
.image-actions .action-dots, .music-actions .action-dots, .movie-actions .action-dots, 
.folder-actions .action-dots, .game-actions .action-dots {
    cursor: pointer;        /* 鼠标指针提示可点击 */
    padding: 0 5px;         /* 增加点击区域 */
    font-size: 1.2em;       /* 增大"..."显示 */
    color: #666;            /* 调整颜色提高可见性 */
}
.book-item, .image-item, .music-item, .movie-item {  /* 新增.movie-item到统一样式组 */
    display: flex;          
    justify-content: space-between; 
    align-items: center;    
    padding: 8px 10px;      
    border-bottom: 1px solid #eee; 
    width: 100%;            
    cursor: pointer;        
    transition: background-color 0.2s; 
}

.book-item:hover, .image-item:hover, .music-item:hover {  /* 同步悬停效果 */
    background-color: #f8f9fa; 
}

/* 统一游戏模块表格样式（与folders一致） */
#games-list table {
    border-collapse: collapse;
    width: 100%;
}

#games-list th, #games-list td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#games-list th {
    background-color: #f8f9fa;
}

#games-list tr:hover {
    background-color: #f1f1f1;
}


/* 游戏列表块状布局 */
.game-blocks {
    display: grid !important; /* 强制使用grid布局 */
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
    padding: 10px;
    min-height: calc(3 * (120px + 15px) - 15px);
}

.game-block {
    background: #ffffff; /* 岛屿背景色 */
    border: 1px solid #e0e0e0; /* 浅边框 */
    border-radius: 8px; /* 圆角 */
    padding: 15px;
    height: 120px; /* 固定高度（可根据需求调整） */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 轻微阴影，模拟岛屿效果 */
    cursor: pointer;
    transition: transform 0.2s;
}

.game-block:hover {
    transform: translateY(-2px); /* 悬停微抬升 */
}

.game-block .game-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 名称过长时省略 */
}

.game-block .game-meta {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}


.delete-music:disabled,
.delete-btn:disabled,
.folders-delete-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.content-span:hover {
    overflow: visible;    /* 鼠标悬停时取消溢出隐藏 */
    white-space: normal;  /* 允许换行显示完整内容 */
    position: relative;   /* 防止内容溢出影响布局 */
    z-index: 1;           /* 确保内容显示在其他元素上方 */
}

/* 隐藏Chrome浏览器音频控件的下载按钮 */
#audio#main-audio::-webkit-media-controls-download-button {
    display: none !important;
}

/* 调整Firefox浏览器音频控件的溢出区域（间接隐藏下载选项） */
#audio#main-audio::--moz-media-controls {
    overflow: hidden !important;
}

#audio#main-audio::--moz-media-controls-enclosure {
    width: calc(100% + 30px) !important; /* 扩展面板宽度避免空白 */
}